How do I restore the NSP cluster databases?
Purpose
Perform this procedure to restore one or more of the following in each NSP cluster:
Note: The Neo4j, nsp-tomcat, and nrcx-tomcat database backup files are each named graph.db. You must ensure that you are using the correct graph.db backup file when you restore the Neo4j, nsp-tomcat, or nrcx-tomcat database.
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 NSP cluster.
Note: You can specify a local backup file path, or a remote path, if the remote server is reachable from the NSP deployer host and from the NSP 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 NSP configuration, remote operations such as SSH and SCP as the root user are not permitted within an NSP 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 NSP release, in the form MAJOR.minor.patch
version is a numeric value
Steps
Prepare to restore databases | |
1 |
Log in as the root or NSP admin user on the NSP deployer host. |
2 |
Open a console window. |
3 |
If you are restoring the data on new NSP cluster VMs, create and distribute an SSH key for password-free NSP deployer host access to each NSP cluster VM.
|
4 |
Perform one of the following. Note: You must not proceed to the next step until the cluster is ready.
|
Enable NSP restore mode | |
5 |
Enter the following on the NSP deployer host: # cd /opt/nsp/NSP-CN-DEP-release-ID/bin ↵ |
6 |
Enter the following to enter restore mode: Note: If the NSP 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 NSP cluster pods 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 NSP deployer host: # cd /opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/tools/database ↵ |
10 |
Enter one or more of the following, as required, to restore system data and databases: 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.
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 |
Restore NSP Kubernetes secrets | |
11 |
Perform the following steps in each data center to restore the NSP Kubernetes secrets. Note: Ensure that you restore each backup file on the correct NSP cluster; an NSP secrets backup is specific to an NSP cluster.
|
Start NSP clusters | |
12 |
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 NSP 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
|
13 |
Close the open console windows. End of steps |