How to Disable ResourceManager High Availability
Use the following instructions to disable ResourceManager High Availability. You will be deleting one ResourceManager and keeping one ResourceManager. This requires using the Ambari API to modify the cluster configuration to delete the ResourceManager and using the ZooKeeper client to update the znode permissions.
Important | |
---|---|
These steps involve using the Ambari REST API. Be sure to test and verify these steps in a test environment prior to executing against a production environment. |
In Ambari Web, stop YARN and ZooKeeper services.
On the Ambari Server host, use the Ambari API to retrieve the YARN configurations into a JSON file. For example,
yarn-site.json
./var/lib/ambari-server/resources/scripts/configs.sh get ambari.server cluster.name yarn-site yarn-site.json
where ambari.server is the hostname of your Ambari Server and cluster.name is the name of your cluster.
Modify the following priorities in the yarn-site.json file:
Property
Value
yarn.resourcemanager.ha.enabled
Change the value to false.
yarn.resourcemanager.ha.rm-ids
Delete this property.
yarn.resourcemanager.hostname.rm1
Delete this property.
yarn.resourcemanager.hostname.rm2
Delete this property.
yarn.resourcemanager.webapp.address.rm1
Delete this property.
yarn.resourcemanager.webapp.address.rm2
Delete this property.
yarn.resourcemanager.webapp.https.address.rm1
Delete this property.
yarn.resourcemanager.webapp.https.address.rm2
Delete this property.
yarn.resourcemanager.cluster-id
Delete this property.
yarn.resourcemanager.ha.automatic-failover.zk-base-path
Delete this property.
Verify the following properties in the
yarn-site.json
file are set to the ResourceManager hostname you will be keeping:Property
Value
yarn.resourcemanager.hostname
<ResourceManager hostname>
yarn.resourcemanager.admin.address
<ResourceManager hostname>
yarn.resourcemanager.webapp.address
<ResourceManager hostname>
yarn.resourcemanager.resource-tracker.address
<ResourceManager hostname>
yarn.resourcemanager.scheduler.address
<ResourceManager hostname>
yarn.resourcemanager.webapp.https.address
<ResourceManager hostname>
yarn.timeline-service.webapp.address
<ResourceManager hostname>
yarn.timeline-service.webapp.https.address
<ResourceManager hostname>
yarn.timeline-service.address
<ResourceManager hostname>
yarn.log.server.url
<ResourceManager hostname>
Search the
yarn-site.json
file and remove any references to the ResourceManager hostname that you will be removing.Search the
yarn-site.json
file and remove any properties that might still be set for ResourceManager IDs. For example, rm1 and rm2.Save the
yarn-site.json
file and set that configuration against the Ambari Server./var/lib/ambari-server/resources/scripts/configs.sh set ambari.server cluster.name yarn-site yarn-site.json
where ambari.server is the hostname of your Ambari Server and cluster.name is the name of your cluster.
Using the Ambari API, delete the ResourceManager host component for the host that you are deleting:
curl --user admin:admin -i -H "X-Requested-By: ambari" -X DELETE http://ambari.server:8080/api/v1/clusters/cluster.name/hosts/hostname/host_components/RESOURCEMANAGER
where ambari.server is the hostname of your Ambari Server and cluster.name is the name of your cluster and hostname is the hostname of the ResourceManager you are deleting.
In Ambari Web, start the ZooKeeper service. On a host that has the ZooKeeper client installed, use the ZooKeeper client to change znode permissions:
/usr/hdp/current/zookeeper-client/bin/zkCli.sh getAcl /rmstore/ZKRMStateRoot setAcl /rmstore/ZKRMStateRoot world:anyone:rwcda
In Ambari Web, restart ZooKeeper service and start YARN service.