Support Questions

Find answers, ask questions, and share your expertise

NN/RM failover through REST API

avatar
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

avatar
Master 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.

View solution in original post

3 REPLIES 3

avatar
Master 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.

avatar
Master 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

avatar
Expert Contributor

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