Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

yarn resource manager path for automatic failover property

avatar
Contributor

Hello,

I am not able to identify where exactly this property is set for Yarn RM failover
'ActiveStandbyElector' for automatic failover
Please provide the path and property where I can check this

Thanks
Nani

5 REPLIES 5

avatar
Contributor

I am able to check this properties in the path /usr/hdp/current/hadoop-yarn-resourcemanager/etc/Hadoop/yarn-site

<property>

<name>yarn.resourcemanager.ha.automatic-failover.zk-base-path</name>

<value>/yarn-leader-election</value>

</property>


<property>

<name>yarn.resourcemanager.ha.enabled</name>

<value>true</value>

</property>

am I looking correct path?

avatar
Master Mentor

@Nani Bigdata


Is there any specific reason that you are looking out for that particular property "ActiveStandbyElector" Path?

Is your ResourceManager HA not functioning properly?


Although you can find that path "ActiveStandbyElector" here

Example:

1). Connect to your Zookeeper Quorum using "zkCli.sh" as following:

# /usr/hdp/current/zookeeper-client/bin/zkCli.sh  -server newhwx1.example.com,newhwx2.example.com,newhwx3.example.com:2181


2). List the contents of "ls /yarn-leader-election/yarn-cluster"

[zk: newhwx1.example.com,newhwx2.example.com,newhwx3.example.com:2181(CONNECTED) 2]  ls /yarn-leader-election/yarn-cluster
[ActiveBreadCrumb, ActiveStandbyElectorLock]


3). "" Get.

[zk: newhwx1.example.com,newhwx2.example.com,newhwx3.example.com:2181(CONNECTED) 3] get /yarn-leader-election/yarn-cluster/ActiveStandbyElectorLoc

yarn-cluster rm2
cZxid = 0x9000aee67
ctime = Mon Jun 17 03:24:12 UTC 2019
mZxid = 0x9000aee67
mtime = Mon Jun 17 03:24:12 UTC 2019
pZxid = 0x9000aee67
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x26ab8da9f808066
dataLength = 19
numChildren = 0





avatar
Master Mentor

@Nani Bigdata

Does it answers your query? Or do you have any additional query in this regard?
If not then please mark this HCC thread as resolved by clicking on the "Accept" Button.

avatar
Contributor

Thank you Jay for detailed reply. I need to property 'ActiveStandbyElector' from zookeeper stand point of view , like how it selects standby Resource manager to active one's. so you say, we can get this details by connecting to zookeeper and listing the contents in yarn? thank you once again

avatar
Master Mentor

@Nani Bigdata

There are better other options as well to find out the Active/StandBy ResourceManagers.

1. Using command line as following. Please replace the "rm1" and "rm2" according to your config "yarn.resourcemanager.ha.rm-ids".

# su - yarn -c "yarn rmadmin -getServiceState rm1"
standby
[root@newhwx2 ~]# su - yarn -c "yarn rmadmin -getServiceState rm2"
active


2. Using Ambari API calls:

# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "http://<ambari-host>:<ambari-port>/api/v1/clusters/<cluster-name>/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state=ACTIVE" | grep -B1 -i "host_name"  
# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "http://<ambari-host>:<ambari-port>/api/v1/clusters/<cluster-name>/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state=STANDBY" | grep -B1 -i "host_name"  

.

.