Hadoop的运行模式可分为单机模式、伪分布模式和分布模式。
伪分布模式安装:
首先下载Hadoop 1.2.1到本机,再解压到用户目录下。然后配置hadoop分布式文件系统的地址和端口,修改hdfs的文件备份数量为1,配置mapreduce的job tracker的地址和端口
jerry@ubuntu:~/Downloads$ tar zxf hadoop-1.2.1.tar.gz -C ~/hadoop_1.2.1 jerry@ubuntu:~/Downloads$ cd ~/hadoop_1.2.1/ jerry@ubuntu:~/hadoop_1.2.1$ ls hadoop-1.2.1 jerry@ubuntu:~/hadoop_1.2.1$ cd hadoop-1.2.1/ jerry@ubuntu:~/hadoop_1.2.1/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 jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1$ cd conf/ jerry@ubuntu:~/hadoop_1.2.1/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 jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ sudo vim hadoop-env.sh n [sudo] password for jerry: 2 files to edit jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ sudo vim hadoop-env.sh jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ tail -n 1 hadoop-env.sh export JAVA_HOME=/usr/lib/jvm/jdk jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ sudo vim core-site.xml jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ tail -n 6 core-site.xml <configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost:9000</value> </property> </configuration> jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ sudo vim hdfs-site.xml jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ tail -n 6 hdfs-site.xml <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> </configuration> jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ sudo vim mapred-site.xml jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$ tail -n 6 mapred-site.xml <configuration> <property> <name>mapred.job.tracker</name> <value>localhost:9001</value> </property> </configuration> jerry@ubuntu:~/hadoop_1.2.1/hadoop-1.2.1/conf$
Linux ->> UBuntu 14.04 LTE下安装Hadoop 1.2.1
原文:http://www.cnblogs.com/jenrrychen/p/5043203.html