How do I recover both failed nsp-tomcat databases in a DR NSP deployment using a database backup?
Purpose
Perform this procedure to recover the nsp-tomcat database instances in a DR NSP deployment in the event that both instances have inconsistencies.
Note: You require a previously created and useable nsp-tomcat database backup in order to perform the procedure.
Steps
Prepare for data recovery | |
1 |
Retrieve the required nsp-tomcat database backup.
|
2 |
Copy the backup file to the NSP deployer host in each data center.
|
3 |
Disable the auto-switchover function to ensure that no switchover occurs during the database restoration. Enter the following as the root or NSP admin user on the NSP cluster host in each data center: # kubectl exec -it $(kubectl get pods | awk '/nspos-asm/ {print $1;exit}') -c nspos-asm-app -- /opt/nsp/os/asm/bin/asmctl disableAutoFailover ↵ |
4 |
Enter the following as the root or NSP admin user on the NSP cluster host in either data center: # helm list | grep nsp-tomcat | awk -F' ' '{ print $10 }' ↵ The nsp-tomcat version is displayed. |
5 |
Record the nsp-tomcat version. |
6 |
Perform Step 8 to Step 21 in each data center. Note: You must perform the steps in the primary data center first. |
7 |
Go to Step 22. |
Restore individual cluster | |
8 |
Enter the following on the NSP cluster host to uninstall nsp-tomcat: # helm uninstall -n nsp-psa-restricted nsp-tomcat ↵ The nsp-tomcat uninstallation begins. |
9 |
Enter the following command block to monitor the uninstallation: while [ 0 -lt `kubectl get pvc --all-namespaces | grep nsp-tomcat | wc -l` ] || [ 0 -lt `kubectl get pv --all-namespaces | grep nsp-tomcat | wc -l` ] do sleep 2 echo "Still there..." done The uninstallation is complete when the command prompt is displayed. |
10 |
When the uninstallation is complete, enter the following to list the cluster nodes that can host nsp-tomcat: # kubectl get nodes --show-labels -o wide | grep nsp-sdn=true ↵ The nodes are listed; the following is a truncated output example for one node: node_name Ready control-plane nnd vx.yy.zz IP_address |
11 |
Enter the following command block as the root user on each node listed in Step 10 to delete the nsp-tomcat volume data directory content: Note: The cluster-state folder may already be empty. rm -rf /opt/nsp/volumes/nsp-tomcat/data/databases rm -rf /opt/nsp/volumes/nsp-tomcat/data/cluster-state rm -rf /opt/nsp/volumes/nsp-tomcat/data/transactions |
12 |
Enter the following on the NSP cluster host to install nsp-tomcat: # helm upgrade nsp-tomcat --install oci://registry.nsp.nokia.local/nsp/charts/cn-nsp-tomcat --namespace nsp-psa-restricted --version version --timeout 300s -f /opt/nsp/config/helm/values/sdn/nsp-tomcat/values.yaml -f /opt/nsp/config/helm/values/sdn/nsp-tomcat/restore.yaml ↵ where version is the nsp-tomcat version recorded in Step 4 nsp-tomcat is installed. |
13 |
Restore the nsp-tomcat database. Enter the following as the root or NSP admin user on the NSP deployer host: # /opt/nsp/NSP-CN-DEP-release-ID/NSP-CN-release-ID/tools/database/ nspos-db-restore-k8s.sh nsp-tomcat /tmp/backup_file ↵ You are prompted to restore the database. |
14 |
Respond to the prompt. The nsp-tomcat database is restored from the backup file. |
15 |
Enter the following on the NSP cluster host to uninstall nsp-tomcat: # helm uninstall -n nsp-psa-restricted nsp-tomcat ↵ The nsp-tomcat uninstallation begins. Note: You must not proceed to the next step until the uninstallation is complete. |
16 |
Enter the following command block to monitor the uninstallation: while [ 0 -lt `kubectl get pvc --all-namespaces | grep nsp-tomcat | wc -l` ] || [ 0 -lt `kubectl get pv --all-namespaces | grep nsp-tomcat | wc -l` ] do sleep 2 echo "Still there..." done The uninstallation is complete when the command prompt is displayed. |
17 |
When the uninstallation is complete, enter the following to install nsp-tomcat: # helm upgrade nsp-tomcat --install oci://registry.nsp.nokia.local/nsp/charts/cn-nsp-tomcat --namespace nsp-psa-restricted --version version --timeout 300s -f /opt/nsp/config/helm/values/sdn/nsp-tomcat/values.yaml ↵ where version is the nsp-tomcat version recorded in Step 4 nsp-tomcat is installed. |
18 |
Enter the following: # kubectl get pods -A ↵ The pods are listed. |
19 |
If the nsp-tomcat pod is not running, repeat the command in Step 18. Note: You must not proceed to the next step until nsp-tomcat is running. |
20 |
Sign in to the NSP as the admin user. |
21 |
Verify that you can open Path Control. You must not proceed to the next step until Path Control is available. |
Complete standby cluster configuration | |
22 |
Enter the following on the NSP cluster host in the standby data center to install nsp-tomcat: # helm upgrade nsp-tomcat --install oci://registry.nsp.nokia.local/nsp/charts/cn-nsp-tomcat --namespace nsp-psa-restricted --version version --timeout 300s -f /opt/nsp/config/helm/values/sdn/nsp-tomcat/values.yaml ↵ where version is the nsp-tomcat version recorded in Step 4 nsp-tomcat is installed. |
23 |
Enable the auto-switchover function; enter the following as the root or NSP admin user on the NSP cluster host in each data center: # kubectl exec -it $(kubectl get pods | awk '/nspos-asm/ {print $1;exit}') -c nspos-asm-app -- /opt/nsp/os/asm/bin/asmctl enableAutoFailover ↵ |
24 |
Monitor the following log files in the nsp-tomcat pod to ensure that the database starts successfully:
|
25 |
Close the open console windows. End of steps |