2.1.2. Set Common ResourceManager HA Properties

The following properties are required for both manual and automatic ResourceManager HA. Add these properties to the etc/hadoop/conf/yarn-site.xml file:

Property Name Recommended Value Description
yarn.resourcemanager.ha.enabled true Enable RM HA
yarn.resourcemanager.ha.rm-ids   Cluster-specific, e.g., rm1,rm2   A comma-separated list of ResourceManager IDs in the cluster.  
yarn.resourcemanager.hostname.<rm-id>   Cluster-specific  The host name of the ResourceManager. Must be set for all RMs.  
yarn.resourcemanager.recovery.enabled   true Enable job recovery on RM restart or failover.  
yarn.resourcemanager.store.class   org.apache.hadoop.yarn.server. resourcemanager.recovery.ZKRMStateStore   The RMStateStore implementation to use to store the ResourceManager's internal state. The ZooKeeper- based store supports fencing implicitly, i.e., allows a single ResourceManager to make multiple changes at a time, and hence is recommended.  
yarn.resourcemanager.zk-address     Cluster- specific   The ZooKeeper quorum to use to store the ResourceManager's internal state. For multiple ZK servers, use commas to separate multiple ZK servers. 
yarn.client.failover-proxy-provider   org.apache.hadoop.yarn.client. ConfiguredRMFailoverProxyProvider   When HA is enabled, the class to be used by Clients, AMs and NMs to failover to the Active RM. It should extend   org.apache.hadoop.yarn.client.RMFailoverProxyProvider. This is an optional configuration. The default value is “org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider”

[Note]Note

You can also set values for each of the following properties in yarn-site.xml :

  • yarn.resourcemanager.address.<rm‐id>

  • yarn.resourcemanager.scheduler.address.<rm‐id>

  • yarn.resourcemanager.admin.address.<rm‐id>

  • yarn.resourcemanager.resource‐tracker.address.<rm‐id>

  • yarn.resourcemanager.webapp.address.<rm‐id>

If these addresses are not explicitly set, each of these properties will use yarn.resourcemanager.hostname.<rm-id>:default_port, such as DEFAULT_RM_PORTDEFAULT_RM_SCHEDULER_PORT, etc.

The following is a sample yarn-site.xml file with these common ResourceManager HA properties configured:

<!-- RM HA Configurations-->
                        
 <property> 
    <name>yarn.resourcemanager.ha.enabled</name> 
    <value>true</value>
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.ha.rm-ids</name> 
    <value>rm1,rm2</value> 
 </property>
 
 <property> 
    <name>yarn.resourcemanager.hostname.rm1</name> 
    <value>${rm1 address}</value> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.hostname.rm2</name> 
    <value>${rm2 address}</value> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.webapp.address.rm1</name> 
    <value>rm1_web_address:port_num</value> 
    <description>We can set rm1_web_address separately. If not, it will use 
    ${yarn.resourcemanager.hostname.rm1}:DEFAULT_RM_WEBAPP_PORT</description> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.webapp.address.rm2</name> 
    <value>rm2_web_address:port_num</value> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.recovery.enabled</name> 
    <value>true</value> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.store.class</name> 
    <value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value> 
 </property> 
 
 <property> 
    <name>yarn.resourcemanager.zk-address</name>
	<value>${zk1.address,zk2.address}</value> 
 </property>
 
 <property> 
   <name>yarn.client.failover-proxy-provider</name> 
   <value>org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider</value> 
 </property>


loading table of contents...