Skip to main content
mike_bronson7
Gold ⭐️⭐️⭐️
Apr 26, 2020 2:35 PM UTC
Solved

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 ? 

jsensharma
Platinum ⭐️⭐️
Apr 27, 2020 1:05 AM UTC

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

 

.

4 replies

mike_bronson7
Gold ⭐️⭐️⭐️
Apr 26, 2020 5:14 PM UTC

example:

 


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

Translate
Michael-Bronson
jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
Apr 27, 2020 1:05 AM UTC

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

 

.

Translate
mike_bronson7
Gold ⭐️⭐️⭐️
Apr 27, 2020 3:42 AM UTC

Dear Jay - what you think about my previous answer ?

 

Translate
Michael-Bronson