Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-14-2019 07:05 AM
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.
Created 02-14-2019 10:22 AM
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.
Created 02-14-2019 10:22 AM
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.
Created 02-14-2019 10:26 AM
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
Created 02-16-2019 08:57 PM
@Jay Kumar SenSharma : thanks for the info. This helps a lot.