Created 08-20-2017 07:58 AM
we have Ambari cluster version 2.5
how to verify by API all services that are stop ( not started )
Created 08-20-2017 08:17 AM
To list all the service status
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -A 1 'service_name'
.
If you want to see only the services that are stopped (means in INSTALLED state) then you can try the following command:
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -B 1 'INSTALLED'
.
Example Output:
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -B 1 'INSTALLED' "service_name" : "AMBARI_INFRA", "state" : "INSTALLED" -- "service_name" : "AMBARI_METRICS", "state" : "INSTALLED" -- "service_name" : "ATLAS", "state" : "INSTALLED" -- "service_name" : "FALCON", "state" : "INSTALLED" -- "service_name" : "HBASE", "state" : "INSTALLED" -- "service_name" : "HDFS", "state" : "INSTALLED" -- "service_name" : "KAFKA", "state" : "INSTALLED" -- "service_name" : "KNOX", "state" : "INSTALLED" -- "service_name" : "LOGSEARCH", "state" : "INSTALLED" -- "service_name" : "PIG", "state" : "INSTALLED" -- "service_name" : "SLIDER", "state" : "INSTALLED" -- "service_name" : "SMARTSENSE", "state" : "INSTALLED" -- "service_name" : "SQOOP", "state" : "INSTALLED" -- "service_name" : "STORM", "state" : "INSTALLED" -- "service_name" : "TEZ", "state" : "INSTALLED" -- "service_name" : "ZOOKEEPER", "state" : "INSTALLED"
.
Here please replace the following:
1. "localhost" : with the Ambari FQDN
2. 8080 : with ambari port.
3. Sandbox : With cluster Name.
.
Reference: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=41812517
Created 08-20-2017 08:17 AM
To list all the service status
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -A 1 'service_name'
.
If you want to see only the services that are stopped (means in INSTALLED state) then you can try the following command:
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -B 1 'INSTALLED'
.
Example Output:
# curl -i --user admin:admin -i -H 'X-Requested-By: ambari' -X GET http://localhost:8080/api/v1/clusters/Sandbox/services?fields=ServiceInfo/state | grep -B 1 'INSTALLED' "service_name" : "AMBARI_INFRA", "state" : "INSTALLED" -- "service_name" : "AMBARI_METRICS", "state" : "INSTALLED" -- "service_name" : "ATLAS", "state" : "INSTALLED" -- "service_name" : "FALCON", "state" : "INSTALLED" -- "service_name" : "HBASE", "state" : "INSTALLED" -- "service_name" : "HDFS", "state" : "INSTALLED" -- "service_name" : "KAFKA", "state" : "INSTALLED" -- "service_name" : "KNOX", "state" : "INSTALLED" -- "service_name" : "LOGSEARCH", "state" : "INSTALLED" -- "service_name" : "PIG", "state" : "INSTALLED" -- "service_name" : "SLIDER", "state" : "INSTALLED" -- "service_name" : "SMARTSENSE", "state" : "INSTALLED" -- "service_name" : "SQOOP", "state" : "INSTALLED" -- "service_name" : "STORM", "state" : "INSTALLED" -- "service_name" : "TEZ", "state" : "INSTALLED" -- "service_name" : "ZOOKEEPER", "state" : "INSTALLED"
.
Here please replace the following:
1. "localhost" : with the Ambari FQDN
2. 8080 : with ambari port.
3. Sandbox : With cluster Name.
.
Reference: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=41812517
Created 08-20-2017 08:42 AM
@Jay SenSharma did you saw my previos question ? (https://community.hortonworks.com/questions/127804/ambari-vlaue-from-ambari-gui-is-diff-from-the-conf.html)
Created 08-20-2017 09:44 AM
@uri ben-ari Just updated the other thread.