Community Articles
Find and share helpful community-sourced technical articles
Labels (1)
Cloudera Employee

1.This option is tested in Ambari and HDP

2.In the Ambari Background Operations dialog, stop all pending commands and jobs.

3.Stop all services.

4.Backup the Ambari database. (Default passwd for ambari : bigdata and mapred:mapred )

[root@palm02 db_dumps]# pg_dump -U ambari ambari > ambari.sql


[root@palm02 db_dumps]# ls -lrt

total 10668

-rw-r--r--. 1 root root 10920611 Oct 25 21:23 ambari.sql

[root@palm02 db_dumps]# vim ambari.sql

[root@palm02 db_dumps]# pg_dump -U mapred ambarirca > ambarirca.sql


[root@palm02 db_dumps]# ls -lrt

total 10680

-rw-r--r--. 1 root root 10920611 Oct 25 21:23 ambari.sql

-rw-r--r--. 1 root root 9189 Oct 25 21:24 ambarirca.sql

5.Stop ambari-server and ambari-agents on all hosts.

ambari-server stop
ambari-agent stop

6.Create *.json file with host names changes.

[root@palm02 ~]# cat cluster_host.json


"palm" : {

"palm02" : "",

"palm03" : "",

"palm20" : ""



[root@palm02 ~]#

where palm is cluster name and "palm02" : ""is the host names pair in the format "current_host_name" : "new_host_name".

7.Execute the following command on the ambari-server host:

[root@palm02 ~]# ambari-server update-host-names cluster_host.json

Using python /usr/bin/python

Updating host names

Please, confirm Ambari services are stopped [y/n] (n)? y

Please, confirm there are no pending commands on cluster [y/n] (n)? y

Please, confirm you have made backup of the Ambari db [y/n] (n)? y

Ambari Server 'update-host-names' completed successfully.

8.After successful end of this action, please update host names for all nodes, according to changes that you added to *.json file.

[root@palm02 ~]# cat /etc/hosts localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

9.If you changed the host name for the node on which the ambari server resides, then you must update that name for every ambari-agent.
In /etc/ambari-agent/conf/ambari-agent.ini, update the "hostname" field to the new host name for node on which the ambari-server resides.

10.Start ambari-server and ambari-agents on all hosts.

ambari-server start
ambari-agent start

11.Start all services, using Ambari Web.
For each, browse to Services > <service_name> > Service Actions, choose Start.

Note : If you have NameNode HA enabled, after starting the ZooKeeper service, you must: a.Start all ZooKeeper components. b.Execute the following command on both NameNode hosts: hdfs zkfc -formatZK -force

0 Kudos
Don't have an account?
Version history
Revision #:
1 of 1
Last update:
‎09-17-2017 03:06 PM
Updated by:
Top Kudoed Authors