ambari卸载服务

 

ambari卸载服务的格式及步骤 
-- 用 Rest API 查看 service状态的命令格式如下
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://AMBARI_SERVER_HOST:8080/api/v1/clusters/cluster_name/services/SERVICE_NAME

-- 用 Rest API 停掉 Service 的命令格式如下
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://AMBARI_SERVER_HOST:8080/api/v1/clusters/cluster_name/services/SERVICE_NAME

-- 用 Rest API 删除 Service 的命令格式如下
curl -u admin:admin@cpro -H "X-Requested-By: ambari" -X DELETE http://AMBARI_SERVER_HOST:8080/api/v1/clusters/cluster_name/services/SERVICE_NAME

 

卸载hbase服务
查看状态
curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://192.168.6.152:8080/api/v1/clusters/cstor_test/services/HBASE

修改状态为INSTALLED
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo": {"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://192.168.6.152:8080/api/v1/clusters/c1/services/HBASE

删除服务
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://192.168.6.152:8080/api/v1/clusters/cstor_test/services/HBASE

(服务名称HBASE大写,有的时候状态为INSTALL_FAILED,UNKNOWN状态直接删除就行)

 

参考链接:http://blog.chinaunix.net/uid-25691489-id-5549293.html

 

你可能感兴趣的:(ambari卸载服务)