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:

  1. Backup Ambari Database.
  2. 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/
  3. Stop the Service using Ambari Service UI.
  4. Remove the component using the following Ambari API call:
    curl ­u username:password ­H "X­Requested­By: 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 amabri­1.novalocal,

    curl ­u admin:admin ­H "X­Requested­By: ambari" ­X DELETE http://ambaril:8080/api/v1/clusters/HDP2242A2/hosts/hdp224­a1­3.novalocal/host_components/

    In the above example,

    1. ambaril ­ is the Ambari server host
    2. HDP2242A2 ­ is the Cluster name
    3. admin:admin ­ Is username:password for ambari server login.
    4. hdp224­a2­3.novalocal ­ Host that has Falcon_server installed currently
    5. FALCON_SERVER ­ Component name
  5. 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:

  1. Using Ambari Hosts Tab
    1. Click on the node where the component has to be installed, for eg, hdp224­a2­3.novalocal
    2. Click on Add button next to Component Section
    3. Add the required components and complete the installation, for example FALCON_SERVER
  2. Using Ambari API
    1. Add the component to a new Node using the following API:
      curl ­­user username:password ­H "X­Requested­By: ambari" ­i ­X POST http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTER_NAME/hosts/NEW_HOST
    2. For Example, to add Falcon Server
      curl ­­user admin:admin ­H "X­Requested­By: ambari" ­i ­X POST http://hdp224­a2­1.novalocal:8080/api/v1/clusters/HDP2242A2/hosts/hdp224­a2­3.novalocal
    3. Above command if succeeded, would output the following messages:
      HTTP/1.1 201 Created
      Set­Cookie: AMBARISESSIONID=vqaondnebav49ira01zzkz0s;Path=/ Expires: Thu, 01 Jan 1970 00:00:00 GMT
      Content­Type: text/plain
      Content­Length: 0
      Server: Jetty(7.6.7.v20120910)
      
    4. Go to Ambari Hosts tab and click on the node where the Component has been added using the above API
    5. The current status of the Component would be Install Pending
    6. Click on Install Pending and select Re-­install to complete the installation

Once the above is completed, Start the service using Ambari Service UI.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *