IBM Support

How to backup and restore database in HA enabled cluster.

Question & Answer


Question

This article described how to backup and restore database in HA enabled cluster.

Answer

A> how to backup the database
1>locate the "Cluster management service node", in this example, it is "ma"
# pcmhatool status
Primary management node name: ma [ok]
Secondary management node name: fo [ok]
Failover mode: Automatic
Cluster management services running on: ma <-------------
Workload management services running on: ma

2> on "Cluster management service node" (ma), run following command to backup the database;
#pg_dump -U xcatadm xcatdb > db.backup

B> how to restore the database
1> change the failmode to manual
# pcmhatool failmode -m manual
Failover mode: Manual

2> Stop Platform HPC services.
#pcmadmin service stop --group=all

3>Stop xCAT services.
#service xcatd stop

4> Delete the existing database:
#dropdb -U postgres xcatdb

5> Create the database:
#createdb -U postgres xcatdb

6> Import the backup file:
#psql -U postgres xcatdb < db.backup

7> Check that the database was successfully restored:
#XCATBYPASS=1 nodels

If the database restore was successful, this command returns a list of nodes.

8> Start xCAT services.
#service xcatd start

9> Start Platform HPC services.
#pcmadmin service start --group=all

10> change the failmode to auto.
#pcmhatool failmode -m auto
Failover mode: Automatic

[{"Product":{"code":"SSENRW","label":"Platform HPC for System x"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Head Node","Platform":[{"code":"PF016","label":"Linux"}],"Version":"4.2","Edition":"Standard","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
19 September 2018

UID

isg3T1024489