If there is a place to look at the mask, take a look at the HDFs ha this article
The official scheme is as follows
Configuration target:
Node1 Node2 Node3:3 Station Zookeeper
Node1 Node2:2 sets of ResourceManager
First configure Node1, configure Etc/hadoop/yarn-site.xml:
<property> <name>yarn.resourcemanager.ha.enabled</name> <value>true</value> </ property> <property> <name>yarn.resourcemanager.cluster-id</name> <value>rmcluster< /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> <property> <name>yarn.resourceman Ager.zk-address</name> <value>node1:2181,node2:2181,node3:2181</value> </property> <
Property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property>
Configuration etc/hadoop/mapred-site.xml:
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value >yarn</value>
</property>
</configuration>
Copy the Node1 2 configuration files (SCP command) to 4 other machines
Then start the yarn:start-yarn.sh on the Node1 (at the same time start the NodeManager (on the DN machine, corresponding to each))
Or start Dfs and yarn with the start-all.sh command
Then stop ZooKeeper:zkServer.sh stop and stop the cluster: stop-dfs.sh
Start ZooKeeper:zkServer.sh Start
Start the spare yarn (node2): yarn-daemon.sh start ResourceManager
Start cluster: start-dfs.sh
Access to the Master Node Web interface: node1:8088 and node1:50070
To access an alternate node: node2:8088
Kill the Node1 ResourceManager, and then access the standby node, which takes a slower time to fully take over. Because all NM needs to be reported to RM, and there is a certain time-out period that exceeds this time to prove that the RM has been down.
If standby is displayed when accessing node1:50070, there may be a problem with ZKFC and zookeeper, and you need to check the log. ,
Workaround: Killall java, and then restart zkserver.sh start and cluster start-all.sh