{"id":206196,"date":"2013-12-16T12:51:03","date_gmt":"2013-12-16T08:51:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=206196"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=206196","title":{"rendered":"<span class=\"post_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Hadoop 2.2.0 \u0441 \u043d\u0443\u043b\u044f<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b1b\/ba9\/391\/b1bba93918fcd31dcd41dd83b9860542.png\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Hadoop \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043e\u0432.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043d\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443\/\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 Hadoop, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043b\u0438\u0431\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 (0.X.X \u0438 1.X.X), \u043b\u0438\u0431\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 single mode\/pseudo distributed mode \u0438 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e fully distributed mode. \u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u0432\u043e\u0432\u0441\u0435.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f Hadoop, \u0442\u043e \u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0441\u043c\u043e\u0433 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 deprecated \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0410 \u0434\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b, \u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043a\u0430\u043b \u043e\u0442\u0432\u0435\u0442\u044b. \u0422\u0430\u043a\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0435 <a href=\"http:\/\/toster.ru\/q\/57046\">\u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/a> \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439.<\/p>\n<p>  \u0412\u0441\u0435\u043c \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h4>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/www.ubuntu.com\/download\/server\">Ubuntu Server 12.04.3 LTS<\/a>, \u043d\u043e \u043f\u0440\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0448\u0430\u0433\u0438 \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u041e\u0421.<\/p>\n<p>  \u0412\u0441\u0435 \u0443\u0437\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 VirtualBox. \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435. \u0412\u0441\u0435\u0433\u043e 8 GB \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0436\u0451\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430, \u043e\u0434\u043d\u043e \u044f\u0434\u0440\u043e \u0438 512 \u041c\u0431 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u043d\u0430\u0449\u0435\u043d\u0430 \u0434\u0432\u0443\u043c\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430\u043c\u0438: \u043e\u0434\u0438\u043d NAT, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u044b\u043b\u0430 \u0441\u043a\u0430\u0447\u0435\u043d\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c ssh \u0438 rsync:  <\/p>\n<pre><code class=\"bash\">sudo apt-get update && sudo apt-get upgrade sudo apt-get install ssh sudo apt-get install rsync <\/code><\/pre>\n<h4>Java<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Hadoop \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e 6 \u0438\u043b\u0438 7 \u0432\u0435\u0440\u0441\u0438\u044e.<br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 OpenJDK 7 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<pre><code class=\"bash\">$ sudo apt-get install openjdk-7-jdk <\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043e\u0442 Oracle.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u043a\u0430\u043a?<\/b><\/p>\n<div class=\"spoiler_text\">\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u041e\u0421 \u043e\u0442 \u0432\u0441\u0435\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 OpenJDK sudo apt-get purge openjdk*<br \/>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c python-software-properties \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 PPA:  <\/p>\n<pre><code class=\"bash\">sudo apt-get install python-software-properties <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c PPA \u0441 <a href=\"https:\/\/launchpad.net\/\">launchpad.net\/<\/a>~webupd8team\/+archive\/java  <\/p>\n<pre><code class=\"bash\">sudo add-apt-repository ppa:webupd8team\/java sudo apt-get update sudo apt-get install oracle-java7-installer <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: <a href=\"http:\/\/www.webupd8.org\/2012\/01\/install-oracle-java-jdk-7-in-ubuntu-via.html\">INSTALL ORACLE JAVA 7 IN UBUNTU VIA PPA REPOSITORY<\/a>  <\/div>\n<\/div>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Hadoop<\/h4>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Hadoop. \u042d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432\u0430 sudo, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c.<\/p>\n<pre><code class=\"bash\">sudo addgroup hadoop sudo adduser --ingroup hadoop hduser sudo usermod -aG sudo hduser <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0435\u043c\u0443 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<h4>\/etc\/hosts<\/h4>\n<p>  \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0443\u0437\u043b\u044b \u043c\u043e\u0433\u043b\u0438 \u043b\u0435\u0433\u043a\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443. \u0412 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c dns \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0444\u0430\u0439\u043b hosts. \u0412 \u043d\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 ip-\u0430\u0434\u0440\u0435\u0441\u0430 \u0443\u0437\u043b\u0430 \u043a \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u0432 \u0441\u0435\u0442\u0438. \u0414\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0432\u0430\u0448 \u0444\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">127.0.0.1       localhost   # The following lines are desirable for IPv6 capable hosts ::1     ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters   192.168.0.1 master <\/code><\/pre>\n<h4>SSH<\/h4>\n<p>  \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 hadoop \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e ssh. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f hduser \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a master.<br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 ssh \u043a\u043b\u044e\u0447:<\/p>\n<pre><code class=\"bash\">ssh-keygen -t rsa -P &quot;&quot; <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d \u043f\u0430\u0440\u043e\u043b\u044c. \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u0435\u0433\u043e \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"bash\">cat $HOME\/.ssh\/id_rsa.pub &gt;&gt; $HOME\/.ssh\/authorized_keys <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u0441\u0435\u0431\u0435:<\/p>\n<pre><code class=\"bash\">ssh master <\/code><\/pre>\n<h4>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 IPv6<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c IPv6, \u0442\u043e \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<br \/>  \u0414\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f IPv6 \u0432 Ubuntu 12.04 \/ 12.10 \/ 13.04 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b sysctl.conf:<\/p>\n<pre><code class=\"bash\">sudo vim \/etc\/sysctl.conf <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<pre><code class=\"bash\"># IPv6 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 <\/code><\/pre>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d IPv6!<\/b><\/p>\n<div class=\"spoiler_text\">\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c ipv6 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 hadoop \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0444\u0430\u0439\u043b etc\/hadoop\/hadoop-env.sh:  <\/p>\n<pre><code class=\"bash\">export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Apache Hadoop<\/h4>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<br \/>  \u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"http:\/\/www.apache.org\/dyn\/closer.cgi\/hadoop\/common\/\">www.apache.org\/dyn\/closer.cgi\/hadoop\/common\/<\/a><\/p>\n<p>  \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u0435\u043a\u0430\u0431\u0440\u044f 2013 \u0433\u043e\u0434\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f 2.2.0.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 downloads \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0438 \u0441\u043a\u0430\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e:<\/p>\n<pre><code class=\"bash\">sudo mkdir \/downloads cd downloads\/ sudo wget http:\/\/apache-mirror.rbc.ru\/pub\/apache\/hadoop\/common\/stable\/hadoop-2.2.0.tar.gz <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0432 \/usr\/local\/, \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 \u0438 \u0432\u044b\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e hduser \u043f\u0440\u0430\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"bash\">sudo mv \/downloads\/hadoop-2.2.0.tar.gz \/usr\/local\/ cd \/usr\/local\/ sudo tar xzf hadoop-2.2.0.tar.gz sudo mv hadoop-2.2.0 hadoop chown -R hduser:hadoop hadoop <\/code><\/pre>\n<h4>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 $HOME\/.bashrc<\/h4>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 .bashrc \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"bash\">#Hadoop variables export JAVA_HOME=\/usr\/lib\/jvm\/java-1.7.0-openjdk-i386 export HADOOP_INSTALL=\/usr\/local\/hadoop export PATH=$PATH:$HADOOP_INSTALL\/bin export PATH=$PATH:$HADOOP_INSTALL\/sbin export HADOOP_MAPRED_HOME=$HADOOP_INSTALL export HADOOP_COMMON_HOME=$HADOOP_INSTALL export HADOOP_HDFS_HOME=$HADOOP_INSTALL export YARN_HOME=$HADOOP_INSTALL <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438.  <\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Apache Hadoop<\/h4>\n<p>  \u0412\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0442\u0438\u0441\u044c \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \/usr\/local\/hadoop.<br \/>  \u041e\u0442\u043a\u0440\u043e\u0435\u043c etc\/hadoop\/hadoop-env.sh \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c JAVA_HOME.<\/p>\n<pre><code class=\"bash\">vim \/usr\/local\/hadoop\/etc\/hadoop\/hadoop-env.sh <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0443\u0437\u043b\u044b \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 etc\/hadoop\/slaves<\/p>\n<pre><code class=\"bash\">master <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0443\u0437\u043b\u0435. \u0412\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 etc\/hadoop\/core-site.xml:  <\/p>\n<pre><code class=\"xml\">&lt;configuration&gt;             &lt;property&gt;                        &lt;name&gt;fs.defaultFS&lt;\/name&gt;                        &lt;value&gt;hdfs:\/\/master:9000&lt;\/value&gt;             &lt;\/property&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 HDFS \u043b\u0435\u0436\u0430\u0442 \u0432 etc\/hadoop\/hdfs-site.xml:<\/p>\n<pre><code class=\"xml\">&lt;configuration&gt;             &lt;property&gt;                        &lt;name&gt;dfs.replication&lt;\/name&gt;                        &lt;value&gt;1&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;dfs.namenode.name.dir&lt;\/name&gt;                        &lt;value&gt;file:\/usr\/local\/hadoop\/tmp\/hdfs\/namenode&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;dfs.datanode.data.dir&lt;\/name&gt;                        &lt;value&gt;file:\/usr\/local\/hadoop\/tmp\/hdfs\/datanode&lt;\/value&gt;             &lt;\/property&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 dfs.replication \u0437\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u043f\u043b\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e <\/p>\n<p>  3. \u041e\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0437\u043b\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435.<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b dfs.namenode.name.dir \u0438 dfs.datanode.data.dir \u0437\u0430\u0434\u0430\u044e\u0442 \u043f\u0443\u0442\u0438, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 HDFS. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 tmp.<\/p>\n<p>  \u0421\u043e\u043e\u0431\u0449\u0438\u043c \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443, \u0447\u0442\u043e \u043c\u044b \u0436\u0435\u043b\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c YARN. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c etc\/hadoop\/mapred-site.xml:<\/p>\n<pre><code class=\"xml\">&lt;configuration&gt;             &lt;property&gt;                        &lt;name&gt;mapreduce.framework.name&lt;\/name&gt;                        &lt;value&gt;yarn&lt;\/value&gt;             &lt;\/property&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 YARN \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 etc\/hadoop\/yarn-site.xml:<\/p>\n<pre><code class=\"xml\">&lt;configuration&gt;             &lt;property&gt;                        &lt;name&gt;yarn.nodemanager.aux-services&lt;\/name&gt;                        &lt;value&gt;mapreduce_shuffle&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.nodemanager.aux-services.mapreduce.shuffle.class&lt;\/name&gt;                        &lt;value&gt;org.apache.hadoop.mapred.ShuffleHandler&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.resourcemanager.scheduler.address&lt;\/name&gt;                        &lt;value&gt;master:8030&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.resourcemanager.address&lt;\/name&gt;                        &lt;value&gt;master:8032&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.resourcemanager.webapp.address&lt;\/name&gt;                        &lt;value&gt;master:8088&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.resourcemanager.resource-tracker.address&lt;\/name&gt;                        &lt;value&gt;master:8031&lt;\/value&gt;             &lt;\/property&gt;             &lt;property&gt;                        &lt;name&gt;yarn.resourcemanager.admin.address&lt;\/name&gt;                        &lt;value&gt;master:8033&lt;\/value&gt;             &lt;\/property&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 resourcemanager \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0443\u0437\u043b\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c HDFS:  <\/p>\n<pre><code class=\"bash\">bin\/hdfs namenode \u2013format <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c hadoop \u0441\u043b\u0443\u0436\u0431\u044b:<\/p>\n<pre><code class=\"bash\">sbin\/start-dfs.sh sbin\/start-yarn.sh <\/code><\/pre>\n<p>  *\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Hadoop \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 sbin\/start-all.sh, \u043d\u043e \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.*.* \u043e\u043d \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c.<\/p>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 java-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b:  <\/p>\n<pre><code class=\"bash\">hduser@master:\/usr\/local\/hadoop$ jps 4868 SecondaryNameNode 5243 NodeManager 5035 ResourceManager 4409 NameNode 4622 DataNode 5517 Jps <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"bash\">bin\/hadoop jar share\/hadoop\/mapreduce\/hadoop-mapreduce-examples-2.2.0.jar <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043f\u0438\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<p>  \u041d\u0430 \u043a\u043e\u043f\u0438\u044f\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0442\u044c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 MAC-\u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0438 \u043d\u0430 \u043d\u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 ip-\u0430\u0434\u0440\u0435\u0441\u0430. \u0412 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0441 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u0432\u0438\u0434\u0430 192.168.0.X.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \/etc\/hosts \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0435\u043c \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0441\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">127.0.0.1       localhost   # The following lines are desirable for IPv6 capable hosts ::1     ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters   192.168.0.1 master 192.168.0.2 slave1 192.168.0.3 slave2 <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \u043d\u0430 slave1 \u0438 slave2.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0430\u043a?<\/b><\/p>\n<div class=\"spoiler_text\">\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430: \/etc\/hostname \u0438 \/etc\/hosts.  <\/div>\n<\/div>\n<p>  \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u043d\u0430 \u0443\u0437\u043b\u0430\u0445 \u043d\u043e\u0432\u044b\u0435 SSH-\u043a\u043b\u044e\u0447\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u0445 \u0432\u0441\u0435 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0437\u043b\u0435 master.<\/p>\n<p>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 dfs.replication \u0432 etc\/hadoop\/hdfs-site.xml. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0435\u0437\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 3.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">etc\/hadoop\/hdfs-site.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;configuration&gt;             &lt;property&gt;                        &lt;name&gt;dfs.replication&lt;\/name&gt;                        &lt;value&gt;3&lt;\/value&gt;             &lt;\/property&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u0443\u0437\u043b\u0435 master \u043d\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b \u0432 \u0444\u0430\u0439\u043b etc\/hadoop\/slaves:<\/p>\n<pre><code class=\"bash\">master slave1 slave2 <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b, \u0442\u043e \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0443\u0437\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<pre><code class=\"bash\">bin\/hdfs namenode \u2013format sbin\/start-dfs.sh sbin\/start-yarn.sh <\/code><\/pre>\n<p>  \u041d\u0430 slave-\u0443\u0437\u043b\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b:<\/p>\n<pre><code class=\"bash\">hduser@slave1:\/usr\/local\/hadoop$ jps 1748 Jps 1664 NodeManager 1448 DataNode <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0438\u043d\u0438-\u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 Word Count.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 HDFS \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<br \/>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u044f \u0432\u0437\u044f\u043b \u043a\u043d\u0438\u0433\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 txt \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/www.gutenberg.org\/\">Free ebooks \u2014 Project Gutenberg<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">cd \/home\/hduser mkdir books cd books wget http:\/\/www.gutenberg.org\/cache\/epub\/20417\/pg20417.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/5000\/pg5000.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/4300\/pg4300.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/972\/pg972.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/132\/pg132.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/1661\/pg1661.txt wget http:\/\/www.gutenberg.org\/cache\/epub\/19699\/pg19699.txt <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u043d\u0430\u0448\u0438 \u0444\u0430\u0439\u043b\u044b \u0432 HDFS:  <\/p>\n<pre><code class=\"bash\">cd \/usr\/local\/hadoop bin\/hdfs dfs -mkdir \/in bin\/hdfs dfs -copyFromLocal \/home\/hduser\/books\/* \/in bin\/hdfs dfs -ls \/in <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c Word Count:<\/p>\n<pre><code class=\"bash\">bin\/hadoop jar share\/hadoop\/mapreduce\/hadoop-mapreduce-examples-2.2.0.jar wordcount \/in \/out <\/code><\/pre>\n<p>  \u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0430 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ResourceManager&#8217;\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/master\">master<\/a>:8088\/cluster\/apps\/<\/p>\n<p>  \u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 \/out \u0432 HDFS. <br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:  <\/p>\n<pre><code class=\"bash\">bin\/hdfs dfs -copyToLocal \/out \/home\/hduser\/ <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0445 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/206196\/\"> http:\/\/habrahabr.ru\/post\/206196\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/b1b\/ba9\/391\/b1bba93918fcd31dcd41dd83b9860542.png\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Hadoop \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043e\u0432.<\/p>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043d\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443\/\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 Hadoop, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043b\u0438\u0431\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 (0.X.X \u0438 1.X.X), \u043b\u0438\u0431\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 single mode\/pseudo distributed mode \u0438 \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e fully distributed mode. \u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442 \u0432\u043e\u0432\u0441\u0435.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f Hadoop, \u0442\u043e \u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0441\u043c\u043e\u0433 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 deprecated \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0410 \u0434\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b, \u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043a\u0430\u043b \u043e\u0442\u0432\u0435\u0442\u044b. \u0422\u0430\u043a\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0435 <a href=\"http:\/\/toster.ru\/q\/57046\">\u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/a> \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439.<\/p>\n<p>  \u0412\u0441\u0435\u043c \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-206196","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/206196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=206196"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/206196\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=206196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=206196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=206196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}