Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NN/RM failover through REST API

Solved Go to solution
Highlighted

NN/RM failover through REST API

Expert Contributor

Hi,

Is it possible to perform Namenode and Resource Manager failover through rest api in Ambari?

Any help and suggestions will be greatly appreciated.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: NN/RM failover through REST API

Super Mentor

@Sampath Kumar

Ambari does not control this part. Hence it does not have any inbuilt API to achieve the same.

.

The RMs have an option to embed the Zookeeper-based ActiveStandbyElector to decide which RM should be the Active. When the Active goes down or becomes unresponsive, another RM is automatically elected to be the Active which then takes over. ActiveStandbyElector embedded in RMs acts as a failure detector.

Similarly in case of NameNode HA, a separate ZKFC daemon is needed which is responsible for deciding when to failover.

3 REPLIES 3

Re: NN/RM failover through REST API

Super Mentor

@Sampath Kumar

Ambari does not control this part. Hence it does not have any inbuilt API to achieve the same.

.

The RMs have an option to embed the Zookeeper-based ActiveStandbyElector to decide which RM should be the Active. When the Active goes down or becomes unresponsive, another RM is automatically elected to be the Active which then takes over. ActiveStandbyElector embedded in RMs acts as a failure detector.

Similarly in case of NameNode HA, a separate ZKFC daemon is needed which is responsible for deciding when to failover.

Re: NN/RM failover through REST API

Super Mentor

@Sampath Kumar

However Ambari Provides users an option to register their own custom Actions and execute them via API calls.

For that you will need to write your own Python scripts (and inside those python screipt you can write your logic to force failover) like "yarn rmadmin -failover" and then make it run as part of your python script.

.

You can find similar info on how to register custom commands and execute them via ambari API calls in the following article:

https://community.hortonworks.com/articles/139788/running-custom-scripts-through-ambari.html

@Jay Kumar SenSharma : thanks for th ...

Expert Contributor

@Jay Kumar SenSharma : thanks for the info. This helps a lot.