hadoop集群搭建--mapreduce on yarn--yarn-HA模式
不需要停掉HDFS的进程,可以直接修改配置文件,启动YARN
1. cp mapred-site.xml.template mapred-site.xml
vi mapred-site.xml
<!--指定mapreduce程序运行在yarn平台上-->
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
2. vi yarn-site.xml
<!--指定启动运行mapreduce上的nodemanager的运行服务-->
<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.zk-address</name>
<value>bd27-server2.rabbit.com:2181,bd27-server3.rabbit.com:2181,bd27-server.rabbit.com:2181</value>
</property>
<property>
<name>yarn.resourcemanager.cluster-id</name>
<value>yarncluster</value>
</property>
<property>
<name>yarn.resourcemanager.ha.rm-ids</name>
<value>rm1,rm2</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm1</name>
<value>bd27-server.rabbit.com</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>bd27-server2.rabbit.com</value>
</property>
在两个被选为resourcemanager的节点上执行:
yarn-daemon.sh start resourcemanager
执行:start-yarn.sh 启动nodemanager
到zk的客户端看一下哪台节点的resourcemanager是active的:
zkCli.sh
get /yarn-leader-election/yarncluster/ActiveStandbyElectorLock