Use scripts (HAE) to configure HA on SAP HANA nodes, improving SAP HANA node reliability.
This only applies to SAP HANA nodes running the OS SUSE Linux Enterprise Server 12 SP1 for SAP for automatic active/standby switchovers.
In the cross-AZ HA scenario, three ECSs are required. Each ECS is bound to a SCSI disk and iSCSI configuration is required for SBD. For details, see section Configuring iSCSI (Cross-AZ HA Deployment).
SSH switching between SAP HANA nodes has been allowed.
The reason is as follows: When one SAP HANA node is created, the SBD volume is attached to it. This SBD volume must be attached to the other SAP HANA node.
wget https://obs-sap.obs.otc.t-systems.com/hana/cfgandscript/ha_auto_script.zip -P /hana/shared
Set the parameters in the configuration file based on the actual requirements. The following is an example:
[masterNode] # Host name of the active node masterName=hana001 # Heartbeat IP address of the active node masterHeartbeatIP1=10.0.4.2 masterHeartbeatIP2= [slaveNode] # Host name of the standby node slaveName=hana002 # Heartbeat IP address of the standby node slaveHeartbeatIP1=10.0.4.3 slaveHeartbeatIP2= [trunkInfo] # Floating IP address of SAP HANA hanaBusinessIP=10.0.3.103 [hanaInfo] # SBD volume path SBDDevice=/dev/sdc,/dev/sdd,/dev/sde # SAP HANA administrator account hanaUser=s00adm # SAP HANA instance number InstanceNumber=00
This script supports the configuration of the two heartbeat network planes. During the configuration, you need to add the IP addresses of the server or client plane after masterHeartbeatIP2 and slaveHeartbeatIP2 parameters respectively in the script.
In the cross-AZ scenario, configure SBDDevice to the drive letters of SBD volumes on the three ECSs. For example, SBDDevice=/dev/sbd1,/dev/sbd2,/dev/sbd3.
chmod +x hana_auto_ha.sh
1. Run the following command on the standby node to switch to the administrator mode:
su - <SID>adm
2. Stop the database of the standby node.
3. Register the standby node with the active node.
Set secondary to the host name of the new active node. Set site_name to the original active node name defined when configuring System Replication.
hdbnsutil -sr_register --remoteHost=<secondary> --remoteInstance=<instance_number> --replicationMode=sync --name=<site_name>
4. Start the database on the standby node and exit the administrator mode.
5. Start the HAE service.
systemctl start pacemaker
6. Clear resources on the original active node (current standby node).
rsc_SAPHana_SLE_HDB00 is an example resource name, which can be obtained by running the crm_mon - r1 command. Set primary to the name of the host on which the standby node is deployed.
crm resource cleanup <rsc_SAPHana_SLE_HDB00> <primary>
The following information is displayed if the command is successfully executed:
Online: [ hana001 hana002 ] Full list of resources: Clone Set: cln_SAPHanaTopology_SLE_HDB00 [rsc_SAPHanaTopology_SLE_HDB00] Started: [ hana001 hana002 ] rsc_ip_SLE_HDB00?(ocf::heartbeat:IPaddr2):?Started hana001 stonith-sbd?(stonith:external/sbd):?Started hana001 Master/Slave Set: msl_SAPHana_SLE_HDB00 [rsc_SAPHana_SLE_HDB00] Masters: [ hana001 ] Slaves: [ hana002 ] All Complete!
After the HA function is configured, HAE manages resources. Do not start or stop resources in other modes. If you need to manually perform test or modification operations, switch the cluster to the maintenance mode first.
crm configure property maintenance-mode=true
Exit the maintenance mode after the modification is complete.
crm configure property maintenance-mode=false
If you need to stop or restart the node, manually stop the cluster service.
systemctl stop pacemaker
After the ECS is started or restarted, run the following command to start the cluster service:
systemctl start pacemaker