Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 04-06-2019 07:37 PM
as all know we can set any service from ambari GUI to maintenance mode
so
is it possible to set any ambari service to maintenance mode by API command ?
Created 04-06-2019 07:54 PM
@Michael Bronson
Example Putting a Service (Spark2) in Maintenance Mode using API call:
Turning ON maintenance Mode for Spark2 Service
# curl -sH "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for Spark2"},"Body":{"ServiceInfo":{"maintenance_state":"ON"}}}' http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/services/SPARK2
Turning OFF maintenance Mode for Spark2 Service
# curl -sH "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Turn Off Maintenance Mode for Spark2"},"Body":{"ServiceInfo":{"maintenance_state":"OFF"}}}' http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/services/SPARK2Please change the cluster name "NewCluster" and ambari hostname + credentials according to yoiur env.
.
Created 04-06-2019 07:54 PM
@Michael Bronson
Example Putting a Service (Spark2) in Maintenance Mode using API call:
Turning ON maintenance Mode for Spark2 Service
# curl -sH "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode for Spark2"},"Body":{"ServiceInfo":{"maintenance_state":"ON"}}}' http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/services/SPARK2
Turning OFF maintenance Mode for Spark2 Service
# curl -sH "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Turn Off Maintenance Mode for Spark2"},"Body":{"ServiceInfo":{"maintenance_state":"OFF"}}}' http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/services/SPARK2Please change the cluster name "NewCluster" and ambari hostname + credentials according to yoiur env.
.
Created on 04-06-2019 08:06 PM - edited 08-17-2019 04:07 PM
@Jay , when we rrun this API we seen that also spark history became with maintenance mode
is it possible to set maintenance mode only to the thrift server and not to spark history ?
Created 04-06-2019 08:10 PM
Yes, it can be done something as described in:
https://community.hortonworks.com/questions/244121/api-how-to-set-both-thrift-server-in-ambari-to-ma...
Created 05-13-2019 09:46 PM
Hi can you put datanode in maintenance through bash command or direct python command? I have ginormous and i want to quickly stop and start services. I am using hadoop-daemon.sh start to to start a datanode. I know maintenence mode is not from hadoop API that is built as part of Ambari.