yarn 更新_YARN-HA配置
1 YARN-HA工作機制
http://hadoop.apache.org/docs/r2.7.2/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html
圖3-22 YARN-HA工作機制
2 配置YARN-HA集群
(1)修改IP
(2)修改主機名及主機名和IP地址的映射
(3)關閉防火墻
(4)ssh免密登錄
(5)安裝JDK,配置環境變量等
(6)配置Zookeeper集群
表3-2
hadoop102
hadoop103
hadoop104
NameNode
NameNode
JournalNode
JournalNode
JournalNode
DataNode
DataNode
DataNode
ZK
ZK
ZK
ResourceManager
ResourceManager
NodeManager
NodeManager
NodeManager
(1)yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</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>hadoop102</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>hadoop103</value>
</property>
<!–指定zookeeper集群的地址–>
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>hadoop102:2181,hadoop103:2181,hadoop104: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>
(2)同步更新其他節點的配置信息
(1)在各個JournalNode節點上,輸入以下命令啟動journalnode服務:
sbin/hadoop-daemon.sh start journalnode
(2)在[nn1]上,對其進行格式化,并啟動:
bin/hdfs namenode -format
sbin/hadoop-daemon.sh start namenode
(3)在[nn2]上,同步nn1的元數據信息:
bin/hdfs namenode -bootstrapStandby
(4)啟動[nn2]:
sbin/hadoop-daemon.sh start namenode
(5)啟動所有DataNode
sbin/hadoop-daemons.sh start datanode
(6)將[nn1]切換為Active
bin/hdfs haadmin -transitionToActive nn1
(1)在hadoop102中執行:
sbin/start-yarn.sh
(2)在hadoop103中執行:
sbin/yarn-daemon.sh start resourcemanager
(3)查看服務狀態,如圖3-24所示
bin/yarn rmadmin -getServiceState rm1
圖3-24 YARN的服務狀態
文章來源:大數據培訓
總結
以上是生活随笔為你收集整理的yarn 更新_YARN-HA配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vc6怎么看错误在哪_网红莉哥怎么红的为
- 下一篇: 与虫子尾交3d动画网站_不容错过的三维动