主机 | HDFS | MapReduce |
---|---|---|
node1 | NameNode | ResourceManager |
node2 | SecondaryNameNode & DataNode | NodeManager |
node3 | DataNode | NodeManager |
node4 | DataNode | NodeManager |
1.配置hadoop-env.sh
1 | export JAVA_HOME=/csh/link/jdk |
2.配置core-site.xml
1 | <property> |
3.配置hdfs-site.xml
1 | <property> |
4.配置mapred-site.xml
1 | <property> |
5.配置yarn-site.xml
1 | <property> |
6.配置masters
1 | node2 |
7.配置slaves
1 | node2 |
8.启动Hadoop
1 | bin/hadoop namenode -format |
9.运行WordCount程序
1 | //创建文件wc.txt |
10.结果
1 | [root@node1 sbin]# hadoop jar /csh/software/hadoop-2.7.2/share/hadoop/mapreduce/hadoapreduce-examples-2.7.2.jar wordcount /input/wordcount/ /output/wordcount/ |