1 tar -zxvf hadoop-1.1.2.tar.gz
2 在hadoop/conf目录
(1) 编辑 hadoop-env.sh
export JAVA_HOME=/usr/java/jdk1.7.0_25
然后运行hadoop-env.sh
(2) 编辑 core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://yjdabc:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/yjdabc/hadooptmp</value>
</property>
</configuration> (3)配置hdfs-site.xml
<configuration>
<property>
<name>dfs.name.dir</name>
<value>/home/yjdabc/hadoop-1.1.2/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/home/yjdabc/hadoop-1.1.2/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
(4)配置mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>yjdabc:9001</value>
</property>
</configuration>
(5)配置masters文件和slaves文件
将里面内容改为:yjdabc
(6)vi /etc/hosts
127.0.0.1 yjdabc yjdabc.centOSDomain localhost.localdomain localhost
::1 yjdabc yjdabc.centOSDomain localhost6.localdomain6 localhost6
yjdabc master
yjdabc slave 3 验证Hadoop(修改配置项后,一定要运行此命令重新配置namenode)
在hadoop/bin目录下
./hadoop namenode -format 4 启动Hadoop
在hadoop/bin目录下
./start-all.sh 5 查看JPS查看hadoop是否完全启动
[root@localhost bin]# jps
15219 JobTracker
15156 SecondaryNameNode
15495 Jps
15326 TaskTracker
15044 DataNode
14959 NameNode 6 查看集群状态
./hadoop dfsadmin -report