This blog provides guidance to perform the steps during the failover of SAP ASCS/ERS HA VMs in Linux cluster to the DR region in Azure using ASR. We will have details of changes to be made in the DR environment to re-configure the pacemaker cluster to start the ASCS/ERS HA environment with Azure Fence agent as STONITH device. Steps cover both SUSE Linux and RHEL OS. In SUSE Pacemaker cluster, we can also use SBD device (in place of Azure Fence agent) for fencing which requires additional VMs and its DR setup will require additional changes which is not covered in this blog.
Note : The specific procedures described have been exercised with these OS releases
• OS release #1 : SUSE Linux 12 SP5
• OS release #2 : RHEL 8.1
Please note that the procedures described have not been coordinated with the OS providers and therefore might not work in completeness with your specific implementations or with future OS releases. As a result you should test the procedures described thoroughly in your environment.
Also note that the procedure as described works only with Azure Fencing Agent and not with iSCSI SBD devices.
The SAP ASCS/ERS HA cluster design in the primary and DR region in Azure is as described in the diagram and can be used as reference architecture for SAP HA & DR setup in Azure. Highly Available NFS File share to be used for common file systems of SAP. Azure Site Recovery (ASR) is recommended to be used for across region replication of the VMs for DR setup. An NFS fileshare needs to be available in the respective region for starting the SAP ASCS/ERS application services and should be synchronized between region for availability of latest data.
Define frontend IP, backend pool, Probe port and loadbalancing rules. Frontend IP would be different in the DR region. Probe port can be same as primary region ASCS/ERS cluster.
Front-end IP |
Backend Pool |
Health probe port |
Load balancing rule |
172.10.0.45 (ASCS Virtual IP - HA) |
azshafsascs1 and azshafsascs2
|
64300 |
Enable HA Port, Enable Floating IP, Idle Timeout (30 Minutes) |
172.10.0.46 (AERS Virtual IP - HA) |
64302 |
Enable HA Port, Enable Floating IP, Idle Timeout (30 Minutes) |
|
173.30.0.45 (ASCS Virtual IP - DR) |
azshafsascs1-test and azshafsascs2-test
|
64300 |
Enable HA Port, Enable Floating IP, Idle Timeout (30 Minutes) |
173.30.0.46 (AERS Virtual IP - DR) |
64302 |
Enable HA Port, Enable Floating IP, Idle Timeout (30 Minutes) |
NFS Fileshare for ‘sapmnt’, ‘trans’ and ‘usr/sap’ must be must be synchronized with Primary Region and available/mounted in the DR region. New location/path of NFS files needs to be updated in '/etc/fstab' and cluster configuration the DR ASCS VMs.
Note: One of the options for NFS FileShare is to use Azure File NFS. As ASR can’t replicate NFS sources, one of the methods to replicate is to Copy the data to locally attached disk in the ASCS/ERS VMs using cronjob(for frequent interval copy) so that ASR can replicate the data to DR region. Detailed steps are described in Appendix.
The following items are prefixed with either [A - DR] - applicable to all nodes of DR ASCS/ERS, [1-DR] - only applicable to node 1 of DR ASCS/ERS or [2-DR] - only applicable to node 2 of DR ASCS/ERS
nodelist {
node {
ring0_addr: 173.30.0.61
nodeid: 1
}
node {
ring0_addr: 172.30.0.62
nodeid: 2
}
Note: This step is only required in SUSE Linux.
systemctl start pacemaker
pcs cluster start
sudo crm configure property maintenance-mode="true"
sudo pcs property set maintenance-mode=true
For SUSE Linux : The properties of the resources can be changed in the GUI tool ‘Hawk’ (https://<hostname>:7630/) or using the syntax “crm configure edit” (use ‘vi’ editor commands to update the content)
For RHEL : The properties of the resources can be changed using the ‘PCSD web UI’ (https://<hostname>:2224/). Once you start the pcs web UI, click on ‘+Add Existing’ and enter hostname of the cluster to see the properties.
Note : Azure Fence Agent requires outbound connectivity to public end points as documented, along with possible solutions, in Public endpoint connectivity for VMs using standard ILB.
Note : While performing ‘Test Failover’ in ASR, VM name created in the DR Region will be suffixed by ‘-test’ but hostname at operating system will be same as Primary Region VMs. Since VM name doesn’t match with node name(hostname) in the cluster, we need to add parameter ‘pcmk_host_map’ and map hostname & VM name in Azure Fence Agent configuration in the pacemaker. This will ensure fencing of the VM during cluster testing.
sudo crm configure property maintenance-mode="false"
sudo pcs property set maintenance-mode=false
This section describes steps to synchronize Azure Files NFS between primary and secondary region. This method of synchronization is one of the several possible ways to achieve data synchronization.
To setup ASCS/ERS cluster with Azure Files NFS(in public preview as of February 2021), please refer to the blog.
High level steps
Detailed Steps:
Provided steps as reference by considering SAP SID as T01, ASCS system number as ‘00’ and ERS system number as ‘02’.
In Primary Region
sudo mkdir -p /sapfoldercopy/T01ASCS00
sudo mkdir -p /sapfoldercopy/T01ERS02
sudo mkdir -p /sapfoldercopy/sapmntT01
sudo mkdir -p /sapfoldercopy/trans
sudo mkdir -p /sapfoldercopy/usrsapT01
chown <sid>adm:sapsys /sapfoldercopy/*
>>vi copy_sap_folders.sh
#!/bin/sh
cp -p -u -R /sapmnt/T01/ /sapfoldercopy/sapmntT01/
cp -p -u -R /usr/sap/trans/ /sapfoldercopy/trans/
cp -p -u -R /usr/sap/T01/ /sapfoldercopy/usrsapT01/
erscount="$(ls -l /usr/sap/T01/ERS02/ | wc -l)"
if [[ $erscount -gt 1 ]]
then
{
cp -p -R /usr/sap/T01/ERS02/ /sapfoldercopy/T01ERS02/
mv /sapfoldercopy/T01ASCS00/ASCS00 /sapfoldercopy/T01ASCS00/ASCS00_old
}
fi
ascscount="$(ls -l /usr/sap/T01/ASCS00/ | wc -l)"
if [[ $ascscount -gt 1 ]]
then
{
cp -p -R /usr/sap/T01/ASCS00/ /sapfoldercopy/T01ASCS00/
mv /sapfoldercopy/T01ERS02/ERS02 /sapfoldercopy/T01ERS02/ERS02_old
}
fi
Note : comment out copy of ‘sapmnt’, ‘trans’ and ‘usrsapT01’ in one of the VM as contents are same in both the VMs.
chown <sid>adm:sapsys copy_sap_folders.sh
chmod 755 copy_sap_folders.sh
>>crontab -e
15,30,45,59 * * * * /home/t01adm/copy_sap_folders.sh
In Secondary Region, during DR activation OR DR testing
>> mount -a
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.