Created on 01-29-2018 06:52 AM - edited 08-17-2019 09:47 PM
why API not capture the real status of component
for example by this API ( example down ) we capture the status of APP_TIMELINE_SERVER
component and its show the component started ( "state":"STARTED", )
but in fact the real status from ambari is STOP
curl -u $USER:$PASSWORD -H "X-Requested-By: ambari" -X GET http://localhost:8080/api/v1/clusters/HDP/components/APP_TIMELINE_SERVER { "href" : "http://localhost:8080/api/v1/clusters/HDP/components/APP_TIMELINE_SERVER", "ServiceComponentInfo" : { "category" : "MASTER", "cluster_name" : "HDP", "component_name" : "APP_TIMELINE_SERVER", "display_name" : "App Timeline Server", "init_count" : 0, "install_failed_count" : 0, "installed_count" : 1, "recovery_enabled" : "true", "service_name" : "YARN", "started_count" : 0, "state" : "STARTED", "total_count" : 1, "unknown_count" : 0 }, "host_components" : [ { "href" : "http://localhost:8080/api/v1/clusters/HDP/hosts/master01.sys67.com/host_components/APP_TIMELINE_SERVER", "HostRoles" : { "cluster_name" : "HDP", "component_name" : "APP_TIMELINE_SERVER", "host_name" : "master01.sys67.com" } } ]
so how it can be?
why API show different the Ambari GUI?
or maybe what is wrong with my API syntax ?
Created 01-29-2018 08:42 AM
I'm not sure why the above API is returning different status. It may be a bug. You can use this API to get the correct status
curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X GET http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/hosts/{host-name}/host_components/A...
Replace the place holders. {host-name} should be replaced with the hostname of the APP TIMELINE SERVER.
Thanks,
Aditya
Created 01-29-2018 08:42 AM
I'm not sure why the above API is returning different status. It may be a bug. You can use this API to get the correct status
curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X GET http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/hosts/{host-name}/host_components/A...
Replace the place holders. {host-name} should be replaced with the hostname of the APP TIMELINE SERVER.
Thanks,
Aditya
Created 01-29-2018 09:14 AM
what need to put in - {host-name} , ( we already set the hostname in ambari-host )
Created 01-29-2018 09:33 AM
Replace {host-name} with the host name where App timeline server is installed. From your output in the question looks like App time line server is installed on "master01.sys67.com". So you can try this url
curl -u $USER:$PASSWORD -X GET -H "X-Requested-By: ambari" http://localhost:8080/api/v1/clusters/HDP/hosts/master01.sys67.com/host_components/APP_TIMELINE_SERV...
Thanks,
Aditya