Moving the Ambari Server

Moving the Ambari Server

To transfer an Ambari Server that uses the default, embedded, PostgreSQL database from one host to a new host, use the following instructions:

  1. Back up current data - from the original Ambari Server database.

  2. Update all Agents - to point to the new Ambari Server.

  3. Install the New Ambari Server - on the new host and populate databases with information from the original Server.

Note If your Ambari Server is using one of the non-default databases (such as MySQL, Oracle, or an existing PostgreSQL instance) then be sure to follow backup, restore, and stop/start procedures that match that database type.

Back up Current Data

  1. On the Ambari Server host, stop the original Ambari Server.
ambari-server stop
  1. Create a directory to hold the database backups.
cd /tmp

mkdir dbdumps/

cd dbdumps/
  1. Create the database backups.
pg_dump -U {ambari.db.username} -f ambari.sql

Password: {ambari.db.password}

where the following:
Variable Description Default
ambari.db.username The database username. ambari
ambari.db.password The database password. bigdata

4.Create a backup of the Ambari Server meta info.

ambari-server backup

Update all Agents

  1. On each agent host, stop the agent.
ambari-agent stop
  1. Remove old agent certificates (if any exist).
rm /var/lib/ambari-agent/keys/*
  1. Using a text editor, edit /etc/ambari-agent/conf/ambari-agent.ini to point to the new host.




Install the New Ambari Server

  1. Install the new Ambari Server on the new host.
yum install ambari-server
  1. Run setup the Ambari Server and setup similar to how the original Ambari Server is configured.
ambari-server setup
  1. Restart the PostgreSQL instance.
service postgresql restart
  1. Open the PostgreSQL interactive terminal.
su - postgres

  1. Using the interactive terminal, drop the “ambari” database created by the new ambari setup and install.
drop database ambari;
  1. Check to make sure the databases have been dropped. The “ambari” databases should not be listed.
  1. Create new “ambari” database to hold the transferred data.
create database ambari;
  1. Exit the PostgreSQL interactive terminal.
  1. Copy the saved data (/tmp/dbdumps/ambari.sql) from Back up Current Data to the new Ambari Server host.

  2. Load the saved data into the new database.

psql -d ambari -f /tmp/dbdumps/ambari.sql
  1. Start the new Server.
ambari-server start
  1. On each Agent host, start the Ambari Agent.
ambari-agent start
  1. Open Ambari Web. Point your browser to:

The new Ambari Server is ready to use.


ambari-agent.log WARNING or ERROR

WARNING 2016-12-14 16:17:57,842 - Failed to connect to https://ambari-test-3:8440/ca due to [Errno -2] Name or service not known
WARNING 2016-12-14 16:17:57,842 - Server at https://ambari-test-3:8440 is not reachable, sleeping for 10 seconds...

Command line execute

ambari-agent stop

ambari-agent reset ambari-test-3

ambari-agent start

Check /etc/hosts file hostname mapping

原创文章,转载请注明: 转载自Itweet的博客