如何刪除ambari中的服務
阿新 • • 發佈:2018-12-26
1,先手工在web介面上停止相關服務,然後通過curl來後臺停止服務
2,刪除相關服務
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://10.134.46.139:8080/api/v1/clusters/ha/services/GANGLIA
3,查詢相關服務的狀態
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://10.134.46.139:8080/api/v1/clusters/ha/services/GANGLIA
{
"status" : 404,
"message" : "The requested resource doesn't exist: Service not found, clusterName=ha, serviceName=GANGLIA"
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo": {"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://10.134.46.139:8080/api/v1/clusters/ha/services/GANGLIA
其中ha是叢集的名稱
GANGLIA是服務的名稱
2,刪除相關服務
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://10.134.46.139:8080/api/v1/clusters/ha/services/GANGLIA
3,查詢相關服務的狀態
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://10.134.46.139:8080/api/v1/clusters/ha/services/GANGLIA
{
"status" : 404,
"message" : "The requested resource doesn't exist: Service not found, clusterName=ha, serviceName=GANGLIA"