A.1 SEPP Database Backup and Restore

Introduction

Perform this procedure to take a backup of the SEPP database (DB) and restore the database on a different cluster. This procedure is for on-demand backup and restoring of SEPP DB. The commands used for these procedures are provided by the MYSQL Network Database (NDB) cluster.

Prerequisite

Ensure that the MYSQL NDB cluster is in a healthy state, and each database node must be in the running state. Run the following command to check the status of cnDBTier service:
kubectl -n <namespace> exec <management node pod> -- ndb_mgm -e show
Where,
  • <namespace> is the namespace where cnDBTier is deployed.
  • <management node pod> is the management node pod of cnDBTier.

Example:

[cloud-user@vcne2-bastion-1 ~]$ kubectl -n seppsvc exec ndbmgmd-0 -- ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @10.233.86.202  (mysql-8.0.22 ndb-8.0.22, Nodegroup: 0, *)
id=2    @10.233.81.144  (mysql-8.0.22 ndb-8.0.22, Nodegroup: 0)
 
[ndb_mgmd(MGM)] 2 node(s)
id=49   @10.233.81.154  (mysql-8.0.22 ndb-8.0.22)
id=50   @10.233.86.2  (mysql-8.0.22 ndb-8.0.22)
 
[mysqld(API)]   2 node(s)
id=56   @10.233.81.164  (mysql-8.0.22 ndb-8.0.22)
id=57   @10.233.96.39  (mysql-8.0.22 ndb-8.0.22)
 
[cloud-user@vcne2-bastion-1 ~]$

SEPP DB Backup

If the SEPP database backup is required, do the following:
  1. Log in to any of the SQL node or API node, and then run the following command to take dump of the database:
    kubectl exec -it <sql node> -n <namespace> bash
    mysqldump --quick -h127.0.0.1 –u <username> -p  <databasename>| gzip > <backup_filename>.sql.gz
    Where,
    • <sql node> is the SQL node of cnDBTier
    • <namespace> is the namespace where cnDBTier is deployed
    • <username> is the database username.
    • <databasename> is the name of the database that has to be backed up
    • <backup_filename> is the name of the backup dump file
  2. Enter the SEPP database name and password in the command when prompted.

    Example:

    kubectl exec -it ndbmysqld-0 -n sepp bash
    mysqldump --quick -h127.0.0.1 -u dbuser -p seppdb | gzip > SEPPdbBackup.sql.gz

    Note:

    Ensure that there is enough space on the directory to save the backup file.

SEPP RESTORE

If the SEPP database restore is required, do the following:

  1. Transfer the <backup_ filename>.sql.gz file to the SQL node where you want to restore it.
  2. Log in to the SQL node of the MYSQL NDB cluster on the new DB cluster and create a new database where the database needs to be restored
  3. Create database, database user, and grant permissions as described in Configuring Database, Creating Users, and Granting Permissions section.

    Note:

    The database name created in this step should be the same as the database name created in the next sub step. Also, the Kubernetes secret should be the same as in the values.yaml file used for installing SEPP.
  4. To restore the database to the new database created, run the following command:

    gunzip < <backup_filename>.sql.gz | mysql -h127.0.0.1 –u <username> -p <databaseName >

    Example:

    gunzip < seppdbBackup.sql.gz | mysql -h127.0.0.1 -u dbuser -p newseppdb
  5. Enter the password when prompted.