|Note: The following steps are for development purposes only. Ambari 1.7.0 and above exposes the ability to enable ResourceManager High Availability directly from the web client and should be used for real-world use cases.|
- HDP 2.0+
- YARN Installed
- At least 2 hosts in the cluster where YARN is not present on 1 host. These steps assume there are 3 hosts in the cluster.
This table lists the placeholders in the various steps below.
|ambari-server||The server running the Ambari web client||c6401.ambari.apache.org:8080|
|cluster-name||The name of the cluster||cluster1|
|target-host||The host that will have the additional ResourceManager||c6403.ambari.apache.org|
|rm-host-active||The host that will run the active ResourceManager||c6402.ambari.apache.org|
|rm-host-standby||The host that will run the standby ResourceManager||c6403.ambari.apache.org|
|zk-host-1, zk-host-(n)||The ZooKeeper hosts configured on the cluster.|
|yarn-cluster-name||The YARN cluster name.||yarn_cluster|
- Stop all services except for HDFS. There are two methods that can be used to accomplish this:
- Using the Ambari web client to manually stop each service.
- Using the Ambari REST APIs directly. For this method, you can consult the documentation on starting and stopping services.
Add a ResourceManager component to YARN on a host that does not already have ResourceManager installed. This will not actually install ResourceManager, but will setup the host component associations.
Install ResourceManager on the same
target_hostused in the previous step.
yarn-siteconfiguration group (yarn-site.xml) must now be updated to reflect the backup ResourceManager.
property value yarn.resourcemanager.ha.enabled true yarn.resourcemanager.ha.rm-ids rm1,rm2 yarn.resourcemanager.hostname.rm1 <rm-host-active> yarn.resourcemanager.hostname.rm2 <rm-host-standby> yarn.resourcemanager.recovery.enabled true yarn.resourcemanager.store.class org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore yarn.resourcemanager.zk-address <zk-host-1>, <zk-host-2>, <zk-host-3> yarn.resourcemanager.cluster-id <yarn-cluster-name> yarn.resourcemanager.ha.automatic-failover.zk-base-path /yarn-leader-election
- There are two methods to update these configuration properties:
- REST API
This will need to be execute for each parameter listed.
Get the existing
yarn-siteconfiguration version and tag.
Using the value from the
yarn-site, request the current YARN configuration. In this example,
<yarn-site-tag>would be "
propertiesproperty contains the current
yarn-siteconfiguration. Append the new properties to this structure and then update
- Restart all stopped services.