|
| 1 | +--- |
| 2 | +title: HSR third site with Pacemaker |
| 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-workload |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 02/21/2023 |
| 10 | +ms.custom: template-how-to-pattern |
| 11 | +--- |
| 12 | + |
| 13 | +# HSR third site with Pacemaker |
| 14 | + |
| 15 | +This article describes requirements and setup of a third HANA replication site complimenting an existing SUSE Linux Enterprise Server (SLES) Pacemaker cluster. |
| 16 | + |
| 17 | +## Overview |
| 18 | + |
| 19 | +SAP HANA supports system replication with more than two sites connected. A third site can be added to an existing HSR pair, which is managed by Pacemaker in a highly-available setup. The third site can be deployed in a second Azure region for disaster recovery (DR) purposes. |
| 20 | + |
| 21 | +Pacemaker and HANA cluster resource agent manages the first two sites. Any third, DR site, is not controlled by the cluster. |
| 22 | + |
| 23 | +SAP HANA supports a third system replication site in two modes. |
| 24 | +- [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. |
| 25 | +- [Multi-tier](https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/f730f308fede4040bcb5ccea6751e74d.html) is a 2-tier system replication. A cascading, or sometimes referred to as chained setup, of 3 different HANA tiers. Third site connected to secondary. |
| 26 | +See [SAP HANA availability across Azure regions](./sap-hana-availability-across-regions.md#combine-availability-within-one-region-and-across-regions) for more details about HANA HSR within one region and across Azure regions. |
| 27 | + |
| 28 | +## Prerequisites |
| 29 | + |
| 30 | +Requirements for a third HSR site are different for HANA scale-up (single VM for each HANA system) and HANA scale-out (multiple VMs for each HANA system). |
| 31 | + |
| 32 | +> [!NOTE] |
| 33 | +> Dependencies are valid for a Pacemaker enabled landscape. Without Pacemaker, only SAP's HANA version requirements apply. |
| 34 | +
|
| 35 | +- SAP HANA SPS 04 or newer is needed to use multi-target HSR with a Pacemaker cluster |
| 36 | +- Maximum one additional SAP HANA system replication connected from outside the Linux cluster |
| 37 | +- HANA scale-out only: SLES 15 SP1 or higher |
| 38 | +- HANA scale-out only: OS package SAPHanaSR-ScaleOut version 0.180 or higher |
| 39 | +- HANA scale-out only: SAP HANA HA provider SAPHanaSrMultiTarget in use. HANA HA provider SAPHanaSR is not multi-target aware for scale-out. |
| 40 | + |
| 41 | +Pacemaker and HANA cluster resource agent manages only two sites. Third site is not controlled by Pacemaker cluster. |
| 42 | + |
| 43 | +## HANA scale-up: Setup 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 made 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 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 further information, see [SAP documentation](https://help.sap.com/docs/SAP_HANA_PLATFORM/4e9b18c116aa42fc84c7dbfd02111aba/2e6c71ab55f147e19b832565311a8e4e.html). |
| 50 | + |
| 51 | + |
| 52 | +1. Deploy Azure resources for the third node. Depending on your requirements, a different Azure region is often used 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 | + - OS packages SAPHanaSR, SAPHanaSR-doc and OS package pattern ha_sles aren't installed 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 is not 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 is impacted. |
| 98 | + |
| 99 | +### Auto-registering third site |
| 100 | + |
| 101 | +During planned or unplanned takeover event between the two Pacemaker cluster sites, HSR to third site will be also interrupted. For Pacemaker setting `AUTOMATED_REGISTER = yes|no` can control registration between Pacemaker controlled sites 1 and 2. The parameter does not control HSR replication to the cluster controlled third site. |
| 102 | + |
| 103 | +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 a 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 first and second node/site need the parameter in the respective HANA global.ini configuration file. |
| 104 | + |
| 105 | +For HSR multi-tier, no automatic registration exist for the third site. Manual registration of third site to the current secondary, to keep HSR replication chain, is needed. |
| 106 | + |
| 107 | +## HANA scale-out: Setup HANA multi-target system replication for DR purposes |
| 108 | + |
| 109 | +With SAP HANA HA provider [SAPHanaSrMultiTarget](./sap-hana-high-availability-scale-out-hsr-suse.md#implement-hana-ha-hooks-saphanasrmultitarget-and-suschksrv), a third HANA scale-out site can be added. This third site is commonly used for disaster recovery (DR) in another Azure region. The Pacemaker environment is made aware of a HANA multi-target DR setup. |
| 110 | + |
| 111 | +Failure of the third site 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 process should first place the cluster resources into maintenance mode to prevent any undesired cluster action. |
| 112 | +
|
| 113 | +Example of a multi-target system replication system. For further information, see [SAP documentation](https://help.sap.com/docs/SAP_HANA_PLATFORM/4e9b18c116aa42fc84c7dbfd02111aba/2e6c71ab55f147e19b832565311a8e4e.html). |
| 114 | + |
| 115 | +
|
| 116 | +1. Deploy Azure resources for the third site. Depending on your requirements, a different Azure region is often used for disaster recovery purposes. |
| 117 | + 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: |
| 118 | + - No load balancer deployed for third site and no integration with existing cluster load balancer for the VMs of third site |
| 119 | + - OS packages SAPHanaSR-ScaleOut, SAPHanaSR-ScaleOut-doc and OS package pattern ha_sles aren't installed on third site VMs |
| 120 | + - No majority maker VM for third site, as there's no cluster integration |
| 121 | + - NFS volume /hana/shared for third site exclusive use must be created |
| 122 | + - No integration into the cluster for VMs or HANA resources of the third site |
| 123 | + - No HANA HA hook setup for third site in global.ini |
| 124 | + |
| 125 | + Same HANA SID and HANA installation number must be used for third site. |
| 126 | + |
| 127 | +2. With SAP HANA scale-out on third site installed and running, register the third site with the primary site. |
| 128 | + The example uses SITE-DR as the name for third site. |
| 129 | + ```bash |
| 130 | + # Execute on the third site |
| 131 | + su - hn1adm |
| 132 | + # Make sure HANA is not running on the third site. If it is started, stop HANA |
| 133 | + sapcontrol -nr 03 -function StopSystem |
| 134 | + sapcontrol -nr 03 -function WaitforStopped 600 10 |
| 135 | + # Register the HANA third site to the primary |
| 136 | + hdbnsutil -sr_register --name=SITE-DR --remoteHost=hana-s1-db1 --remoteInstance=03 --replicationMode=async |
| 137 | + ``` |
| 138 | +
|
| 139 | +3. Verify HANA system replication shows both secondary and third site. |
| 140 | + ```bash |
| 141 | + # Verify HANA HSR is in sync, execute on primary |
| 142 | + sudo su - hn1adm -c "python /usr/sap/HN1/HDB03/exe/python_support/systemReplicationStatus.py" |
| 143 | + # Third site, SITE-DR, will show up next to existing replication to SITE2 used by Pacemaker cluster. |
| 144 | + ``` |
| 145 | +
|
| 146 | +4. Check the SAPHanaSR attribute for third site. SITE-DR should show up with status SOK in the sites section. |
| 147 | + ```bash |
| 148 | + # Check SAPHanaSR attribute on any cluster managed host (first or second site) |
| 149 | + sudo SAPHanaSR-showAttr |
| 150 | + # Expected result |
| 151 | + # Global cib-time maintenance prim sec sync_state upd |
| 152 | + # --------------------------------------------------------------------- |
| 153 | + # HN1 Fri Jan 27 10:38:46 2023 false HANA_S1 - SOK ok |
| 154 | + # |
| 155 | + # Sites lpt lss mns srHook srr |
| 156 | + # ------------------------------------------------ |
| 157 | + # SITE-DR SOK |
| 158 | + # HANA_S1 1674815869 4 hana-s1-db1 PRIM P |
| 159 | + # HANA_S2 30 4 hana-s2-db1 SWAIT S |
| 160 | + ``` |
| 161 | + |
| 162 | + 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 is impacted. |
| 163 | +
|
| 164 | +### Auto-registering third site |
| 165 | +
|
| 166 | +During planned or unplanned takeover event between the two Pacemaker cluster sites, HSR to third site will be also interrupted. For Pacemaker setting `AUTOMATED_REGISTER = yes|no` can control registration between Pacemaker controlled sites 1 and 2. The parameter does not control HSR replication to the cluster controlled third site. |
| 167 | +
|
| 168 | +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 a 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. |
| 169 | +
|
| 170 | +For HSR multi-tier, no automatic registration exist for the third site. Manual registration of third site to the current secondary, to keep HSR replication chain, is needed. |
| 171 | +
|
| 172 | +## Next steps |
| 173 | +
|
| 174 | +- [Disaster recovery overview and infrastructure](./disaster-recovery-overview-guide.md) |
| 175 | +- [Disaster recovery for SAP workloads](./disaster-recovery-sap-guide.md) |
| 176 | +- [High-availability architecture and scenarios for SAP NetWeaver](./sap-hana-availability-across-regions.md) |
0 commit comments