ambari-cassandra-service上面推荐的方法:
1 curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop $SERVICE via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE 2 curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X DELETE http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER/services/$SERVICE
但我在用的时候有时候也会停不掉服务,会报不支持之类的。若停不掉服务,可以去ambari界面,先停掉,再删除。
最后,用下面的基本能停掉服务,并删掉:
curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://192.168.0.33:8080/api/v1/clusters/docker/services/DOCKER curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.0.33:8080/api/v1/clusters/docker/services/DOCKER
删除某台机器某一个组件:
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.0.33:8080/api/v1/clusters/hadoop/hosts/lh-3/host_components/HBASE_CLIENT