当前位置: 代码迷 >> 综合 >> Yarn HA搭建
  详细解决方案

Yarn HA搭建

热度:70   发布时间:2023-10-19 10:34:30.0

基本集群搭建见这篇博客:hadoop集群搭建笔记
在基本集群搭建上配置下述文件
yarn-site.xml

<configuration><!-- Site specific YARN configuration properties -->
<!-- the mode of data acquirement in reduce-->
<property>name>yarn.nodemanager.aux-services</name><value>mapreduce_shuffle</value></property><!-- FOR LOGS: open the feature of aggregation  -->
<property><name>yarn.log-aggregation-enable</name><value>true</value>
</property>
<!-- FOR LOGS: set the life time for logs (days 7) --><property><name>yarn.log-aggregation.retain-seconds</name><value>604800</value>
</property><!--  Enable RM HA.-->
<property> <name>yarn.resourcemanager.ha.enabled</name> <value>true</value></property>
<!-- Identifies the cluster. Used by the elector to ensure an RM doesn’t take over as Active for another cluster.     -->
<property> <name>yarn.resourcemanager.cluster-id</name> <value>cluster1</value>
</property>
<!--  List of logical IDs for the RMs. e.g., “rm1,rm2”.-->
<property> <name>yarn.resourcemanager.ha.rm-ids</name> <value>rm1,rm2</value>
</property><!-- For each rm-id, specify the hostname the RM corresponds to. Alternately, one could set each of the RM’s service addresses..-->
<property> <name>yarn.resourcemanager.hostname.rm1</name> <value>chdp11</value>
</property>
<property> <name>yarn.resourcemanager.hostname.rm2</name> <value>chdp13</value>
</property><!--  For each rm-id, specify host:port of the RM web application corresponds to. You do not need this if you set yarn.http.policy to HTTPS_ONLY. If set, overrides the hostname set in yarn.resourcemanager.hostname.rm-id.-->
<property> <name>yarn.resourcemanager.webapp.address.rm1</name> <value>chdp11:8088</value>
</property>
<property> <name>yarn.resourcemanager.webapp.address.rm2</name> <value>chdp13:8088</value>
</property><!-- Address of the ZK-quorum. Used both for the state-store and embedded leader-election.-->
<property> <name>yarn.resourcemanager.zk-address</name> <value>chdp11:2181,chdp12:2181,chdp13:2181</value>
</property>

启动YARN
chdp11

/usr/SFT/HA/hadoop-2.7.2/sbin/start-yarn.sh

chdp13

/usr/SFT/HA/hadoop-2.7.2/sbin/yarn-daemon.sh start resourcemanager

查看服务状态

/usr/SFT/HA/hadoop-2.7.2/bin/yarn rmadmin -getServiceState rm1

Yarn HA搭建
Yarn HA搭建

  相关解决方案