作者:红酒醉红颜2702937481 | 来源:互联网 | 2023-09-01 16:27
1.停止yarn
$>stop-yarn.sh
2.配置 yarn-site.xml
yarn.resourcemanager.ha.enabledtrue
yarn.resourcemanager.cluster-idrmcluster
yarn.resourcemanager.ha.rm-idsrm1,rm2
yarn.resourcemanager.hostname.rm1s101
yarn.resourcemanager.hostname.rm2s106
yarn.resourcemanager.webapp.address.rm1s101:8088
yarn.resourcemanager.webapp.address.rm2s106:8088
yarn.resourcemanager.zk-addresss102:2181,s103:2181,s104:2181
3.启动yarn
$>start-yarn.sh
4.手动启动第二个RM
$>ssh s106 yarn-daemon.sh start resourcemanager
5.webui查看状态
s101:8088
s106:8088
6.查看zk中RM信息
登录zk客户端,查看元数据信息
zkCli.sh -server s102
7.手动容灾
$ yarn rmadmin -getServiceState rm1 active
$ yarn rmadmin -getServiceState rm2 standby
$ yarn rmadmin -transitionToStandby rm1