Amabri:如何删除或停止指定的服务
From 1.4.3 onwards you need to add "X-Requested-By" header to all curl calls.
E.g. curl -i -uadmin:admin -H "X-Requested-By: ambari" -d '{"HostRoles": { "state": "STARTED"}}' -X PUT 'http://localhost:8080/api/v1/clusters/c1/host_components?HostRoles/stale_configs=false
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
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
相关文章
- 如何本地pycharm调试,访问内网服务,用xhsell登陆跳板机,然后在跳板机做,ip和端口映射
- 发现Vs2010中对于开发者最实用的一个服务模块(开发任务管理)!
- python内置HTTP服务 SimpleHTTPServer
- 【HarmonyOS】基于JS UI的Java服务卡片如何实现动态定时刷新
- 【HMS Core】运动健康服务如何查询应用已授权的权限列表
- 使用华为应用签名服务后,如何生成SHA-1和MD5证书指纹
- React Native如何快速集成华为AGC云数据库服务
- 如何在 Xamarin 中快速集成 Android 版认证服务 - 邮箱地址篇
- 如何在Xamarin中快速集成Android版认证服务-手机号码篇
- Now冥想:崩溃服务和性能服务助力提升应用质量
- 如何在React Native项目中集成华为远程配置服务
- 第1章 ssh命令和SSH服务详解
- 两名运营大规模DDoS服务的以色列少年被逮捕
- 浅析如何实现根据图片自动切换背景色功能:提取图片主题色方案探索 - CSS提取(filter: blur + transform: scale)、Color Thief 工具库提取、对象存储的智能多媒体服务提供图片处理功能
- 【HMS Core】华为统一扫码服务ScanKit如何获取具体条码的类型?
- 如何快速集成Android版Serverless认证服务-手机号码篇
- 论一个客服主管的自我修养: 如何提升服务
- 如何对抗勒索软件即服务?
- linux 安装配置 rsync服务
- 解决vista和win7在windows服务中交互桌面权限问题:穿透Session 0 隔离