https://blog.csdn.net/liuxinghao/article/details/74984123
官方文档
https://hadoop.apache.org/docs/r2.6.5/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html
总览
在此应该实现node008和node009之间的免秘钥
注意,应该提前修改环境变量
mapred-env
hadoop-env
yarn-env
具体怎么改在第9节15图后修改环境变量的位置
mr-hd2.x yarn
--------------------------------
两个rm节点互免秘钥:
08节点 .ssh 目录下: ssh-keygen -t dsa -P '' -f ./id_dsa
cat ~id_dsa.pub >> authorized_keys
scp id_dsa.pub root@node09:`pwd`/node08.pub
09节点 .ssh 目录下 :
cat node08.pub >> authorized_keys
ssh-keygen -t dsa -P '' -f ./id_dsa
cat ~id_dsa.pub >> authorized_keys
scp id_dsa.pub root@node08:`pwd`/node09.pub
08节点 .ssh 目录下:
cat node09.pub >> authorized_keys
(别忘了退出)
重命名: mv mapred-site.xml.template mapred-site.xml
mapred-site.xml
==============================
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
=================================
yarn-site.xml:
=================================
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.resourcemanager.ha.enabled</name>
<value>true</value>
</property>
<property>
<name>yarn.resourcemanager.cluster-id</name>
<value>cluster1</value>
</property>
<property>
<name>yarn.resourcemanager.ha.rm-ids</name>
<value>rm1,rm2</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm1</name>
<value>node08</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>node09</value>
</property>
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>node07:2181,node08:2181,node09:2181</value>
</property>
分发两个文件到:07,08,09节点
scp maprexxxx yarn-xxx node07:`pwd`
scp maprexxxx yarn-xxx node08:`pwd`
scp maprexxxx yarn-xxx node09:`pwd`
启动:node06:
1 zookeeper
2 hdfs (注意,有一个脚本不要用,start-all)start-dfs.sh
如果nn 和 nn2没有启动,需要在node06,node07分别手动启动:
hadoop-daemon.sh start namenode
3 start-yarn.sh (启动nodemanager)
4 在08,09节点分别执行脚本: yarn-daemon.sh start resourcemanager
UI访问: ip:8088
停止:
node06: stop-dfs.sh
node06: stop-yarn.sh (停止nodemanager)
node07,node08: yarn-daemon.sh stop resourcemanager (停止resourcemanager)
搭建目标如下:nm:nodemanege设为7,8,9
复制官方文档的 修改后主要的一句是 hadoop jar hadoop-mapreduce-example-2.6.5.jar wordcount /user/root/test.txt .wordcount
主要是运行MapReduce-example test.txt是要处理文件,wordcount是处理后文件存放路径
可视化
网友评论