GPFS config backup
Part of creating a backup plan for GPFS should include the backup of the GPFS cluster configuration. This data can help you rebuild after a complete failure of the cluster. It is also critical if you are using disk based replication for GPFS data.
Often when you are using disk based replication you have a second idle cluster ready to take over when the production cluster fails. In this configuration, after a fail-over event the disk is mounted on the backup cluster then the file systems are imported into GPFS. To be able to import the file system you need the latest version of the file system configuration. To ensure you always have the latest version it is best to automate the collection of that data.
One way to automate this collection of GPFS configuration data is to use a User Exit. This is an example using the mmsdrbackup user exit to backup the GPFS cluster and file system configuration.
- Create a script called /var/mmfs/etc/mmsdrbackup on your cluster
configuration manager node that contains something similar to
#!/bin/ksh
# Be safe:
BACKUPDIR=`mktemp -d /tmp/mmsdrbackup.XXXXXXXXXX` || exit 1
cd $BACKUPDIR
# Get a list of the file systems
# and backup the configuration for each one
time=`date +"%s"`
for i in `mmlsconfig | grep "^/dev" | sed 's/\/dev\///' `
do
echo Backing up configuration for $i
mmbackupconfig $i -o fsbackup_${time}_${i}.txt
done
# Copy the file to a server outside the cluster
scp fsbackup* backup_machine:/backup/gpfs/
# If CCR is enabled, and we're running v4.2 or greater, backup CCR database:
mmccr backup -A ${BACKUPDIR}/ccr-backup-${time}
scp ${BACKUPDIR}/ccr-backup-${time}.tar backup_machine:/backup/gpfs/
# otherwise backup the mmsdrfs file:
# scp /var/mmfs/gen/mmsdrfs backup_machine:/backup/gpfs/mmsdrfs.${time}
- Make sure it is executable
chmod +x /var/mmfs/etc/mmsdrbackup
- You can test the script directly
# /var/mmfs/etc/mmsdrbackup
Backing up configuraiton for gpfs1
mmbackupconfig: Processing file system gpfs1 ...
mmbackupconfig: Command successfully completed
Backing up configuraiton for gpfs2
mmbackupconfig: Processing file system gpfs2 ...
mmbackupconfig: Command successfully completed
Backing up configuraiton for gpfs3
mmbackupconfig: Processing file system gpfs3 ...
mmbackupconfig: Command successfully completed
CCR archive stored under: '/tmp/mmsdrbackup.vKhzW5ZcQB/ccr-backup-1448286548.tar'
- Now test that it fires on each configuration change by running a configuration change, for example
mmchconfig autoload=yes
This change should trigger the file to be created. You should manually run this script to start so you start with a backup of the configuration in case it doesn’t change before a failure.
FIXME:
- Mention “mmcesdr backup -v” for protocol backups
- Maybe mmsdrbackup on every config change is too much. Afraid it might be annoying during ESS-upgrades…?
- Cover ReaR on ESS nodes?