How to Backup and Restore Ambari Settings & Database
search cancel

How to Backup and Restore Ambari Settings & Database

book

Article ID: 294766

calendar_today

Updated On:

Products

Services Suite

Issue/Introduction

This article will describe how to backup and restore Ambari service-related settings & databases which might be necessary for the service restore.

Environment


Cause

Current Ambari does not have any HA (High Availability) features, so it is important to backup the Ambari configuration in the following cases:

  1. Moving Ambari-Server to a different node.
  2. Ambari Server Upgrade.
  3. Operating System patching/upgrade.

IMPORTANT NOTE: This procedure will only backup the Ambari server configuration settings. Ambari also has a backend database that should be backed up using the database vendors recommended settings.

Resolution

How to backup Ambari settings

1. Run the command to backup the Ambari server configuration settings:

# ambari-server backup
Using python /usr/bin/python
Backing up Ambari File System state... *this will not backup the server database*
Backup requested.
No path specified. Will use /var/lib/ambari-server/Ambari_State_Backup.zip
Backup process initiated.
Creating zip file...
Zip file created at /var/lib/ambari-server/Ambari_State_Backup.zip
Backup complete.
Ambari Server 'backup' completed successfully.
2. Copy the file /var/lib/ambari-server/Ambari_State_Backup.zip to a safe location.

How to restore Ambari settings

1. Stop the Ambari server:

# ambari-server stop
Using python /usr/bin/python
Stopping ambari-server
Ambari Server is not running

 

2. Restore the Ambari configuration settings:

# ambari-server restore ambari-server-backup/backup.zip 
Using python /usr/bin/python
Restoring Ambari File System state
Restore requested.
Restore process initiated.
Extracting the archive ambari-server-backup/backup.zip
Restore complete.
Ambari Server 'restore' completed successfully.

3. Restart the Ambari server:

# ambari-server start