- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How can i recommission Node managers and Data nodes through REST API?
- Labels:
-
Apache Ambari
-
Apache Hadoop
Created ‎03-03-2016 05:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
curl -u admin:admin -i -H 'X-Requested-By: ambari' -X POST -d '{ "RequestInfo":{ "context":"Recommission DataNodes", "command":"RECOMMISSION", "parameters":{ "slave_type":"DATANODE", "included_hosts":"c6401.ambari.apache.org,c6402.ambari.apache.org,c6403.ambari.apache.org" }, "operation_level":{ "level":"HOST_COMPONENT", "cluster_name":"c1" } }, "Requests/resource_filters":[ { "service_name":"HDFS", "component_name":"NAMENODE" } ] }' http://localhost:8080/api/v1/clusters/c1/requests
curl -u admin:admin -i -H 'X-Requested-By: ambari' -X POST -d '{ "RequestInfo":{ "context":"Recommission NodeManagers", "command":"RECOMMISSION", "parameters":{ "slave_type":"NODEMANAGER", "included_hosts":"c6401.ambari.apache.org,c6402.ambari.apache.org,c6403.ambari.apache.org" }, "operation_level":{ "level":"HOST_COMPONENT", "cluster_name":"c1" } }, "Requests/resource_filters":[ { "service_name":"YARN", "component_name":"RESOURCEMANAGER" } ] }' http://localhost:8080/api/v1/clusters/c1/requests
@Artem Ervits .Can i use like this to recommission the data node and nodemanagers? Whcih one has to be excuted first? Datanodes ?
Created ‎03-03-2016 07:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are becoming an advanced user of Ambari API. Your use case is definitely valid but i dont have an answer for exact steps or whether its even possible. What you can do is setup network capture with wireshark and see api calls ambari makes when you recommission a node. My guess is that that option is not available in API as you typically comission a node as part of adding a new node. So maybe as a workaround you would want to delete a node completely from cluster after decommissioning and then just add new node. Let us know if you do run netcapture.
Created ‎03-03-2016 07:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are becoming an advanced user of Ambari API. Your use case is definitely valid but i dont have an answer for exact steps or whether its even possible. What you can do is setup network capture with wireshark and see api calls ambari makes when you recommission a node. My guess is that that option is not available in API as you typically comission a node as part of adding a new node. So maybe as a workaround you would want to delete a node completely from cluster after decommissioning and then just add new node. Let us know if you do run netcapture.
Created ‎03-03-2016 07:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Artem Ervits I would like to give a try with the above curl commands, will post the result.
Created ‎03-03-2016 07:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Surprise us 🙂
Created ‎03-03-2016 08:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Artem Ervits Mostly, it wouldn't work because i didn't see any dfs.include and yarn.include parameters in configurations. 🙂
Created ‎03-03-2016 08:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well then decommission, delete, add node is the way to go.
Created ‎03-04-2016 02:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Artem Ervits I tried to recommission by using above curl command. I got the following error..
"status" : 500, "message" : "An internal system exception occurred: Unsupported action RECOMMISSION for Service: YARN and Component: RESOURCEMANAGER"
Created ‎03-09-2016 02:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Artem Ervits I am still wondering, whatever we will do through ambari, we can do them through REST api right? Why REST api is having limitiation for RECOMMISSION? Is there any theoretical reason?
Created ‎03-09-2016 02:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Ram D I say look at the source code, https://github.com/apache/ambari/blob/966f3031d50b0106dfe5d19abbdd1e3b84d1f059/ambari-server/src/mai...
Created ‎08-17-2016 06:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to follow up on this one. You can recomission DataNodes and NodeManagers with the following calls. Replace the variables as needed. You may need to remove the line breaks.
Node Manager
curl -u admin:admin -H 'X-Requested-By:ambari' -X POST -d '{ "RequestInfo":{ "context":"Recomissioning of host '$host': Recomission NodeManger via REST-API", "operation_level":{ "level":"HOST", "cluster_name":"'$clustername'", "host_name":"'$host'" }, "command":"DECOMMISSION", "parameters":{ "slave_type":"NODEMANAGER", "included_hosts":"'$host'" } }, "Requests/resource_filters":[ { "service_name":"YARN", "component_name":"RESOURCEMANAGER" } ] }' "http://$ambariHost:8080/api/v1/clusters/$clustername/requests"
DataNode:
curl -u admin:admin -H 'X-Requested-By:ambari' -X POST -d '{ "RequestInfo":{ "context":"Scipt-based Recomissioning of host '$host': Recomission DataNode via REST-API", "operation_level":{ "level":"HOST", "cluster_name":"'$clustername'", "host_name":"'$host'" }, "command":"DECOMMISSION", "parameters":{ "slave_type":"DATANODE", "included_hosts":"'$host'" } }, "Requests/resource_filters":[ { "service_name":"HDFS", "component_name":"NAMENODE" } ] }' "http://$ambariHost:8080/api/v1/clusters/$clustername/requests"
