Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

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

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

Super 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

example:

 


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

Michael-Bronson

Super 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"

 

.

Dear Jay - what you think about my previous answer ?

 

Michael-Bronson

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

Michael-Bronson