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]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Not applicable

Maintenance Mode supports suppressing alerts and skipping bulk operations for specific services, components and hosts in an Ambari-managed cluster.

There are many scenarios when we may want to turn on Maintenance Mode specially when we are performing hardware or software maintenance, changing configuration settings, troubleshooting, decommissioning, or removing cluster nodes. In such scenario we can place a service, component, or host object in Maintenance Mode before we start to perform necessary maintenance or troubleshooting tasks.

In maintenance mode following things happen:

1. It causes suppression of alerts, warnings and status change indicators generated for the object.

2. It exempts an object from host-level or service-level bulk operations.

Although it can be done from the ambari UI, However here in this article we will see how to manage the maintenance mode for some Services like HBase using the APIs.

Turning ON Maintenance Mode for any specific component (like: region server on host jss4).

curl -u admin:admin -H "X-Requested-By:ambari"-i -X PUT -d '{"RequestInfo":{"context":"Turn ON Maintenance Mode For RegionServer"}, "Body":{"HostRoles":{"maintenance_state":"ON"}}}' http://jss1:8080/api/v1/clusters/JoyCluster/hosts/jss4.example.com/host_components/HBASE_REGIONSERVE... 

.

Turning OFF Maintenance Mode for any specific component.

curl -u admin:admin -H "X-Requested-By:ambari"-i -X PUT -d '{"RequestInfo":{"context":"Turn OFF Maintenance Mode For RegionServer"}, "Body":{"HostRoles":{"maintenance_state":"OFF"}}}' http://jss1:8080/api/v1/clusters/JoyCluster/hosts/jss4.example.com/host_components/HBASE_REGIONSERVE... 

.

Starting a Host Component When it is in MaintenanceMode

curl -u admin:admin -i -H "X-Requested-By: ambari" -d '{ "RequestInfo":{ "context":"Start RegionServer via REST when it is in MAINTAINANCE", "operation_level":{ "level":"HOST_COMPONENT", "cluster_name":"JoyCluster", "service_name":"HBASE", "host_name":"jss4.example.com" } }, "Body":{ "ServiceInfo":{ "state":"STARTED" } } }' -X PUT  http://jss1:8080/api/v1/clusters/JoyCluster/services/HBASE

.

Stopping a Host Component When it is in MaintenanceMode

curl -u admin:admin -i -H "X-Requested-By: ambari" -d '{ "RequestInfo":{ "context":"Stopping RegionServer via REST when it is in MAINTAINANCE", "operation_level":{ "level":"HOST_COMPONENT", "cluster_name":"JoyCluster", "service_name":"HBASE", "host_name":"jss4.example.com" } }, "Body":{ "ServiceInfo":{ "state":"INSTALLED" } } }' -X PUT  http://jss1:8080/api/v1/clusters/JoyCluster/services/HBASE

.

Stopping Whole HBase Service and it's components:

curl -u admin:admin -i -H "X-Requested-By: ambari" -d '{ "RequestInfo":{ "context":"Stopping Whole HBase Service alons with host components via REST", "operation_level":{ "level":"SERVICE", "cluster_name":"JoyCluster", "service_name":"HBASE" } }, "Body":{ "ServiceInfo":{ "state":"INSTALLED" } } }' -X PUT  http://jss1:8080/api/v1/clusters/JoyCluster/services/HBASE
4,497 Views
Version history
Last update:
‎12-13-2016 03:50 AM
Updated by:
Former Member
Contributors