...
The
yarn-site
configuration 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:
/var/lib/ambari-server/resources/scripts/configs.sh
- REST API
configs.sh
Code Block $ ./configs.sh set <ambari-server> <cluster-name> yarn-site <param-name> <param-value> example $ ./configs.sh set c6401.ambari.apache.org cl1 yarn-site yarn.resourcemanager.ha.enabled true
This will need to be execute for each parameter listed.
REST API
Get the existing
yarn-site
configuration version and tag.Code Block GET http://<ambari-server>/api/v1/clusters/<cluster-name>?fields=Clusters/desired_configs ... { "href" : "http://<ambari-server>/api/v1/clusters/<cluster-name>?fields=Clusters/desired_configs", "Clusters" : { "cluster_name" : "c1", "version" : "HDP-2.1", "desired_configs" : { ... "yarn-site" : { "tag" : "version1", "user" : "_anonymous", "version" : 1 }, ... } } }
Using the value from the
tag
property ofyarn-site
, request the current YARN configuration. In this example,<yarn-site-tag>
would be "version1
".Code Block GET http://<ambari-server>/api/v1/clusters/<cluster-name>/configurations?(type=yarn-site&tag=<yarn-site-tag>) ... "href" : "http://<ambari-server>/api/v1/clusters/<cluster-name>/configurations?(type=yarn-site&tag=version1)", "items" : [ { "href" : "http://<ambari-server>/api/v1/clusters/<cluster-name>/configurations?type=yarn-site&tag=version1", "tag" : "version1", "type" : "yarn-site", "version" : 1, "Config" : { "cluster_name" : "c1" }, "properties" : { "yarn.acl.enable" : "false", "yarn.admin.acl" : "", ... "yarn.timeline-service.ttl-enable" : "true", "yarn.timeline-service.ttl-ms" : "2678400000", "yarn.timeline-service.webapp.address" : "c6402.ambari.apache.org:8188", "yarn.timeline-service.webapp.https.address" : "c6402.ambari.apache.org:8190" } } ] }
The
properties
property contains the currentyarn-site
configuration. Append the new properties to this structure and then updateyarn-site
.Code Block PUT http://<ambari-server>/api/v1/clusters/<cluster-name> { "Clusters":{ "desired_config":{ "type":"yarn-site", "tag":"<new-yarn-site-tag>", "properties"::{ "yarn.acl.enable":"false", "yarn.admin.acl":"", ... "yarn.timeline-service.ttl-enable":"true", "yarn.timeline-service.ttl-ms":"2678400000", "yarn.timeline-service.webapp.address":"c6402.ambari.apache.org:8188", "yarn.timeline-service.webapp.https.address":"c6402.ambari.apache.org:8190" ... <yarn-ha-site-properties> "yarn.resourcemanager.ha.enabled": "true", "yarn.resourcemanager.ha.rm-ids": "rm1,rm2", ... } } } }
- Restart all stopped services.