How to repair the Zmanda Management Console (ZMC) database-for-AE

This article is for all versions of Amanda Enterprise (AE)

Issue Symptoms

In /opt/zmanda/amanda/logs/zmc_gui_errors.log you may see the following error:

MySQL error #145: Table './zmc/events' is marked as crashed and should be repaired

Or during ZMC startup you see the following:

/opt/zmanda/amanda/mysql//bin/mysqladmin.bin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/opt/zmanda/amanda/mysql/tmp/mysql.sock' (111)'

and when you check /opt/zmanda/amanda/mysql/data/mysqld.log, you find indications of crashed tables.

Resolution

To repair the ZMC database, use the following procedure. Please note:

  1. This procedure should be performed only when no backup or restore or media management operation is in progress.
  2. ZMC will not be available during this procedure.
  3. A backup of ZMC database is created before database repair is attempted. The backup tarball is stored at /opt/zmanda/amanda/logs/zmcdb-<datestamp>.tar.gz
  4. The zmc_aee service will be stopped before database repair and restarted afterward.

Run the following command as the root user:

# /opt/zmanda/amanda/bin/zmc-db-repair.sh

Check the command logs for errors. If there are errors, please contact Zmanda Support team.