<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How can i recommission Node managers and Data nodes through REST API? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109364#M21804</link>
    <description>&lt;P&gt;Well then decommission, delete, add node is the way to go. &lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2016 04:20:08 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2016-03-04T04:20:08Z</dc:date>
    <item>
      <title>How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109359#M21799</link>
      <description>&lt;PRE&gt;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"
}
]
}' &lt;A href="http://localhost:8080/api/v1/clusters/c1/requests" target="_blank"&gt;http://localhost:8080/api/v1/clusters/c1/requests&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE&gt;
&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;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"
}
]
}' &lt;A href="http://localhost:8080/api/v1/clusters/c1/requests" target="_blank"&gt;http://localhost:8080/api/v1/clusters/c1/requests&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;@Artem Ervits .Can i use like this to recommission the data node and nodemanagers? Whcih one has to be excuted first? Datanodes ?&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;
&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 01:31:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109359#M21799</guid>
      <dc:creator>prasad4u_com</dc:creator>
      <dc:date>2016-03-04T01:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109360#M21800</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 03:20:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109360#M21800</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-04T03:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109361#M21801</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; I would like to give a try with the above curl commands, will post the result.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 03:33:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109361#M21801</guid>
      <dc:creator>prasad4u_com</dc:creator>
      <dc:date>2016-03-04T03:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109362#M21802</link>
      <description>&lt;P&gt;Surprise us &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 03:48:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109362#M21802</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-04T03:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109363#M21803</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; Mostly, it wouldn't work because i didn't see any dfs.include and yarn.include parameters in configurations. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 04:04:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109363#M21803</guid>
      <dc:creator>prasad4u_com</dc:creator>
      <dc:date>2016-03-04T04:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109364#M21804</link>
      <description>&lt;P&gt;Well then decommission, delete, add node is the way to go. &lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 04:20:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109364#M21804</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-04T04:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109365#M21805</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; I tried to recommission by using above curl command. I got the following error.. &lt;/P&gt;&lt;P&gt;"status" : 500,
  "message" : "An internal system exception occurred: Unsupported action RECOMMISSION for Service: YARN and Component: RESOURCEMANAGER"&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:29:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109365#M21805</guid>
      <dc:creator>prasad4u_com</dc:creator>
      <dc:date>2016-03-04T22:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109366#M21806</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/393/aervits.html" nodeid="393"&gt;@Artem Ervits&lt;/A&gt; 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?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 22:11:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109366#M21806</guid>
      <dc:creator>prasad4u_com</dc:creator>
      <dc:date>2016-03-09T22:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109367#M21807</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1966/prasad4ucom.html" nodeid="1966"&gt;@Ram D&lt;/A&gt; I say look at the source code, &lt;A href="https://github.com/apache/ambari/blob/966f3031d50b0106dfe5d19abbdd1e3b84d1f059/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java" target="_blank"&gt;https://github.com/apache/ambari/blob/966f3031d50b0106dfe5d19abbdd1e3b84d1f059/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2016 22:13:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109367#M21807</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-03-09T22:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109368#M21808</link>
      <description>&lt;P&gt;
	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.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Node Manager&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;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"
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;DataNode:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;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"
&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2016 01:42:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109368#M21808</guid>
      <dc:creator>benhadoop</dc:creator>
      <dc:date>2016-08-18T01:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109369#M21809</link>
      <description>&lt;P&gt;Thank you very much &lt;A rel="user" href="https://community.cloudera.com/users/10171/benjaminruland.html" nodeid="10171"&gt;@Roland Simonis
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I had the same problem (reinstalled a slave from scratch, and decommisioned via Ambari both DN and NM) but Ambari doesn't have a GUI option for recommissioning the NM, so the ResourceManager was always denying access. With the API call you posted I easily recommissioned the NM and now everything is working again as expected.&lt;/P&gt;&lt;P&gt;Thanks!
&lt;A rel="user" href="https://community.cloudera.com/users/10171/benjaminruland.html" nodeid="10171"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 19:16:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109369#M21809</guid>
      <dc:creator>davide1</dc:creator>
      <dc:date>2017-03-08T19:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can i recommission Node managers and Data nodes through REST API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109370#M21810</link>
      <description>&lt;P&gt;In ambari version AMBARI-2.5.1.7 we needed to do another step after recommissioning steps above mentioned.  The nodemanger was going to stopped state after the recommissioning call.  Needed to change the state from installed to started.&lt;/P&gt;&lt;PRE&gt;curl -u user:pass -i -H 'X-Requested-By: ambari' -X PUT -d '{"HostRoles": {"state": "STARTED"}}' &lt;A href="http://{$ambari_master_host}:{$ambari_master_port}/api/v1/clusters/{$clustername}hosts/{$host}/host_components/NODEMANAGER" target="_blank"&gt;http://{$ambari_master_host}:{$ambari_master_port}/api/v1/clusters/{$clustername}hosts/{$host}/host_components/NODEMANAGER&lt;/A&gt;;&lt;/PRE&gt;&lt;P&gt;Same steps are followed by the ambari server when doing the recommission. PFA the logs &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// Recomission ( Decommission with include host )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;14 Feb 2018 13:28:23,479  INFO [ambari-client-thread-75749] AmbariManagementControllerImpl:3984 - Received action execution request, clusterName=xxxx , request=isCommand :true, action :null, command :DECOMMISSION, inputs :{included_hosts=&lt;/STRONG&gt;xxxx, slave_type=NODEMANAGER}, resourceFilters: [RequestResourceFilter{serviceName='YARN', componentName='RESOURCEMANAGER', hostNames=[]}], exclusive: false, clusterName :xxxx&lt;/P&gt;&lt;P&gt; 14 Feb 2018 13:28:23,488  INFO [ambari-client-thread-75749] AmbariCustomCommandExecutionHelper:967 - Recommissioning NODEMANAGER and marking Maintenance=OFF on xxx&lt;/P&gt;&lt;P&gt; 14 Feb 2018 13:28:32,906  INFO [qtp-ambari-agent-75726] HeartBeatHandler:332 - HeartBeatHandler.sendCommands: sending ExecutionCommand for host xxx  role RESOURCEMANAGER, roleCommand CUSTOM_COMMAND, and command ID 25366-0, task ID 45097&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// Ambari changes state from Started to Installed &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;14 Feb 2018 13:28:44,295  INFO [ambari-heartbeat-processor-0] HeartbeatProcessor:609 -&lt;STRONG&gt; State of service component NODEMANAGER of service YARN of cluster xxx has changed from STARTED to INSTALLED &lt;/STRONG&gt;at host xxxx  according to STATUS_COMMAND report&lt;/P&gt;&lt;P&gt; 14 Feb 2018 13:30:29,889  INFO [ambari-client-thread-75692] AbstractResourceProvider:939 - Received a updateHostComponent request, clusterName=xxx , serviceName=YARN, componentName=NODEMANAGER, hostname=xxxxx request={ clusterName=xxxx , serviceName=YARN, componentName=NODEMANAGER, hostname= xxxx , publicHostname=null, desiredState=STARTED, state=null, desiredStackId=null, staleConfig=null, adminState=null, maintenanceState=null}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// Ambari changes state again from Started to Installed&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;14 Feb 2018 13:30:29,890  INFO [ambari-client-thread-75692] AbstractResourceProvider:650 - Handling update to host component, clusterName=xxx, serviceName=YARN, componentName=NODEMANAGER, hostname=xxxxx , currentState=INSTALLED, newDesiredState=STARTED &lt;/P&gt;&lt;P&gt;14 Feb 2018 13:30:29,910  INFO [ambari-action-scheduler] ServiceComponentHostImpl:1028 - &lt;STRONG&gt;Host role transitioned to a new state, serviceComponentName=NODEMANAGER, hostName=xxxx  oldState=INSTALLED, currentState=STARTING&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 22:41:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-can-i-recommission-Node-managers-and-Data-nodes-through/m-p/109370#M21810</guid>
      <dc:creator>karankumar1100</dc:creator>
      <dc:date>2018-02-14T22:41:27Z</dc:date>
    </item>
  </channel>
</rss>

