Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

Accepted Solutions

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

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
Highlighted

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

example:

 


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

Michael-Bronson

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

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

Highlighted

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

Dear Jay - what you think about my previous answer ?

 

Michael-Bronson
Highlighted

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

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

Michael-Bronson
Don't have an account?
Coming from Hortonworks? Activate your account here