Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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