how to disable service auto start by API as the following

REST API disable / enable service auto start by API 随笔 第1张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

how to enable service auto start by API as the following

REST API disable / enable service auto start by API 随笔 第2张

@Michael Bronson

Do you mean something similar to the one which is mentioned here:

https://community.hortonworks.com/questions/136769/auto-start-services-from-disable-to-enable.html

     1  隐藏 3 · 分享 REST API disable / enable service auto start by API 随笔 第3张 Michael Bronson  · 2018年03月12日 05:47 0  

the api from from this link answer about to enable all services , but what we need is only to enable / disable the auto start services , as described in the pictures ( like click on button to disable (pic1) ,and click on the button to enable (pic2) )

REST API disable / enable service auto start by API 随笔 第4张 Jay Kumar SenSharma ♦    Michael Bronson · 2018年03月12日 05:59 0  

@Michael Bronson

Through API call it will be bit complex because ambari client needs to send a very huge Payload to make that change.

However the easiest option will be to use the following approach from ambari server host:

To Enable Auto start Services

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=TestCluster --config-type=cluster-env -k "recovery_enabled" -v "true"

To Disable Auto start Services

# /var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin --port=8080 --action=set --host=localhost --cluster=TestCluster --config-type=cluster-env -k "recovery_enabled" -v "false"

Please change the Cluster name "TestCluster" and ambari credentials in the above script .

Above script needs to be executed from ambari server host as it has the "config.py" file.

REST API disable / enable service auto start by API 随笔 第5张 Michael Bronson  · 2018年03月12日 06:06 0  

@Jay thank you so much , regrading the cluster size ( https://community.hortonworks.com/questions/177371/cant-start-ambari-collector.html ) , dose cluster size mean - Number of workers machines ?

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄