Chapter 8. Maintenance procedures
You must apply specific steps to ensure that the cluster does not cause unplanned impact so that you can perform maintenance of different components ofSAP HANA system replication HA environments.
Use maintenance procedures to keep your cluster in a healthy state during planned change activity or to restore the health after unplanned incidents.
8.1. Cleaning up the failure history Copy linkLink copied to clipboard!
Clear any failure notifications from the cluster that may be there from previous testing. This resets the failure counters and the migration thresholds.
Procedure
Clean up resource failures:
pcs resource cleanup
[root]# pcs resource cleanupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Clean up the STONITH failure history:
pcs stonith history cleanup
[root]# pcs stonith history cleanupCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Check the overall cluster status and confirm that no failures are displayed anymore:
pcs status --full
[root]# pcs status --fullCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Check that the stonith history for fencing actions has 0 events:
pcs stonith history
[root]# pcs stonith history
8.2. Triggering a HANA takeover using cluster commands Copy linkLink copied to clipboard!
Use the cluster control to execute a simple takeover of the primary instance to the other node.
For detailed steps, refer to the section Testing the setup - Triggering a HANA takeover using cluster commands.
8.3. Updating the operating system and HA cluster components Copy linkLink copied to clipboard!
For updates or offline changes on the HA cluster, the operating system or even the system hardware, you must follow the Recommended Practices for Applying Software Updates to a RHEL High Availability or Resilient Storage Cluster.
8.4. Performing maintenance on the SAP HANA instances Copy linkLink copied to clipboard!
For any kind of maintenance of applications or other components that the HA cluster manages, you must enable the cluster maintenance mode to prevent the cluster from any interference during the maintenance.
During the update of your HANA instances, the cluster remains running, but is not actively monitoring resources or taking any actions. After the change on the HANA instance is done, it is vital to refresh the cluster resource status and verify that the detected resource states are all correct. Only then can the maintenance mode be disabled again without unexpected cluster actions.
If you need to stop the cluster for the maintenance activity, ensure that you set maintenance mode first, then stop and start the cluster on the node as required for the HANA maintenance.
Prerequisites
- You have configured the Pacemaker cluster to manage the HANA system replication.
Procedure
Set
maintenancemode for the entire cluster:pcs property set maintenance-mode=true
[root]# pcs property set maintenance-mode=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Setting maintenance for the whole cluster ensures that no activity during the maintenance phase can trigger cluster actions and impact the HANA update process.
Verify that the cluster resource management is fully disabled:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the HANA instances using the SAP procedure. If you have to perform a takeover during the HANA update, you can use the SAP HANA Takeover with Handshake option. For more information see also Is it possible to use SAP HANA "Takeover with Handshake" option with the HA Solutions for managing HANA System Replication?.
If you stop the cluster in this step, ensure that you start it again before you proceed with the next steps. Keep the maintenance mode enabled.
After the HANA update, verify that the HANA system replication is working correctly. Use the
systemReplicationStatus.pyscript to show the status of the HANA system replication on the primary instance. Below is the example of post manual takeover to node2, during the maintenance:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Before you proceed, ensure that the system replication is healthy and reported as
ACTIVE.Refresh all cluster resources to execute one monitor operation and update their status:
pcs resource refresh Waiting for 1 reply from the controller ... got reply (done)
[root]# pcs resource refresh Waiting for 1 reply from the controller ... got reply (done)Copy to Clipboard Copied! Toggle word wrap Toggle overflow It is crucial that the HANA resources update cluster and node attributes, to reflect the new HANA system replication status. It ensures that the cluster has the correct information and does not trigger recovery actions due to incorrect status information, after the maintenance stops.
Check the cluster status and verify the resource status and main HANA resource score attribute. All resources must show as
Startedand the promotable resources must show asUnpromotedon all nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the cluster attributes and verify that
srHook,rolesandscoreattributes are in the correct new state:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The
srHookisPRIMon the node that is running the primary instance and it showsSOKon the correct secondary. -
The
scoreis150for the node where the primary is running and is100on the other.
-
The
When the checks of steps 6 and 7 show the landscape in the expected healthy state, you can remove the maintenance mode of the cluster again:
pcs property set maintenance-mode=
[root]# pcs property set maintenance-mode=Copy to Clipboard Copied! Toggle word wrap Toggle overflow When you lift the maintenance it triggers a monitor run of all resources again. The cluster updates the status of the promotable resources to
PromotedandUnpromotedin correspondence to the location of the primary and secondary instances. The resources now also update thesrPollattribute again to match thesrHookattribute value.
8.5. Registering the former primary after a takeover Copy linkLink copied to clipboard!
When you configure AUTOMATED_REGISTER=false in the SAPHanaController resource, which is the default, you must manually register the former primary instance as the new secondary after takeover and start it. Otherwise, the unregistered instance remains stopped.
Procedure
Register the former primary as the new secondary. Run as user
<sid>admon the stopped former primary instance:rh1adm $ hdbnsutil -sr_register --remoteHost=<node> \ --remoteInstance=${TINSTANCE} --replicationMode=sync \ --operationMode=logreplay --name=<DC>rh1adm $ hdbnsutil -sr_register --remoteHost=<node> \ --remoteInstance=${TINSTANCE} --replicationMode=sync \ --operationMode=logreplay --name=<DC>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<node>with the new primary instance host, for example node2 if there was a takeover from node1 to node2. -
Replace
<DC>with your new secondary HANA site name, for example DC1 if node1 is to be registered as a secondary. -
Choose the values for
replicationModeandoperationModeaccording to your requirements for the system replication. -
TINSTANCEis an environment variable that is set automatically for user<sid>admby reading the HANA instance profile. The variable value is the HANA instance number.
-
Replace
Start the secondary HANA instance. Run as
<sid>admon the new secondary instance node:rh1adm $ HDB start
rh1adm $ HDB startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
On the current primary instance, show the current status of the re-established HANA system replication. Below is the example after a takeover and the secondary instance is re-registered on node1:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow