Support Questions

Find answers, ask questions, and share your expertise

Who agreed with this solution

avatar
Master Collaborator

@Christy09  Use the below API to put a node/host in maintenance mode

 

curl -u <Username>:<Password> -H 'X-Requested-By:ambari' -i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for host","query":"Hosts/host_name.in(<HOST_NAME>)"},"Body":{"Hosts":{"maintenance_state":"ON"}}}' http://<AMBARI_HOST>:8080/api/v1/clusters/<CLUSTER_NAME>/hosts

 

Example: 

curl -u admin:<PASSWORD> -H 'X-Requested-By:ambari' -i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for host","query":"Hosts/host_name.in(c486-node2.coelab.cloudera.com)"},"Body":{"Hosts":{"maintenance_state":"ON"}}}' http://c486-node1.coelab.cloudera.com:8080/api/v1/clusters/c486/hosts

 

 

View solution in original post

Who agreed with this solution