简体   繁体   English

通过API进行Ambari群集+服务自动启动配置

[英]Ambari cluster + Service Auto Start Configuration by API

在此处输入图片说明 Ambari services can be configured to start automatically on system boot. 可以将Ambari服务配置为在系统启动时自动启动。 Each service can be configured to start all components, masters and workers, or selectively. 可以将每个服务配置为启动所有组件,主服务器和工作服务器,或有选择地启动。

so how to enable all services in ambari cluster to start automatically on system boot by API ? 那么如何通过API在系统启动时启用ambari群集中的所有服务以自动启动?

Remark - by default all services are disabled 备注-默认情况下,所有服务均被禁用

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

Syntax. 句法。 Following is syntax of API 以下是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"}}'

Example . 例子 To set auto-restart for app timeline server component of YARN service use curl command as follows. 要为YARN服务的app timeline server组件设置自动重启,请使用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"}}'

NOTE : You can find list of components from http://<ambarihost>:<ambari port>/api/v1/clusters/Fenton/components 注意 :您可以从http://<ambarihost>:<ambari port>/api/v1/clusters/Fenton/components

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM