Skip to content

Commit cada20f

Browse files
authored
Merge pull request #228058 from msftrobiro/sap-hana-dr-add
SAP HANA multi-tier for DR
2 parents 909db32 + c05c8f6 commit cada20f

6 files changed

+175
-4
lines changed
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: Add HSR third site to HANA Pacemaker cluster on SUSE
3+
description: Extending highly available SAP HANA solution with third site on SUSE systems.
4+
author: msftrobiro
5+
ms.author: robiro
6+
ms.service: sap-on-azure
7+
ms.subservice: sap-vm-workloads
8+
ms.workload: infrastructure-services
9+
ms.topic: how-to
10+
ms.date: 02/21/2023
11+
ms.custom: template-how-to-pattern
12+
---
13+
14+
# Add HSR third site to HANA Pacemaker cluster on SUSE
15+
16+
This article describes requirements and setup of a third HANA replication site complement an existing SUSE Linux Enterprise Server (SLES) Pacemaker cluster.
17+
18+
## Overview
19+
20+
SAP HANA supports system replication (HSR) with more than two sites connected. You can add a third site to an existing HSR pair, which is managed by Pacemaker in a highly available setup. You can deploy the third site in a second Azure region for disaster recovery (DR) purposes.
21+
22+
Pacemaker and HANA cluster resource agent manages the first two sites. Pacemaker cluster does not control any third, DR site.
23+
24+
SAP HANA supports a third system replication site in two modes.
25+
- [Multi-target](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/ba457510958241889a459e606bbcf3d3.html) replicates data changes from primary to more than one target system. Third site connected to primary, star form replication.
26+
- [Multi-tier](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/f730f308fede4040bcb5ccea6751e74d.html) is a two-tier system replication. A cascading, or sometimes referred to as chained setup, of three different HANA tiers. Third site connected to secondary.
27+
For more information, see [SAP HANA availability across Azure regions](./sap-hana-availability-across-regions.md#combine-availability-within-one-region-and-across-regions) for more conceptual details about HANA HSR within one region and across Azure regions.
28+
29+
## Prerequisites
30+
31+
Requirements for a third HSR site are different between HANA scale-up and HANA scale-out.
32+
33+
> [!NOTE]
34+
> Dependencies are valid for a Pacemaker enabled landscape. Without Pacemaker, only SAP's HANA version requirements apply.
35+
> Pacemaker and HANA cluster resource agent manages only two sites. Third HSR site isn't controlled by Pacemaker cluster.
36+
37+
- Both scale-up and scale-out: SAP HANA SPS 04 or newer required to use multi-target HSR with a Pacemaker cluster
38+
- Both scale-up and scale-out: Maximum one SAP HANA system replication connected from outside the Linux cluster
39+
- HANA scale-out only: SLES 15 SP1 or higher
40+
- HANA scale-out only: OS package SAPHanaSR-ScaleOut version 0.180 or higher
41+
- HANA scale-out only: SAP HANA HA provider SAPHanaSrMultiTarget in use. HANA HA provider SAPHanaSR isn't multi-target aware for scale-out.
42+
43+
## HANA scale-up: Add HANA multi-target system replication for DR purposes
44+
45+
With SAP HANA HA provider [SAPHanaSR](./sap-hana-high-availability.md#implement-hana-hooks-saphanasr-and-suschksrv), you can configure a third node for disaster recovery (DR) purposes. The Pacemaker environment is aware of a HANA multi-target DR setup.
46+
47+
Failure of the third node won't trigger any cluster action. Cluster detects the replication status of connected sites and the monitored attribute for third site can change between SOK and SFAIL state. Any takeover tests to third/DR site or executing your DR exercise process should first place the cluster resources into maintenance mode to prevent any undesired cluster action.
48+
49+
Example of a multi-target system replication system. For more information, see [SAP documentation](https://help.sap.com/docs/SAP_HANA_PLATFORM/4e9b18c116aa42fc84c7dbfd02111aba/2e6c71ab55f147e19b832565311a8e4e.html).
50+
![Diagram showing an example of a HANA scale-up multi-target system replication system.](./media/sap-hana-high-availability/sap-hana-high-availability-scale-up-hsr-multi-target.png)
51+
52+
1. Deploy Azure resources for the third node. Depending on your requirements, you can use a different Azure region for disaster recovery purposes.
53+
Steps required for the HANA scale-out on third site are mirroring steps to deploy the [HANA scale-up cluster](./sap-hana-high-availability.md#deploy-for-linux). Deploy the third node following the Azure infrastructure, operating system and HANA installation steps for first node of the Pacemaker cluster, with the following exceptions:
54+
- No load balancer deployed for third site and no integration with existing cluster load balancer for the VM of third site
55+
- Don't install OS packages SAPHanaSR, SAPHanaSR-doc and OS package pattern ha_sles on third site VM
56+
- No integration into the cluster for VM or HANA resources of the third site
57+
- No HANA HA hook setup for third site in global.ini
58+
59+
2. Install SAP HANA on third node.
60+
Same HANA SID and HANA installation number must be used for third site.
61+
62+
3. With SAP HANA on third site installed and running, register the third site with the primary site.
63+
The example uses SITE-DR as the name for third site.
64+
```bash
65+
# Execute on the third site
66+
su - hn1adm
67+
# Make sure HANA isn't running on the third site. If it is started, stop HANA
68+
sapcontrol -nr 03 -function StopSystem
69+
sapcontrol -nr 03 -function WaitforStopped 600 10
70+
# Register the HANA third site to the primary
71+
hdbnsutil -sr_register --name=SITE-DR --remoteHost=hn1-db-0 --remoteInstance=03 --replicationMode=async
72+
```
73+
74+
4. Verify HANA system replication shows both secondary and third site.
75+
```bash
76+
# Verify HANA HSR is in sync, execute on primary
77+
sudo su - hn1adm -c "python /usr/sap/HN1/HDB03/exe/python_support/systemReplicationStatus.py"
78+
# Third site, SITE-DR, will show up next to existing replication to SITE2 used by Pacemaker cluster.
79+
```
80+
81+
5. Check the SAPHanaSR attribute for third site. SITE-DR should show up with status SOK in the sites section.
82+
```bash
83+
# Check SAPHanaSR attribute on any cluster managed host (first or second site)
84+
sudo SAPHanaSR-showAttr
85+
# Expected result
86+
# Global cib-time maintenance
87+
# --------------------------------------------
88+
# global Tue Feb 21 19:28:21 2023 false
89+
#
90+
# Sites srHook
91+
# -----------------
92+
# HN1-SITE1 PRIM
93+
# HN1-SITE2 SOK
94+
# SITE-DR SOK
95+
```
96+
97+
Cluster detects the replication status of connected sites and the monitored attributed can change between SOK and SFAIL. No cluster action if the replication to DR site fails.
98+
99+
## HANA scale-out: Add HANA multi-target system replication for DR purposes
100+
101+
With SAP HANA HA provider [SAPHanaSrMultiTarget](./sap-hana-high-availability-scale-out-hsr-suse.md#implement-hana-ha-hooks-saphanasrmultitarget-and-suschksrv), you can add a third HANA scale-out site. This third site is often used for disaster recovery (DR) in another Azure region. The Pacemaker environment is aware of a HANA multi-target DR setup.
102+
103+
Failure of the third node won't trigger any cluster action. Cluster detects the replication status of connected sites and the monitored attribute for third site can change between SOK and SFAIL state. Any takeover tests to third/DR site or executing your DR exercise process should first place the cluster resources into maintenance mode to prevent any undesired cluster action.
104+
105+
Example of a multi-target system replication system. For more information, see [SAP documentation](https://help.sap.com/docs/SAP_HANA_PLATFORM/4e9b18c116aa42fc84c7dbfd02111aba/2e6c71ab55f147e19b832565311a8e4e.html).
106+
![Diagram showing an example of a HANA scale-out multi-target system replication system.](./media/sap-hana-high-availability/sap-hana-high-availability-scale-out-hsr-multi-target.png)
107+
108+
1. Deploy Azure resources for the third site. Depending on your requirements, you can use a different Azure region for disaster recovery purposes.
109+
Steps required for the HANA scale-out on third site are mirroring steps to deploy the [HANA scale-out cluster](./sap-hana-high-availability-scale-out-hsr-suse.md#set-up-the-infrastructure). Deploy the third site following the Azure infrastructure, operating system and HANA installation steps for SITE1 of the scale-out cluster, with the following exceptions:
110+
- No load balancer deployed for third site and no integration with existing cluster load balancer for the VMs of third site
111+
- Don't install OS packages SAPHanaSR-ScaleOut, SAPHanaSR-ScaleOut-doc and OS package pattern ha_sles on third site VMs
112+
- No majority maker VM for third site, as there's no cluster integration
113+
- Create NFS volume /hana/shared for third site exclusive use
114+
- No integration into the cluster for VMs or HANA resources of the third site
115+
- No HANA HA hook setup for third site in global.ini
116+
117+
You must use the same HANA SID and HANA installation number for third site.
118+
119+
2. With SAP HANA scale-out on third site installed and running, register the third site with the primary site.
120+
The example uses SITE-DR as the name for third site.
121+
```bash
122+
# Execute on the third site
123+
su - hn1adm
124+
# Make sure HANA isn't running on the third site. If it is started, stop HANA
125+
sapcontrol -nr 03 -function StopSystem
126+
sapcontrol -nr 03 -function WaitforStopped 600 10
127+
# Register the HANA third site to the primary
128+
hdbnsutil -sr_register --name=SITE-DR --remoteHost=hana-s1-db1 --remoteInstance=03 --replicationMode=async
129+
```
130+
131+
3. Verify HANA system replication shows both secondary and third site.
132+
```bash
133+
# Verify HANA HSR is in sync, execute on primary
134+
sudo su - hn1adm -c "python /usr/sap/HN1/HDB03/exe/python_support/systemReplicationStatus.py"
135+
# Third site, SITE-DR, will show up next to existing replication to SITE2 used by Pacemaker cluster.
136+
```
137+
138+
4. Check the SAPHanaSR attribute for third site. SITE-DR should show up with status SOK in the sites section.
139+
```bash
140+
# Check SAPHanaSR attribute on any cluster managed host (first or second site)
141+
sudo SAPHanaSR-showAttr
142+
# Expected result
143+
# Global cib-time maintenance prim sec sync_state upd
144+
# ---------------------------------------------------------------------
145+
# HN1 Fri Jan 27 10:38:46 2023 false HANA_S1 - SOK ok
146+
#
147+
# Sites lpt lss mns srHook srr
148+
# ------------------------------------------------
149+
# SITE-DR SOK
150+
# HANA_S1 1674815869 4 hana-s1-db1 PRIM P
151+
# HANA_S2 30 4 hana-s2-db1 SWAIT S
152+
```
153+
154+
Cluster detects the replication status of connected sites and the monitored attributed can change between SOK and SFAIL. No cluster action if the replication to DR site fails.
155+
156+
## Auto-registering third site
157+
158+
During planned or unplanned takeover event between the two Pacemaker cluster sites, HSR to third site will be also interrupted. Pacemaker doesn't modify HANA replication to third site.
159+
160+
SAP provides since HANA 2 SPS 04 parameter `register_secondaries_on_takeover`. With the parameter set to value `true`, after HSR takeover between cluster sites 1 and 2, HANA will register the third site on the new primary automatically to keep an HSR multi-target setup. Configure HANA parameter `register_secondaries_on_takeover = true` configured in `[system_replication]` block of global.ini on both SAP HANA sites in the Linux cluster. Both SITE1 and SITE2 need the parameter in the respective HANA global.ini configuration file.
161+
162+
For HSR [multi-tier](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/f730f308fede4040bcb5ccea6751e74d.html), no automatic SAP HANA registration of the third site exists. You need to manually register the third site to the current secondary, to keep HSR replication chain for multi-tier.
163+
164+
![Diagram flow showing how a HANA auto-registartion works with a third site during a takeover.](./media/sap-hana-high-availability/sap-hana-high-availability-hsr-third-site-auto-register.png)
165+
166+
## Next steps
167+
168+
- [Disaster recovery overview and infrastructure](./disaster-recovery-overview-guide.md)
169+
- [Disaster recovery for SAP workloads](./disaster-recovery-sap-guide.md)
170+
- [High-availability architecture and scenarios for SAP NetWeaver](./sap-hana-availability-across-regions.md)
Loading
46.9 KB
Loading
Loading

articles/sap/workloads/sap-hana-high-availability-scale-out-hsr-suse.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ As `/hana/data` and `/hana/log` are deployed on local disks, it is not necessary
9999

100100
If you are using Azure NetApp Files, the NFS volumes for `/hana/shared`, are deployed in a separate subnet, [delegated to Azure NetApp Files](../../azure-netapp-files/azure-netapp-files-delegate-subnet.md): `anf` 10.23.1.0/26.
101101

102-
> [!IMPORTANT]
103-
> System replication to a 3rd site is not supported. For details see section "Important prerequisites" in [SLES-SAP HANA System Replication Scale-out Performance Optimized scenario](https://documentation.suse.com/sbp/all/html/SLES4SAP-hana-scaleOut-PerfOpt-12/index.html#_important_prerequisites).
104-
105102
## Set up the infrastructure
106103

107104
In the instructions that follow, we assume that you've already created the resource group, the Azure virtual network with three Azure network subnets: `client`, `inter` and `hsr`.
@@ -865,7 +862,7 @@ You can adjust the behavior of susChkSrv with parameter action_on_lost. Valid va
865862
ha_dr_saphanasrmultitarget = info
866863
```
867864
868-
Default location of the HA hooks as deliveredy SUSE is /usr/share/SAPHanaSR-ScaleOut. Using the standard location brings a benefit, that the python hook code is automatically updated through OS or package updates and gets used by HANA at next restart. With an optional own path, such as /hana/shared/myHooks you can decouple OS updates from the used hook version.
865+
Default location of the HA hooks as dalivered by SUSE is /usr/share/SAPHanaSR-ScaleOut. Using the standard location brings a benefit, that the python hook code is automatically updated through OS or package updates and gets used by HANA at next restart. With an optional own path, such as /hana/shared/myHooks you can decouple OS updates from the used hook version.
869866
870867
3. **[AH]** The cluster requires sudoers configuration on the cluster nodes for <sid\>adm. In this example that is achieved by creating a new file. Execute the commands as `root` adapt the values of hn1 with correct lowercase SID.
871868

articles/sap/workloads/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ items:
211211
href: high-availability-guide-rhel-with-dialog-instance.md
212212
- name: Install SAP NetWeaver with HANA HA cluster - RHEL
213213
href: high-availability-guide-rhel-with-hana-ascs-ers-dialog-instance.md
214+
- name: Disaster recovery
215+
items:
216+
- name: Add HSR third site to HANA Pacemaker cluster on SUSE
217+
href: disaster-recovery-sap-hana-suse.md
214218
- name: Integration with Microsoft services
215219
items:
216220
- name: Outbound E-Mail from SAP to Exchange Online

0 commit comments

Comments
 (0)