如何validationambari服务状态
例如,我想检查ambari HDFS服务是停止还是开始
到现在为止我使用下面的语法来检查
但是我没有得到有关停止/启动的输出,正如您从命令输出中看到的那样
我们只得到安装
ENDPOINT="http://${SERVER}:${PORT}/api/v1/clusters/${CLUSTERNAME}/services/${SERVICE}" curl --silent -u admin:admin -X GET ${ENDPOINT}?fields=ServiceInfo | grep state
命令结果:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1207 100 1207 0 0 28158 0 --:--:-- --:--:-- --:--:-- 28738 Checking HIVE { "href" : "http://master02.ipmassanalyt41.com:8080/api/v1/clusters/HDP26/services/HIVE?fields=ServiceInfo", "ServiceInfo" : { "cluster_name" : "HDP26", "credential_store_enabled" : "true", "credential_store_supported" : "true", "maintenance_state" : "OFF", "service_name" : "HIVE", "state" : "INSTALLED" }