You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/linux/sql-server-linux-availability-group-cluster-pacemaker.md
+93-35Lines changed: 93 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,8 +189,26 @@ For information on Pacemaker cluster properties, see [Pacemaker Clusters Propert
189
189
190
190
### Create availability group resource
191
191
192
-
To create the availability group resource, use `pcs resource create` command and set the resource properties. The following command creates a `ocf:mssql:ag` master/subordinate type resource for availability group with name `ag1`. Run the following command on one node.
192
+
After you create an AG in [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], you must create the corresponding resources in Pacemaker when you specify a cluster type of External. An AG needs two resources: the availability group resource, and an IP address resource. Configuring the IP address resource is optional if you aren't using a listener. However, it's recommended when you need listener features.
193
193
194
+
#### Pacemaker HA agent v2 (preview)
195
+
196
+
In [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] with Cumulative Update (CU) 3 and later versions, a new Pacemaker HA agent v2 is available in the `mssql-server-ha` package.
197
+
198
+
Pacemaker HA agent v2 introduces reliability and performance improvements over the previous agent, including:
199
+
200
+
- Improved failover performance to reduce both planned and unplanned failover times.
201
+
202
+
- Support for flexible automatic failover policies, including configuration of [health-check timeout](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#HCtimeout) and [failure-condition level](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#failure-condition-level).
203
+
204
+
- Support for TLS 1.3 for communication between the Pacemaker cluster and SQL Server.
205
+
206
+
Pacemaker HA agent v2 is currently in preview. The existing Pacemaker HA agent (v1) remains fully supported for production deployments.
New deployments on [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] can evaluate Pacemaker HA agent v2. Existing production deployments should upgrade when appropriate.
235
+
236
+
When upgrading to or deploying Pacemaker HA agent v2, create the new AG resource using the `agv2` agent instead of the previous `ag` agent. If you already configured an existing AG resource, remove it and create a new resource using `agv2`:
237
+
238
+
```bash
239
+
sudo pcs resource delete <NameForAGResource>
240
+
```
241
+
242
+
This operation temporarily stops AG synchronization while the resource is being recreated. Deleting and recreating the Pacemaker AG resource doesn't delete the AG. After the resource is recreated, Pacemaker resumes management and AG synchronization automatically.
211
243
212
244
<a id="createIP"></a>
213
245
@@ -764,7 +796,7 @@ The steps to create an availability group on Linux servers for high availability
764
796
Confirm the status of cluster and verify the configuration:
765
797
766
798
```bash
767
-
sudo crm status
799
+
sudo pcs status
768
800
```
769
801
770
802
[!INCLUDE [Considerations for multiple NICs](includes/availability-group-multiple-network-interfaces.md)]
@@ -782,7 +814,7 @@ For more information, see [Pacemaker Clusters from Scratch](https://clusterlabs.
782
814
Because the node level fencing configuration depends heavily on your environment, we disable it for this tutorial (it can be configured at a later time). Run the following script on the primary node:
783
815
784
816
```bash
785
-
sudo crm configure property stonith-enabled=false
817
+
sudo pcs propertyset stonith-enabled=false
786
818
```
787
819
788
820
In this example, disabling fencing is just fortesting purposes. If you plan to use Pacemakerin a production environment, you should plan a fencing implementation depending on your environment and keep it enabled. Contact the operating system vendor for information about fencing agents for any specific distribution.
@@ -794,7 +826,7 @@ The `cluster-recheck-interval` property indicates the polling interval at which
sudo pcs property set cluster-recheck-interval=2min
798
830
```
799
831
800
832
If you already have an availability group resource managed by a Pacemaker cluster, Pacemaker package 1.1.18-11.el7 introduced a behavior change for the `start-failure-is-fatal` cluster setting when its value is `false`. This change affects the failover workflow. If a primary replica experiences an outage, the cluster is expected to fail over to one of the available secondary replicas. Instead, users notice that the cluster keeps trying to start the failed primary replica. If that primary never comes online (because of a permanent outage), the cluster never fails over to another available secondary replica. Because of this change, a previously recommended configuration to set `start-failure-is-fatal` is no longer valid, and the setting needs to be reverted back to its default value of `true`.
@@ -804,13 +836,13 @@ Additionally, the AG resource needs to be updated to include the `failure-timeou
To create the availability group resource, use the `sudo crm configure` command to set the resource properties. The following example creates a primary/replica type resource `ocf:mssql:ag` for an availability group with name `ag1`.
831
-
832
-
```console
833
-
~$ sudo crm
834
-
835
-
configure
836
-
837
-
primitive ag1_cluster \
838
-
ocf:mssql:ag \
839
-
params ag_name="ag1" \
840
-
meta failure-timeout=60s \
841
-
op start timeout=60s \
842
-
op stop timeout=60s \
843
-
op promote timeout=60s \
844
-
op demote timeout=10s \
845
-
op monitor timeout=60s interval=10s \
846
-
op monitor timeout=60s on-fail=demote interval=11s role="Master" \
847
-
op monitor timeout=60s interval=12s role="Slave" \
848
-
op notify timeout=60s
849
-
ms ms-ag1 ag1_cluster \
850
-
meta master-max="1" master-node-max="1" clone-max="3" \
851
-
clone-node-max="1" notify="true"
862
+
After you create an AG in [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], you must create the corresponding resources in Pacemaker when you specify a cluster type of External. An AG needs two resources: the availability group resource, and an IP address resource. Configuring the IP address resource is optional if you aren't using a listener. However, it's recommended when you need listener features.
852
863
853
-
commit
854
-
```
864
+
The AG resource you create is a type of resource called a *clone*. The AG resource has copies on each node, and one controlling resource called the *master*. The *master* is associated with the server hosting the primary replica. The other resources host secondary replicas (regular or configuration-only) and can be promoted to *master* in a failover.
865
+
866
+
#### Pacemaker HA agent v2 (preview)
867
+
868
+
In [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] with Cumulative Update (CU) 3 and later versions, a new Pacemaker HA agent v2 (`mssql-server-ha`) is available.
855
869
870
+
Pacemaker HA agent v2 introduces reliability and performance improvements over the previous agent, including:
871
+
872
+
- Improved failover performance to reduce both planned and unplanned failover times.
873
+
874
+
- Support for flexible automatic failover policies, including configuration of [health-check timeout](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#HCtimeout) and [failure-condition level](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#failure-condition-level).
875
+
876
+
- Support for TLS 1.3 for communication between the Pacemaker cluster and SQL Server.
877
+
878
+
Pacemaker HA agent v2 is currently in preview. The existing Pacemaker HA agent (v1) remains fully supported for production deployments.
879
+
880
+
1. Create the AG resource in Pacemaker using the existing Pacemaker HA agent (v1):
In this example, `NameForAGResource` is the unique name you give to this cluster resource for the AG, and `AGName` is the name of the AG that you created.
887
+
888
+
To use Pacemaker HA agent v2, create the AG resource using the `agv2` resource agent:
New deployments on [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] can evaluate Pacemaker HA agent v2. Existing production deployments should upgrade when appropriate.
895
+
896
+
When upgrading to or deploying Pacemaker HA agent v2, create the new AG resource using the `agv2` agent instead of the previous `ag` agent. If you already configured an existing AG resource, remove it and create a new resource using `agv2`:
897
+
898
+
```bash
899
+
sudo pcs resource delete <NameForAGResource>
900
+
```
901
+
902
+
This operation temporarily stops AG synchronization while the resource is being recreated. Deleting and recreating the Pacemaker AG resource doesn't delete the AG. After the resource is recreated, Pacemaker resumes management and AG synchronization automatically.
To create the virtual IP address resource, run the following command on one node. Use an available static IP address from the network. Before you run the script, replace the values between `< ... >` with a valid IP address.
There's no virtual server name equivalent in Pacemaker. To use a connection string that points to a string server name and not use the IP address, register the IP resource address and desired virtual server name in DNS. For DR configurations, register the desired virtual server name and IP address with the DNS servers on both primary and DR site.
@@ -874,9 +920,14 @@ Almost every decision in a Pacemaker cluster, like choosing where a resource sho
874
920
Use constraints to configure the decisions of the cluster. Constraints have a score. If a constraint has a score lower than INFINITY, it's only a recommendation. A score of INFINITY means it's mandatory.
875
921
876
922
To ensure that primary replica and the virtual ip resource are on the same host, define a colocation constraint with a score of INFINITY. To add the colocation constraint, run the following command on one node.
sudo pcs constraint colocation add virtualip with master AGResource INFINITY
927
+
```
928
+
#### Ubuntu 22.04 and later versions
929
+
```bash
930
+
sudo pcs constraint colocation add virtualip with promoted <NameForAGResource> INFINITY
880
931
```
881
932
882
933
### Add ordering constraint
@@ -899,9 +950,16 @@ To prevent the IP address from temporarily pointing to the node with the pre-fai
899
950
900
951
To add an ordering constraint, run the following command on one node:
901
952
953
+
#### Ubuntu 20.04
954
+
902
955
```bash
903
956
sudo crm configure order ag-before-listener Mandatory: ms-ag1:promote virtualip-group:start
904
957
```
958
+
#### Ubuntu 22.04 and later versions
959
+
960
+
```bash
961
+
sudo pcs constraint order promote <NameForAGResource>then start virtualip kind=Mandatory
962
+
```
905
963
906
964
After you configure the cluster and add the availability group as a cluster resource, you can't use Transact-SQL to fail over the availability group resources. [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] cluster resources on Linux aren't coupled as tightly with the operating system as they are on a Windows Server Failover Cluster (WSFC). The [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] service isn't aware of the presence of the cluster. All orchestration is done through the cluster management tools.
0 commit comments