| title | Enable availability groups for SQL Server on Linux | Microsoft Docs |
|---|---|
| description | How to use mssql-conf to enable availability groups for SQL Server on Linux. |
| author | MikeRayMSFT |
| ms.author | mikeray |
| manager | jhubbard |
| ms.date | 12/4/2017 |
| ms.topic | article |
| ms.prod | sql-non-specified |
| ms.prod_service | database-engine |
| ms.service | |
| ms.component | linux |
| ms.suite | sql |
| ms.custom | |
| ms.technology | database-engine |
| ms.workload | On Demand |
[!INCLUDEtsql-appliesto-sslinux-only]
Under Linux, you must use mssql-conf to enable the availability groups (AG) feature. Unlike on Windows, you cannot use PowerShell or SQL Server Configuration Manager to enable the feature, and unlike SQL Server 2016 and earlier on Windows, you can enable AGs with or without creating the underlying Pacemaker cluster first. Integration with the cluster, if needed, is not done until later.
Important
The AG feature must be enabled for configuration-only replicas, even on SQL Server Express Edition.
The mssql-server-ha package must already be installed. See Install the HA and SQL Server Agent packages.
There are two ways to enable the availability groups feature: use the mssql-conf utility, or edit the mssql.conf file manually.
At a prompt, issue the following:
sudo /opt/mssql/bin/mssql-conf set hadr.hadrenabled 1You can also modify the mssql.conf file, located under the /var/opt/mssql folder, to add the following lines:
[hadr]
hadr.hadrenabled = 1
After enabling availability groups, as on Windows, you must restart SQL Server. That can be done by the following:
sudo systemctl restart mssql-server