Created on 02-12-2020 04:41 AM - last edited on 02-12-2020 06:30 AM by cjervis
hi all
we have HDP version - 2.6.4
with active and standby namenode
is it possible to capture the active namenode IP by REST API?
we try by the following API , but API not return any output
curl -sH "X-Requested-By: ambari" -u admin:admin -H "X-Requested-By: ambari" -X GET http://master:8080/api/v1/clusters//services/HDFS
Created on 04-07-2021 11:43 PM - edited 04-07-2021 11:44 PM
@mike_bronson7 Use the following API to find out the node & state of the active/standby
# curl -u <User name>:<Password> -H 'X-Requested-By: ambari' -X GET 'http://test1:8080/api/v1/clusters/c186/host_components?HostRoles/componentname=NAMENODE&metrics/dfs/FSNamesystem/HAState=active'
# curl -u <User name>:<Password> -H 'X-Requested-By: ambari' -X GET 'http://test1:8080/api/v1/clusters/c186/host_components?HostRoles/componentname=NAMENODE&metrics/dfs/FSNamesystem/HAState=standby”
Created 04-07-2021 09:11 AM
You are hitting with wrong values.
Find below example:
curl -u admin:password "http://{hostname}:8080/api/v1/clusters/{cluster _name}/host_components?HostRoles/"
Created on 04-07-2021 11:43 PM - edited 04-07-2021 11:44 PM
@mike_bronson7 Use the following API to find out the node & state of the active/standby
# curl -u <User name>:<Password> -H 'X-Requested-By: ambari' -X GET 'http://test1:8080/api/v1/clusters/c186/host_components?HostRoles/componentname=NAMENODE&metrics/dfs/FSNamesystem/HAState=active'
# curl -u <User name>:<Password> -H 'X-Requested-By: ambari' -X GET 'http://test1:8080/api/v1/clusters/c186/host_components?HostRoles/componentname=NAMENODE&metrics/dfs/FSNamesystem/HAState=standby”
Created 11-12-2023 07:47 PM
fix: `componentname` should be `component_name`