Support Questions

Find answers, ask questions, and share your expertise

Migrating ambari database from one host to other

avatar

We are running our ambari database with mysql on a dedicated host. Now we need to move the DB to a different host. what are the steps that needs to be done to make this migration smooth and retain all the data in the new database on the new host.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@ARUN

1. Stop ambari server

2. Take your Ambari DB dump.

Example:

pg_dump -U ambari ambari > /tmp/ambari_bk.psql
mysqldump -u ambari ambari > /tmp/ambari_bk.mysql

.

3. Now on the other Host import the mentioned DB dump. And moke sure that the new DB host is accessible from ambari server.

4. Now edit the ambari.properties " /etc/ambari-server/conf/ambari.properties" and add the correct JDBC URL to point to the new host:

Example:

server.jdbc.url=jdbc:oracle:thin:@oracle.database.hostname:1521/ambaridb

.

5. Now try restarting ambari server.

.

View solution in original post

4 REPLIES 4

avatar

@ARUN Please refer to the below documentation for moving ambari database to the new host.

http://docs.hortonworks.com/HDPDocuments/Ambari-2.4.1.0/bk_ambari-reference/content/ch_amb_ref_movin...

avatar
Master Mentor

@ARUN

1. Stop ambari server

2. Take your Ambari DB dump.

Example:

pg_dump -U ambari ambari > /tmp/ambari_bk.psql
mysqldump -u ambari ambari > /tmp/ambari_bk.mysql

.

3. Now on the other Host import the mentioned DB dump. And moke sure that the new DB host is accessible from ambari server.

4. Now edit the ambari.properties " /etc/ambari-server/conf/ambari.properties" and add the correct JDBC URL to point to the new host:

Example:

server.jdbc.url=jdbc:oracle:thin:@oracle.database.hostname:1521/ambaridb

.

5. Now try restarting ambari server.

.

avatar

Thanks @Jay SenSharma. it really helps

avatar
Master Mentor

@ARUN

Also please check the ambari.properties and change the persistence type to remote when the DB is moved

server.persistence.type=local
to
server.persistence.type=remote 

.

You can import the mysql dump as following on the remote Mysql host:

mysql -u ambari -pbigdata ambari < ambari_mydb_current.sql

Also please refer to the following link for preparing the mysql on the new host. (before importing the dump) http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_ambari_reference_guide/content/_using_amb...

Before importing the dump you might want to create the DB users and grand desired permissions as mentioned in the above link

.