Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (1)
avatar
Cloudera Employee

1.This option is tested in Ambari 2.2.2.0 and HDP 2.4.3.22.

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

Password:

[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

Password:

[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" : "palm02.hwx.com",

"palm03" : "palm03.hwx.com",

"palm20" : "palm20.hwx.com"

}

}

[root@palm02 ~]#

where palm is cluster name and "palm02" : "palm02.hwx.com"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

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

10.0.0.5 palm02.hwx.com

10.0.0.6 palm03.hwx.com

10.0.0.7 palm20.hwx.com

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

1,292 Views
0 Kudos