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]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

how to verify by ambari api the active/standby resource manager

avatar

hi all

 

 

we have two master machines 

 

master01

master02

 

Capture.PNG

 

on both machines yarn resource manager is running as active/standby )

 

how to verify which machine is with active resource manager by ambari rest api ? 

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@mike_bronson7 

If you want to get the HA Status (Active/Standby) for ResourceManager then you can make the following call:

# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "h ttp://$AMBARI_FQDN:8080/api/v1/clusters/$CLUSTER_NAME/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state.in(ACTIVE,STANDBY)"


If you just want to know that which host the ResourceManager is in Active State then:

# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "h ttp://$AMBARI_FQDN:8080/api/v1/clusters/$CLUSTER_NAME/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state=ACTIVE"

 

.

View solution in original post

4 REPLIES 4

avatar

example:

 


[root@master2 ~]# su yarn
[yarn@master2 root]$ yarn rmadmin -getServiceState rm1
standby
[yarn@master2 root]$ yarn rmadmin -getServiceState rm2
active

Michael-Bronson

avatar
Master Mentor

@mike_bronson7 

If you want to get the HA Status (Active/Standby) for ResourceManager then you can make the following call:

# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "h ttp://$AMBARI_FQDN:8080/api/v1/clusters/$CLUSTER_NAME/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state.in(ACTIVE,STANDBY)"


If you just want to know that which host the ResourceManager is in Active State then:

# curl -s -u admin:admin -H "X-Requested-By: ambari" -X GET "h ttp://$AMBARI_FQDN:8080/api/v1/clusters/$CLUSTER_NAME/host_components?HostRoles/component_name=RESOURCEMANAGER&HostRoles/ha_state=ACTIVE"

 

.

avatar

Dear Jay - what you think about my previous answer ?

 

Michael-Bronson

avatar

Dear Jay - we try this API but no any status from API, 

Michael-Bronson