1. Stop AMS Service
2. Execute the following API call to Delete Metric Collector. (Replace server-host, cluster-name and host-name with the Metrics Collector host)
| curl -u admin:admin -H "X-Requested-By:ambari" -i -X DELETE http://<server-host>:8080/api/v1/clusters/<cluster-name>/hosts/<host-name>/host_components/METRICS_COLLECTOR |
3. Execute the following API call to add Metrics collector to a new host. (Replace, server-host, cluster-name, host-name)
| curl -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://<server-host>:8080/api/v1/clusters/<cluster-name>/hosts/<host-name>/host_components/METRICS_COLLECTOR |
4. Install the Metrics Collector component from the Host page of the new host.
5. If the AMS is in embedded mode, copy the AMS data from old node to new node.
6. Start the Metrics Service.
7. The service daemons will be pointing to the old metrics collector host. Perform a rolling restart of slave components and a normal restart of Master components for them to pick up the new collector host.
Note : Restart of services is not needed post Ambari-2.5.0 since live collector information is maintained in the cluster zookeeper.
