linuxidc@ubuntu:~$ sudo tar zxf hadoop-1.2.1.tar.gz -C /opt/ [sudo] password for linuxidc: jerry@ubuntu:~$ cd /opt/hadoop-1.2.1/ linuxidc@ubuntu:/opt/hadoop-1.2.1$ ls bin hadoop-ant-1.2.1.jar ivy sbin build.xml hadoop-client-1.2.1.jar ivy.xml share c++ hadoop-core-1.2.1.jar lib src CHANGES.txt hadoop-examples-1.2.1.jar libexec webapps conf hadoop-minicluster-1.2.1.jar LICENSE.txt contrib hadoop-test-1.2.1.jar NOTICE.txt docs hadoop-tools-1.2.1.jar README.txt linuxidc@ubuntu:/opt/hadoop-1.2.1$ cd conf/ linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ ls capacity-scheduler.xml hadoop-policy.xml slaves configuration.xsl hdfs-site.xml ssl-client.xml.example core-site.xml log4j.properties ssl-server.xml.example fair-scheduler.xml mapred-queue-acls.xml taskcontroller.cfg hadoop-env.sh mapred-site.xml task-log4j.properties hadoop-metrics2.properties masters linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ vim hadoop-env.sh linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim hadoop-env.sh linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ tail -n 1 hadoop-env.sh export JAVA_HOME=/usr/lib/jvm/java linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim core-site.xml linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat core-site.xml <?xml version=https://www.linuxidc.com/Linux/2016-09/"1.0"?> <?xml-stylesheet type=https://www.linuxidc.com/Linux/2016-09/"text/xsl" href=https://www.linuxidc.com/Linux/2016-09/"configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>fs.default.name</name> <value>hdfs://master:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/hadoop/hadooptmp</value> </property> </configuration> linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim hdfs-site.xml linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat hdfs-site.xml <?xml version=https://www.linuxidc.com/Linux/2016-09/"1.0"?> <?xml-stylesheet type=https://www.linuxidc.com/Linux/2016-09/"text/xsl" href=https://www.linuxidc.com/Linux/2016-09/"configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>dfs.replication</name> <value>3</value> </property> <property> <name>dfs.name.dir</name> <value>/hadoop/hdfs/name</value> </property> <property> <name>dfs.data.dir</name> <value>/hadoop/hdfs/data</value> </property> </configuration> linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred- linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred-site.xml linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat mapred-site.xml <?xml version=https://www.linuxidc.com/Linux/2016-09/"1.0"?> <?xml-stylesheet type=https://www.linuxidc.com/Linux/2016-09/"text/xsl" href=https://www.linuxidc.com/Linux/2016-09/"configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapred.job.tracker</name> <value>master:9001</value> </property> </configuration> linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim mapred-site.xml linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat mapred-site.xml <?xml version=https://www.linuxidc.com/Linux/2016-09/"1.0"?> <?xml-stylesheet type=https://www.linuxidc.com/Linux/2016-09/"text/xsl" href=https://www.linuxidc.com/Linux/2016-09/"configuration.xsl"?> <!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>mapred.job.tracker</name> <value>master:9001</value> </property> <property> <name>mapred.system.dir</name> <value>/hadoop/mapred/mapred_system</value> </property> <property> <name>mapred.local.dir</name> <value>/hadoop/mapred/mapred_local</value> </property> </configuration> linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ ls capacity-scheduler.xml hadoop-policy.xml slaves configuration.xsl hdfs-site.xml ssl-client.xml.example core-site.xml log4j.properties ssl-server.xml.example fair-scheduler.xml mapred-queue-acls.xml taskcontroller.cfg hadoop-env.sh mapred-site.xml task-log4j.properties hadoop-metrics2.properties masters linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim masters linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ sudo vim slaves linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat masters master linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$ cat slaves master slave1 slave2 linuxidc@ubuntu:/opt/hadoop-1.2.1/conf$
在master、slave1和slave2上的hadoop用户目录下创建好.ssh文件夹