Skip to content

Commit 2a89a45

Browse files
Merge pull request #36964 from AttinderPalSingh/patch-4
Enhance documentation for Pacemaker HA agent v2
2 parents 0b493b9 + d253cf6 commit 2a89a45

1 file changed

Lines changed: 78 additions & 15 deletions

File tree

docs/linux/sql-server-linux-create-availability-group.md

Lines changed: 78 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -615,39 +615,101 @@ After you create an AG in [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.
615615

616616
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.
617617

618-
### Pacemaker HA agent v2 (preview)
618+
> [!NOTE]
619+
> In [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] with Cumulative Update (CU) 3 and later versions, Pacemaker HA agent v2 (Preview) is available for Red Hat Enterprise Linux (RHEL) and Ubuntu through the `mssql-server-ha` package. Non-production deployments can evaluate Pacemaker HA agent v2. The existing Pacemaker HA agent (v1) remains fully supported for production deployments. For more information, see [Pacemaker HA agent v2 (Preview)](#pacemaker-ha-agent-v2-preview).
619620
620-
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 for Red Hat Enterprise Linux (RHEL) and Ubuntu.
621+
### [Red Hat Enterprise Linux (RHEL) and Ubuntu](#tab/ru)
621622

622-
Pacemaker HA agent v2 introduces reliability and performance improvements over the previous agent, including:
623+
#### Pacemaker HA agent v1
623624

624-
- Improved failover performance to reduce both planned and unplanned failover times.
625+
1. Create the AG resource in Pacemaker by using the Pacemaker HA agent (v1): (`ocf:mssql:ag`)
625626

626-
- 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).
627+
```bash
628+
sudo pcs resource create <NameForAGResource> ocf:mssql:ag ag_name=<AGName> meta failure-timeout=30s promotable notify=true
629+
```
627630

628-
- Support for TLS 1.3 for communication between the Pacemaker cluster and SQL Server.
631+
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.
629632

630-
Pacemaker HA agent v2 is currently in preview. The existing Pacemaker HA agent (v1) remains fully supported for production deployments.
633+
1. Create the IP address resource for the AG that you associate with the listener functionality.
631634

632-
### [Red Hat Enterprise Linux (RHEL) and Ubuntu](#tab/ru)
635+
```bash
636+
sudo pcs resource create <NameForIPResource> ocf:heartbeat:IPaddr2 ip=<IPAddress> cidr_netmask=<Netmask>
637+
```
633638

634-
1. Create the AG resource in Pacemaker using the existing Pacemaker HA agent (v1):
639+
In this example, `NameForIPResource` is the unique name for the IP resource, and `IPAddress` is the static IP address you assign to the resource.
640+
641+
1. To ensure that the IP address and the AG resource run on the same node, configure a colocation constraint.
635642

636643
```bash
637-
sudo pcs resource create <NameForAGResource> ocf:mssql:ag ag_name=<AGName> meta failure-timeout=30s promotable notify=true
644+
sudo pcs constraint colocation add <NameForIPResource> with promoted <NameForAGResource>-clone INFINITY
638645
```
639646

640-
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.
647+
In this example, `NameForIPResource` is the name for the IP resource, and `NameForAGResource` is the name for the AG resource.
641648

642-
To use Pacemaker HA agent v2, create the AG resource using the `agv2` resource agent:
649+
1. Create an ordering constraint to ensure that the AG resource is up and running before the IP address. While the colocation constraint implies an ordering constraint, this step enforces it.
643650

644651
```bash
645-
sudo pcs resource create <NameForAGResource> ocf:mssql:agv2 ag_name=<AGName> meta failure-timeout=30s promotable notify=true
652+
sudo pcs constraint order promote <NameForAGResource>-clone then start <NameForIPResource>
653+
```
654+
655+
In this example, `NameForIPResource` is the name for the IP resource, and `NameForAGResource` is the name for the AG resource.
656+
657+
#### Pacemaker HA agent v2 (Preview)
658+
659+
Pacemaker HA agent v2 uses a service‑based architecture. The agent runs as a dedicated system service named `mssql-pcsag`, which is responsible for handling SQL Server–specific high availability operations and communication with Pacemaker.
660+
661+
The `mssql-pcsag` service is managed by using standard system service controls. You can start, stop, restart, and check the status of this service as needed by using the following commands:
662+
663+
```bash
664+
sudo systemctl start mssql-pcsag # Start the Pacemaker HA agent v2 (mssql-pcsag) service
665+
sudo systemctl stop mssql-pcsag # Stop the Pacemaker HA agent v2 (mssql-pcsag) service
666+
sudo systemctl restart mssql-pcsag # Restart the Pacemaker HA agent v2 (mssql-pcsag) service
667+
sudo systemctl status mssql-pcsag # Check the status of the Pacemaker HA agent v2 (mssql-pcsag) service
668+
```
669+
670+
671+
Pacemaker interacts with SQL Server availability groups through the `mssql-pcsag` service. For availability group monitoring and failover to function correctly:
672+
673+
- The Pacemaker cluster must be running.
674+
- The `mssql-pcsag` service must be running.
675+
676+
While Pacemaker and `mssql-pcsag` are deployed as separate components, they operate together at runtime. If either Pacemaker or the `mssql-pcsag` service is stopped, availability group failover operations don't function as expected.
677+
678+
> [!NOTE]
679+
> Restarting the `mssql-pcsag` service doesn't restart SQL Server. Similarly, restarting SQL Server doesn't automatically restart the Pacemaker HA agent. Verify that both services are running during troubleshooting.
680+
681+
Pacemaker HA agent v2 introduces reliability and performance improvements over the previous agent, including:
682+
683+
- Improved failover performance to reduce both planned and unplanned failover times.
684+
685+
- Support for flexible automatic failover policies, including configuration of [failure-condition level](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#failure-condition-level) and [health-check timeout](../database-engine/availability-groups/windows/configure-flexible-automatic-failover-policy.md#HCtimeout).
686+
687+
Example: The following Transact-SQL statement changes the failure-condition level of an existing availability group named AG1 to level 2:
688+
689+
```sql
690+
ALTER AVAILABILITY GROUP AG1 SET (FAILURE_CONDITION_LEVEL = 2);
691+
```
692+
693+
Example: The following Transact-SQL statement changes the health-check timeout threshold of an existing availability group named AG1 to 60,000 milliseconds (60 seconds).
694+
695+
```sql
696+
ALTER AVAILABILITY GROUP AG1 SET (HEALTH_CHECK_TIMEOUT = 60000);
697+
```
698+
Example: After applying the configuration, use the following Transact-SQL statement to verify the configured failure-condition level and health-check timeout for availability groups.
699+
700+
```sql
701+
SELECT failure_condition_level, health_check_timeout FROM sys.availability_groups;
646702
```
647703

648-
New deployments on [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] can evaluate Pacemaker HA agent v2. Existing production deployments should upgrade when appropriate.
704+
- Support for TLS 1.3 for communication between the Pacemaker cluster and SQL Server.
649705

650-
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`:
706+
1. Create the AG resource in Pacemaker by using Pacemaker HA agent v2: (`ocf:mssql:agv2`)
707+
708+
```bash
709+
sudo pcs resource create <NameForAGResource> ocf:mssql:agv2 ag_name=<AGName> meta failure-timeout=30s promotable notify=true
710+
```
711+
712+
If upgrading from Pacemaker HA agent v1 to v2, remove the existing AG resource before creating the `agv2` resource:
651713

652714
```bash
653715
sudo pcs resource delete <NameForAGResource>
@@ -679,6 +741,7 @@ Pacemaker HA agent v2 is currently in preview. The existing Pacemaker HA agent (
679741

680742
In this example, `NameForIPResource` is the name for the IP resource, and `NameForAGResource` is the name for the AG resource.
681743

744+
682745
### [SUSE Linux Enterprise Server (SLES)](#tab/sles)
683746

684747
> [!NOTE]

0 commit comments

Comments
 (0)