YARN-HA搭建
集群
node1 | node2 | node3 |
---|---|---|
NameNode | NameNode | |
JournalNode | JournalNode | JournalNode |
DataNode | DataNode | DataNode |
ZK | ZK | ZK |
ResourceManager | ResourceManager | |
NodeManager | NodeManager | NodeManager |
zookeeper集群提前启动
[node1/node2/node3]# zkServer.sh start
yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.application.classpath</name>
<value>
/opt/app/hadoop-2.8.5/etc/hadoop,
/opt/app/hadoop-2.8.5/share/hadoop/common/*,
/opt/app/hadoop-2.8.5/share/hadoop/common/lib/*,
/opt/app/hadoop-2.8.5/share/hadoop/hdfs/*,
/opt/app/hadoop-2.8.5/share/hadoop/hdfs/lib/*,
/opt/app/hadoop-2.8.5/share/hadoop/mapreduce/*,
/opt/app/hadoop-2.8.5/share/hadoop/mapreduce/lib/*,
/opt/app/hadoop-2.8.5/share/hadoop/yarn/*,
/opt/app/hadoop-2.8.5/share/hadoop/yarn/lib/*
</value>
</property>
<!--启用resourcemanager ha-->
<property>
<name>yarn.resourcemanager.ha.enabled</name>
<value>true</value>
</property>
<!--声明两台resourcemanager的地址-->
<property>
<name>yarn.resourcemanager.cluster-id</name>
<value>cluster-yarn1</value>
</property>
<property>
<name>yarn.resourcemanager.ha.rm-ids</name>
<value>rm1,rm2</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm1</name>
<value>node1</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>node2</value>
</property>
<!--指定zookeeper集群的地址-->
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>node1:2181,node2:2181,node3:2181</value>
</property>
<!--启用自动恢复-->
<property>
<name>yarn.resourcemanager.recovery.enabled</name>
<value>true</value>
</property>
<!--指定resourcemanager的状态信息存储在zookeeper集群-->
<property>
<name>yarn.resourcemanager.store.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value>
</property>
</configuration>
yarn-env.sh
export JAVA_HOME=/opt/app/jdk1.8.0_321
启动情况
# 单进程独立启动:
yarn-deamon.sh start/stop resourcemanager/nodemanager
# 全部启动:
start-yarn(HA模式无法启动)
本文来自博客园,作者:jsqup,转载请注明原文链接:https://www.cnblogs.com/jsqup/p/16673075.html