Avamar: MCS does not start up after losing the mcserver.xml file
Summary: The Management Console Server (MCS) does come up after losing the mcserver.xml file as part of a rollback.
Symptoms
After a rollback, the Management Console Server (MCS) was being restored.
As a standard part of the process, the /usr/local/avamar/var/mc/server_data directory was removed.
Due to avtar using the default SSL encryption, the MCS restore failed, removing the mcserver.xml file (resulting in MCS not starting).
Evidence of rollback in the gsan logs:
mapall --noerror 'grep -hi "rolled back" /data01/cur/gsan.log*' | sort | tail -1
2019/05/17-11:41:14.65109 {P0.0} [gsan] <1287> gsan::run gsan rolled back to cp.xxxxxxxxxxxx
Output from the dpnctl.log:
less dpnctl.log
2019/05/17-11:47:48 --restore will modify your Administrator Server database and preferences.
2019/05/17-11:47:48 Do you want to proceed with the restore Y/N? [Y]: sed: can't read /usr/local/avamar/var/mc/
server_data/prefs/mcserver.xml: No such file or directory
2019/05/17-11:47:48 sed: can't read /usr/local/avamar/var/mc/server_data/prefs/mcserver.xml: No such file or directory
2019/05/17-11:47:48 Decrypting all registered passwords...
2019/05/17-11:47:48 see MCCipher log for details: /usr/local/avamar/var/mc/server_log/mccipher.log.0
2019/05/17-11:47:48 Database server stopped.
2019/05/17-11:47:48 removing data dir /usr/local/avamar/var/mc/server_data
2019/05/17-11:47:48 INFO: /usr/local/avamar/var/mc already exists
2019/05/17-11:47:48 INFO: creating /usr/local/avamar/var/mc/server_data/postgres/data with permissions 0755
.
2019/05/17-11:47:48 Please wait....
2019/05/17-11:47:48 avtar Error <18838>: SSL certificate/key not found or invalid key. '/usr/local/avamar/etc/x.x.x.x/cert.pem' '/usr/local/avamar/etc/x.x.x.x/key.pem'
.
.
2019/05/17-11:47:48 rm -f /tmp/dpnctl-mcs-restore-status-6696 /tmp/dpnctl-mcs-restore-output-6696
2019/05/17-11:47:48 dpnctl: ERROR: MCS restore did not succeed, so not restarting MCS
Manually listing the MC_BACKUPS using avtar results in an error:
avtar --backups --path=/MC_BACKUPS |more
avtar Info <5552>: Connecting to Avamar Server (xxxx)
avtar Info <5554>: Connecting to one node in each datacenter
avtar Error <18838>: SSL certificate/key not found or invalid key. '/usr/local/avamar/etc/x.x.x.x/cert.pem' '/usr/local/avamar/etc/x.x.x.x/key.pem'
avtar Info <5557>: No connections available
avtar FATAL <8604>: Fatal server connection problem, aborting initialization. Verify correct server address and login credentials.
avtar FATAL <5308>: Failed to initiate session with server
avtar Info <6149>: Error summary: 8 errors: 5308, 8604, 18838(6)
avtar Info <5314>: Command failed (8 errors, exit code 10008: cannot establish connection with server (possible network or DNS failure))Cause
Restoring MCS using the default SSL encryption fails as the SSL certificate and key did not match.
Resolution
Workaround:
1. Log in to the Avamar Utility Node as admin.
2. Go to the /home/admin directory:
cd /home/admin
3. Create a new temporary directory:
mkdir mc_restore
4. Change to the newly created directory:
cd /home/admin/mc_restore
5. List the MC_BACKUPS adding the "--encrypt=proprietary" flag, which uses a clear-text encryption. (so no encryption at all):
avtar --archives --path=/MC_BACKUPS --count=1 --encrypt=proprietary
avtar Info <19849>: Selecting 1 backups
avtar Info <7377>: Backups for /MC_BACKUPS as of 2019-05-23 11:39:43 BST
Date Time Seq Label Size Plugin Working directory Targets
---------- -------- ----- ----------------- ---------- -------- --------------------- -------------------
2019-05-15 08:45:32 10196 526254K Linux /usr/local/avamar var/mc/server_data
avtar Info <5314>: Command completed (exit code 0: success)
6. Restore the /usr/local/avamar/var/mc/server_data directory using after per step 3 in the restore procedure Avamar: MCS flush fails, or MCS does not start due to issues with the mcserver.xml file:
For example:
avtar -x --path=/MC_BACKUPS --labelnum=10196 --target=.
avtar Info <5259>: Restoring backup to directory "."
avtar Info <5262>: Restore completed
avtar Info <7925>: Restored 510.0 MB from selection(s) with 513.9 MB in 35 files, 17 directories
avtar Info <6090>: Restored 510.0 MB in 1.06 minutes: 28.26 GB/hour (1,986 files/hour)
The directory restores to /home/admin/mc_restore/var/mc/server_data/.
7. Copy the contents of /home/admin/mc_restore/var/mc/server_data/ to the empty /usr/local/avamar/var/mc/server_data directory.
8. Restore MCS using the restored label number:
mcserver.sh --restore --labelnum=10196
9. Start MCS:
mcserver.sh --start
Sample output:
Starting Administrator Server at: Thu May 23 12:09:15 BST 2019
Starting Administrator Server...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Administrator Server started.
10. Once started, perform an MCS flush (aka backup):
mcserver.sh --flush
=== BEGIN === check.mcs (preflush)
check.mcs passed
=== PASS === check.mcs PASSED OVERALL (preflush)
Flushing Administrator Server...
Administrator Server flushed.
11. Regenerate the SSL certificates per the resolution section of Avamar: Avtar is unable to connect to Avamar's GSAN service, "Fatal server connection problem, aborting initialization":
12. List the MC_BACKUPS to verify that there are no SSL certificate errors:
avtar --archives --path=/MC_BACKUPS --count=10
Sample output:
avtar Info <19849>: Selecting 1 backups
avtar Info <7377>: Backups for /MC_BACKUPS as of 2019-05-23 11:39:43 BST
Date Time Seq Label Size Plugin Working directory Targets
---------- -------- ----- ----------------- ---------- -------- --------------------- -------------------
2019-05-15 08:00:05 419 73K Linux /usr/local/avamar var/em/server_data
2019-05-14 08:00:04 418 73K Linux /usr/local/avamar var/em/server_data
2019-05-13 08:00:04 417 73K Linux /usr/local/avamar var/em/server_data
avtar Info <5314>: Command completed (exit code 0: success)Additional Information
There is another option to overcome the SSL error temporarily in listing the MC_BACKUPS is to use the --encrypt=tls flag:
avtar --backups --path=/MC_BACKUPS --encrypt=tls | head -30