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 03-07-2016 09:44 PM
I tried this one..
curl -u admin:OpsAm-iAp1Pass -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Turn on Maintenance mode"}, "Body":{"ServiceInfo":{"maintenance state":"ON"}}}' http://viceroy10:8080/api/v1/clusters/et_cluster/hosts/serf120int.etops.tllsc.net/host_components/DA...
Result :
HTTP/1.1 200 OK User: admin Set-Cookie: AMBARISESSIONID=1acil15v0h4ve2hk9a1ac5gux;Path=/;HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/plain Content-Length: 0 Server: Jetty(8.1.17.v20150415)
I checked in ambari dashboard, nothing happend..
Created on 03-07-2016 10:17 PM - edited 08-19-2019 03:58 AM
Use the below command instead. Note that to check whether datanode was put into maintenance mode, you will need to go to the Hosts tab in Ambari, navigate to the host running datanode and look for the maintenance icon there (ie the icon won't show up under Ambari > HDFS > Datanode because its a 'slave' component)
curl -u admin:OpsAm-iAp1Pass -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode For DataNode"}, "Body":{"HostRoles":{"maintenance_state":"ON"}}}' http://viceroy10:8080/api/v1/clusters/et_cluster/hosts/serf120int.etops.tllsc.net/host_components/DA...
Created on 03-07-2016 10:17 PM - edited 08-19-2019 03:58 AM
Use the below command instead. Note that to check whether datanode was put into maintenance mode, you will need to go to the Hosts tab in Ambari, navigate to the host running datanode and look for the maintenance icon there (ie the icon won't show up under Ambari > HDFS > Datanode because its a 'slave' component)
curl -u admin:OpsAm-iAp1Pass -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode For DataNode"}, "Body":{"HostRoles":{"maintenance_state":"ON"}}}' http://viceroy10:8080/api/v1/clusters/et_cluster/hosts/serf120int.etops.tllsc.net/host_components/DA...
Created 03-08-2016 03:11 PM
@Ali Bajwa I tried same for NODEMANAGER, i am getting http 200 code. Its not getting excuted. Here is my command. Can you please tell me is there anything wrong?
curl -u admin:OpsAm-iAp1Pass -H "X-Requested-By:ambari" -i -X PUT -d '{"RequestInfo":{"context":"Stop NODEMANAGER"}, "Body":{"HostRoles":{"state":"INSTALLED"}}}' http://viceroy10:8080/api/v1/clusters/et_cluster/hosts/serf120int.etops.tllsc.net/host_components/NO...
Thank you in advance.
Created 03-09-2016 05:54 PM
You are invoking the API to stop nodemanager (not put in maintenance mode).
To put it in maintenance mode, try below:
curl -u admin:OpsAm-iAp1Pass -H "X-Requested-By:ambari"-i -X PUT -d '{"RequestInfo":{"context":"Turn On Maintenance Mode For NodeManaager"}, "Body":{"HostRoles":{"maintenance_state":"ON"}}}' http://viceroy10:8080/api/v1/clusters/et_cluster/hosts/serf120int.etops.tllsc.net/host_components/NODEMANAGER