How do I restore the CLM cluster databases?
Purpose
Perform this procedure to restore one or more of the following in each CLM cluster:
Note: If you are performing the procedure as part of a system conversion, migration, or upgrade procedure in a DR deployment, you must perform the procedure only in the new primary CLM cluster.
Note: You can specify a local backup file path, or a remote path, if the remote server is reachable from the CLM deployer host and from the CLM cluster host.
To specify a remote path, use the following format for the backup_file parameter in the command, where user has access to backup_file at the server address:
user@server:/backup_file
Note: If root access for remote operations is disabled in the CLM configuration, remote operations such as SSH and SCP as the root user are not permitted within a CLM cluster. Steps that describe such an operation as the root user must be performed as the designated non-root user with sudoer privileges.
For simplicity, such steps describe only root-user access.
Note: release-ID in a file path has the following format:
R.r.p-rel.version
where
R.r.p is the CLM release, in the form MAJOR.minor.patch
version is a numeric value
Steps
Prepare to restore databases | |
1 |
Log in as the root or CLM admin user on the CLM deployer host. |
2 |
Open a console window. |
3 |
If you are restoring the data on new CLM cluster VMs, create and distribute an SSH key for password-free CLM deployer host access to each CLM cluster VM.
|
4 |
Perform one of the following. Note: You must not proceed to the next step until the cluster is ready.
|
Enable CLM restore mode | |
5 |
Enter the following on the CLM deployer host: # cd /opt/nsp/NSP-CN-DEP-release-ID/bin ↵ |
6 |
Enter the following to enter restore mode: Note: If the CLM cluster VMs do not have the required SSH key, you must include the --ask-pass argument in the nspdeployerctl command, as shown in the following example, and are subsequently prompted for the root password of each cluster member: nspdeployerctl --ask-pass install --config --restore # ./nspdeployerctl install --config --restore ↵ |
7 |
The following CLM cluster pod must be operational before the restore begins: Enter the following periodically to list the pods; the cluster is ready for the restore when each required pod is in the Running state: # kubectl get pods -A ↵ |
8 |
If any required pod is not Running, return to Step 7. Note: A restore attempt fails unless each required pod is Running. |
Restore data | |
9 |
Enter the following on the CLM deployer host: # cd /opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/tools/database ↵ |
10 |
Enter one or more of the following to restore system data and the database: Note: In a DR deployment, you must perform the steps first in the data center that you want to start as the primary data center. To restore the CLM PostgreSQL database: # ./nspos-db-restore-k8s.sh nspos-postgresql backup_dir/backup_file ↵ where backup_dir is the directory that contains the backup file backup_file is the backup file name, for example, for PostgreSQL, the name is nspos-postgresql_backup_timestamp.tar.gz |
Start CLM clusters | |
11 |
Perform the following steps in each data center. Note: In a DR deployment, you must perform the steps first in the data center that you want to start as the primary data center. Note: If the CLM cluster VMs do not have the required SSH key, you must include the --ask-pass argument in the nspdeployerctl command, as shown in the following example, and are subsequently prompted for the root password of each cluster member: nspdeployerctl --ask-pass uninstall --undeploy OR nspdeployerctl --ask-pass uninstall --undeploy
|
12 |
Close the open console windows. End of steps |