Support Questions
Find answers, ask questions, and share your expertise

Identify active YARN RM

Is it possible to identify active YARN ResourceManager using ZooKeeper or any other method?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Identify active YARN RM

@Nikita Kiselev,

You can also get it using Ambari REST API

http://<ambari-host>:<ambari-port>/api/v1/clusters/<cluster-name>/host_components?HostRoles/componen...

To get STANDBY RM , you can replace ha_state with STANDBY in the above URL

Thanks,

Aditya

View solution in original post

5 REPLIES 5

Re: Identify active YARN RM

Hi @Nikita Kiselev,

You can get the active Yarn RM Id from zookeeer.

cd /usr/hdp/current/zookeeper-client/bin
./zkCli.sh -server <zk-quorum>
[zk: localhost:2181(CONNECTED) 14]: get /yarn-leader-election/<cluster-id>/ActiveStandbyElectorLock

Thanks,

Aditya

Re: Identify active YARN RM

Thanks! Which keytab I should use to get access to this Zookepper Node (kerberized cluster)? Is it possible to use ZooKeeper Java API to get same info?

Re: Identify active YARN RM

You can use the yarn keytab to access this . (/etc/security/keytabs/yarn.headless.keytab).

Yes, can you access this using ZK Java API as well. Check the ZK Java example here.

Also, were you able to get it using the Ambari REST API as mentioned in my another answer.

Thanks,

Aditya

Re: Identify active YARN RM

@Nikita Kiselev,

You can also get it using Ambari REST API

http://<ambari-host>:<ambari-port>/api/v1/clusters/<cluster-name>/host_components?HostRoles/componen...

To get STANDBY RM , you can replace ha_state with STANDBY in the above URL

Thanks,

Aditya

View solution in original post

Re: Identify active YARN RM

Guru

@Nikita Kiselev, you can also use yarn cli to figure out active/stand by RM.

You can find out RM-Ids from yarn-site.xml. Look for yarn.resourcemanager.ha.rm-ids properties.

<property>
<name> yarn.resourcemanager.ha.rm-ids</name>
<value> rm1, rm2</value>
</property>

Run "yarn rmadmin -getServiceState rm1" to find out state of RM1. It will return active if RM1 is an active RM or else it will return standby. You can run same command to know rm2 status too. ( yarn rmadmin -getServiceState rm2).