Moving a host component from one host to another
NOTE It is not safe to move components like Journal node or Zookeeper. This method is to be used only for components like Storm, Kafka , Falcon or Flume etc.
Following steps would help in moving components from one Node to another:
Remove the component from the current node:
- Backup Ambari Database.
- Identify all the components installed in a given Node using the following URL:
http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTER_NAME/hosts/HOSTNAME/host_components/
- Stop the Service using Ambari Service UI.
- Remove the component using the following Ambari API call:
curl u username:password H "XRequestedBy: ambari" X DELETE http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTER_NAME/hosts/HOSTNAME/host_comp
For example, if Falcon is to be removed from host amabri1.novalocal,
curl u admin:admin H "XRequestedBy: ambari" X DELETE http://ambaril:8080/api/v1/clusters/HDP2242A2/hosts/hdp224a13.novalocal/host_components/
In the above example,
- ambaril is the Ambari server host
- HDP2242A2 is the Cluster name
- admin:admin Is username:password for ambari server login.
- hdp224a23.novalocal Host that has Falcon_server installed currently
- FALCON_SERVER Component name
- Use the above procedure to delete any client if required, for example Falcon client
Add components to the new node:
The component can be added to another node using one of the following two methods:
- Using Ambari Hosts Tab
- Click on the node where the component has to be installed, for eg, hdp224a23.novalocal
- Click on Add button next to Component Section
- Add the required components and complete the installation, for example FALCON_SERVER
- Using Ambari API
- Add the component to a new Node using the following API:
curl user username:password H "XRequestedBy: ambari" i X POST http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTER_NAME/hosts/NEW_HOST
- For Example, to add Falcon Server
curl user admin:admin H "XRequestedBy: ambari" i X POST http://hdp224a21.novalocal:8080/api/v1/clusters/HDP2242A2/hosts/hdp224a23.novalocal
- Above command if succeeded, would output the following messages:
HTTP/1.1 201 Created SetCookie: AMBARISESSIONID=vqaondnebav49ira01zzkz0s;Path=/ Expires: Thu, 01 Jan 1970 00:00:00 GMT ContentType: text/plain ContentLength: 0 Server: Jetty(7.6.7.v20120910)
- Go to Ambari Hosts tab and click on the node where the Component has been added using the above API
- The current status of the Component would be Install Pending
- Click on Install Pending and select Re-install to complete the installation
- Add the component to a new Node using the following API:
Once the above is completed, Start the service using Ambari Service UI.