Ambari集群+ API的服务自动启动配置

时间:2017-09-04 14:48:12

标签: json linux hadoop ambari

enter image description here Ambari服务可以配置为在系统启动时自动启动。每个服务都可以配置为启动所有组件,主人和工作人员,或者有选择地启动。

那么如何启用ambari集群中的所有服务以通过API自动启动系统启动?

备注 - 默认情况下禁用所有服务

1 个答案:

答案 0 :(得分:0)

您可以使用自动重启API,请参阅以下文档https://cwiki.apache.org/confluence/display/AMBARI/Recovery%3A+auto+start+components

语法。以下是API的语法

curl -u admin:<password> -H "X-Requested-By: ambari" -X PUT 'http://<ambari host>:<ambari port>/api/v1/clusters/<cluster_name>/components?ServiceComponentInfo/component_name.in(<component name>)' -d '{"ServiceComponentInfo" : {"recovery_enabled":"true"}}'

示例即可。要为app timeline server服务使用YARN命令的curl组件设置自动重新启动,如下所示。

curl -u admin:<password> -H "X-Requested-By: ambari" -X PUT 'http://localhost:8080/api/v1/clusters/HDPCL/components?ServiceComponentInfo/component_name.in(APP_TIMELINE_SERVER)' -d '{"ServiceComponentInfo" : {"recovery_enabled":"true"}}'

注意:您可以从http://<ambarihost>:<ambari port>/api/v1/clusters/Fenton/components

找到组件列表
相关问题