Skip to content

Commit e1a67db

Browse files
Merge pull request #36946 from MicrosoftDocs/main
Auto Publish – main to live - 2026-03-24 22:30 UTC
2 parents 2b83083 + 619d641 commit e1a67db

1 file changed

Lines changed: 93 additions & 35 deletions

File tree

docs/linux/sql-server-linux-availability-group-cluster-pacemaker.md

Lines changed: 93 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,26 @@ For information on Pacemaker cluster properties, see [Pacemaker Clusters Propert
189189
190190
### Create availability group resource
191191
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.
193193
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.
207+
208+
[!INCLUDE [ss-linux-cluster-required-synchronized-secondaries-default](includes/cluster-required-synchronized-secondaries-default.md)]
209+
210+
Create the AG resource in Pacemaker using the existing Pacemaker HA agent (v1):
211+
194212
#### RHEL 7
195213
196214
Use the following `create` command:
@@ -207,7 +225,21 @@ Use the following `create` command:
207225
sudo pcs resource create ag_cluster ocf:mssql:ag ag_name=ag1 meta failure-timeout=60s promotable notify=true
208226
```
209227
210-
[!INCLUDE [ss-linux-cluster-required-synchronized-secondaries-default](includes/cluster-required-synchronized-secondaries-default.md)]
228+
To use Pacemaker HA agent v2, create the AG resource using the `agv2` resource agent:
229+
230+
```bash
231+
sudo pcs resource create <NameForAGResource> ocf:mssql:agv2 ag_name=<AGName> meta failure-timeout=30s promotable notify=true
232+
```
233+
234+
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.
211243
212244
<a id="createIP"></a>
213245
@@ -764,7 +796,7 @@ The steps to create an availability group on Linux servers for high availability
764796
Confirm the status of cluster and verify the configuration:
765797
766798
```bash
767-
sudo crm status
799+
sudo pcs status
768800
```
769801
770802
[!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.
782814
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:
783815
784816
```bash
785-
sudo crm configure property stonith-enabled=false
817+
sudo pcs property set stonith-enabled=false
786818
```
787819
788820
In this example, disabling fencing is just for testing purposes. If you plan to use Pacemaker in 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
794826
To update the property value to `2 minutes` run:
795827
796828
```bash
797-
sudo crm configure property cluster-recheck-interval=2min
829+
sudo pcs property set cluster-recheck-interval=2min
798830
```
799831
800832
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
804836
To update the property value to `true` run:
805837
806838
```bash
807-
sudo crm configure property start-failure-is-fatal=true
839+
sudo pcs property set start-failure-is-fatal=true
808840
```
809841
810842
Update your existing AG resource property `failure-timeout` to `60s` run (replace `ag1` with the name of your availability group resource):
811843
812844
```bash
813-
sudo crm configure meta failure-timeout=60s
845+
sudo pcs resource meta ag_cluster failure-timeout=60s
814846
```
815847
816848
### Install SQL Server resource agent for integration with Pacemaker
@@ -827,42 +859,56 @@ sudo apt-get install mssql-server-ha
827859
828860
### Create availability group resource
829861
830-
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.
852863
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.
855869
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):
881+
882+
```bash
883+
sudo pcs resource create <NameForAGResource> ocf:mssql:ag ag_name=<AGName> meta failure-timeout=30s promotable notify=true
884+
```
885+
886+
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:
889+
890+
```bash
891+
sudo pcs resource create <NameForAGResource> ocf:mssql:agv2 ag_name=<AGName> meta failure-timeout=30s promotable notify=true
892+
```
893+
894+
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.
903+
856904
[!INCLUDE [required-synchronized-secondaries-default](includes/cluster-required-synchronized-secondaries-default.md)]
857905
858906
### Create virtual IP resource
859907
860908
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.
861909
862910
```bash
863-
sudo crm configure primitive virtualip \
864-
ocf:heartbeat:IPaddr2 \
865-
params ip=10.128.16.240
911+
sudo pcs resource create virtualip ocf:heartbeat:IPaddr2 ip=10.128.16.240
866912
```
867913
868914
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
874920
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.
875921
876922
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.
923+
#### Ubuntu 20.04
877924
878925
```bash
879-
sudo crm configure colocation ag-with-listener INFINITY: virtualip-group ms-ag1:Master
926+
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
880931
```
881932
882933
### Add ordering constraint
@@ -899,9 +950,16 @@ To prevent the IP address from temporarily pointing to the node with the pre-fai
899950
900951
To add an ordering constraint, run the following command on one node:
901952
953+
#### Ubuntu 20.04
954+
902955
```bash
903956
sudo crm configure order ag-before-listener Mandatory: ms-ag1:promote virtualip-group:start
904957
```
958+
#### Ubuntu 22.04 and later versions
959+
960+
```bash
961+
sudo pcs constraint order promote <NameForAGResource> then start virtualip kind=Mandatory
962+
```
905963
906964
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.
907965

0 commit comments

Comments
 (0)