Ambari api

Removing a Service (2.1.0)

Verified against releases 2.1.0

Note:

These API calls do not uninstall the packages associated with the

service and neither they remove the config or temp folders associated

with the service components.?

Before the PUT or DELETE calls, you can do a GET to ensure that the API is referring to a valid resource.

1.Note all the host components associated with the service.

curl -u admin:admin -H "X-Requested-By: ambari"-X GET ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICENAME

2.Ensure the service is stopped(you can use the Ambari Web-UI to stop the service as well)

Stop the whole service(ensure correct values are provided for AMBARI_SERVER_HOST, SERVICE_NAME):

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/c1/services/SERVICE_NAME

Stop individual components (ensure correct values are provided for AMBARI_SERVER_HOST, HOSTNAME, COMPONENT_NAME):?

curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}'? ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/hosts/HOSTNAME/host_components/COMPONENT_NAME

Stop all component instances (ensure correct values are provided for AMBARI_SERVER_HOST, SERVICE_NAME, COMPONENT_NAME) -just another way to stop Service members:

curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"Stop All Components"},"Body":{"ServiceComponentInfo":{"state":"INSTALLED"}}}'? ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICE_NAME/components/COMPONENT_NAME


3.Delete the whole SERVICE

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE? ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICENAME




Removing a Host (2.1.0)

Verified against releases 2.1.0

The preferred way to remove a host is to move the master services from the

host, decommission the slave nodes and then remove the hostafterdeleting

all the host components. However, there are situations such as the host

is lost and cannot be brought back online for graceful removal. Under

this circumstances the following API calls can be used to clean up the

host.?

1.Get a list of host components mapped to the host

curl -u admin:admin -H "X-Requested-By: ambari" -X GET ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/hosts/HOSTNAME

2.DELETE all host components mapped to this host

E.g.Delete DATANODE

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE? ? ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/DATANODE

3.DELETE the host

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE? ?http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 不定期更新 收錄各種奇葩問題 ambari安裝之后,啟動hive MetaStore時報錯 Solution:hi...
    Pleb_King閱讀 3,474評論 0 2
  • Spring Cloud為開發人員提供了快速構建分布式系統中一些常見模式的工具(例如配置管理,服務發現,斷路器,智...
    卡卡羅2017閱讀 134,869評論 18 139
  • 所有人都幻想得到一些東西,也不曾丟棄一些無所用的。 在城市的正中心,有一個最高的樓,叫龍匣樓。幾百層的大樓,匯聚著...
    陳汐年閱讀 451評論 2 5
  • 開放。大度。寬容。---對人。 別人說啥不講理且令人不高興的話,別往心里去,笑笑了之。沒必要記得,更沒必要往心里去...
    喬喬愛神游閱讀 150評論 0 0
  • 喜歡古典老師說的:寫簡書、微信公眾號不是為了火,而是有一個可以思考可以練筆的機會。
    許小小麗閱讀 151評論 0 1