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
On Linux, you must create an availability group before you add it as a cluster resource to be managed by the cluster. This document provides an example that creates the availability group.
18
+
On Linux, you must create an availability group before you add it as a cluster resource for the cluster to manage. This article provides an example that creates the availability group.
19
19
20
20
1. Update the computer name for each host.
21
21
@@ -24,7 +24,7 @@ On Linux, you must create an availability group before you add it as a cluster r
24
24
- 15 characters or fewer.
25
25
- Unique within the network.
26
26
27
-
To set the computer name, edit `/etc/hostname`. The following script lets you edit `/etc/hostname` with **vi**:
27
+
To set the computer name, edit `/etc/hostname`. The following example shows how to edit `/etc/hostname` with **vi**:
28
28
29
29
```bash
30
30
sudo vi /etc/hostname
@@ -33,17 +33,17 @@ On Linux, you must create an availability group before you add it as a cluster r
33
33
1. Configure the hosts file.
34
34
35
35
> [!NOTE]
36
-
> If hostnames are registered with their IP address in the DNS server, you don't need to do the following steps. Validate that all the nodes intended to be part of the availability group configuration can communicate with each other. (A ping to the hostname should reply with the corresponding IP address.) Also, make sure that the `/etc/hosts` file doesn't contain a record that maps the localhost IP address 127.0.0.1 with the hostname of the node.
36
+
> If the DNS server registers hostnames with their IP addresses, you don't need to complete the following steps. Validate that all the nodes intended to be part of the availability group configuration can communicate with each other. (A ping to the hostname should reply with the corresponding IP address.) Also, make sure that the `/etc/hosts` file doesn't contain a record that maps the localhost IP address 127.0.0.1 with the hostname of the node.
37
37
38
-
The hosts file on every server contains the IP addresses and names of all servers that will participate in the availability group.
38
+
The hosts file on every server contains the IP addresses and names of all servers that participate in the availability group.
39
39
40
40
The following command returns the IP address of the current server:
41
41
42
42
```bash
43
43
sudo ip addr show
44
44
```
45
45
46
-
Update `/etc/hosts`. The following script lets you edit `/etc/hosts` with **vi**:
46
+
Update `/etc/hosts`. The following example shows how to edit `/etc/hosts` with **vi**:
47
47
48
48
```bash
49
49
sudo vi /etc/hosts
@@ -63,10 +63,13 @@ On Linux, you must create an availability group before you add it as a cluster r
63
63
64
64
Install [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)]. The following links point to [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] installation instructions for various distributions:
65
65
66
-
-[Quickstart: Install SQL Server and create a database on Red Hat](../quickstart-install-connect-red-hat.md)
66
+
-[Quickstart: Install SQL Server and create a database on Red Hat Enterprise Linux](../quickstart-install-connect-red-hat.md)
67
67
-[Quickstart: Install SQL Server and create a database on SUSE Linux Enterprise Server](../quickstart-install-connect-suse.md)
68
68
-[Quickstart: Install SQL Server and create a database on Ubuntu](../quickstart-install-connect-ubuntu.md)
69
69
70
+
> [!NOTE]
71
+
> Starting in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)], SUSE Linux Enterprise Server (SLES) isn't supported.
72
+
70
73
## Enable Always On availability groups
71
74
72
75
Enable Always On availability groups for each node that hosts a [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance, and then restart `mssql-server`. Run the following script:
@@ -82,10 +85,7 @@ You can optionally enable Extended Events (XE) to help with root-cause diagnosis
82
85
83
86
```sql
84
87
ALTER EVENT SESSION AlwaysOn_health ON SERVER
85
-
WITH
86
-
(
87
-
STARTUP_STATE =ON
88
-
);
88
+
WITH (STARTUP_STATE =ON);
89
89
GO
90
90
```
91
91
@@ -101,19 +101,19 @@ The following Transact-SQL script creates a master key and a certificate. It the
101
101
CREATE MASTER KEY ENCRYPTION BY PASSWORD ='<master-key-password>';
102
102
103
103
CREATE CERTIFICATE dbm_certificate
104
-
WITH SUBJECT ='dbm';
104
+
WITH SUBJECT ='dbm';
105
105
106
106
BACKUP CERTIFICATE dbm_certificate
107
-
TO FILE ='/var/opt/mssql/data/dbm_certificate.cer'
108
-
WITH PRIVATE KEY (
109
-
FILE ='/var/opt/mssql/data/dbm_certificate.pvk',
110
-
ENCRYPTION BY PASSWORD ='<private-key-password>'
107
+
TO FILE ='/var/opt/mssql/data/dbm_certificate.cer'
108
+
WITH PRIVATE KEY (
109
+
FILE ='/var/opt/mssql/data/dbm_certificate.pvk',
110
+
ENCRYPTION BY PASSWORD ='<private-key-password>'
111
111
);
112
112
```
113
113
114
-
At this point, your primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica has a certificate at `/var/opt/mssql/data/dbm_certificate.cer` and a private key at `var/opt/mssql/data/dbm_certificate.pvk`. Copy these two files to the same location on all servers that will host availability replicas. Use the mssql user, or give permission to the mssql user to access these files.
114
+
At this point, your primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica has a certificate at `/var/opt/mssql/data/dbm_certificate.cer` and a private key at `/var/opt/mssql/data/dbm_certificate.pvk`. Copy these two files to the same location on all servers that host availability replicas. Use the mssql user, or give permission to the mssql user to access these files.
115
115
116
-
For example, on the source server, the following command copies the files to the target machine. Replace the `<node2>` values with the names of the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instances that will host the replicas.
116
+
For example, on the source server, the following command copies the files to the target machine. Replace the `<node2>` values with the names of the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instances that host the replicas.
117
117
118
118
```bash
119
119
cd /var/opt/mssql/data
@@ -135,10 +135,10 @@ The following Transact-SQL script creates a master key and a certificate from th
135
135
CREATE MASTER KEY ENCRYPTION BY PASSWORD ='<master-key-password>';
136
136
137
137
CREATE CERTIFICATE dbm_certificate
138
-
FROM FILE ='/var/opt/mssql/data/dbm_certificate.cer'
139
-
WITH PRIVATE KEY (
140
-
FILE ='/var/opt/mssql/data/dbm_certificate.pvk',
141
-
DECRYPTION BY PASSWORD ='<private-key-password>'
138
+
FROM FILE ='/var/opt/mssql/data/dbm_certificate.cer'
139
+
WITH PRIVATE KEY (
140
+
FILE ='/var/opt/mssql/data/dbm_certificate.pvk',
141
+
DECRYPTION BY PASSWORD ='<private-key-password>'
142
142
);
143
143
```
144
144
@@ -148,48 +148,42 @@ In the previous example, replace `<private-key-password>` with the same password
148
148
149
149
Database mirroring endpoints use the Transmission Control Protocol (TCP) to send and receive messages between the server instances that participate in database mirroring sessions, or host availability replicas. The database mirroring endpoint listens on a unique TCP port number.
150
150
151
-
The following Transact-SQL script creates a listening endpoint named `Hadr_endpoint` for the availability group. It starts the endpoint and gives connection permission to the certificate that you created. Before you run the script, replace the values between `< ... >`. Optionally you can include an IP address `LISTENER_IP = (0.0.0.0)`. The listener IP address must be an IPv4 address. You can also use `0.0.0.0`.
151
+
The following Transact-SQL script creates a listening endpoint named `Hadr_endpoint` for the availability group. It starts the endpoint and gives connection permission to the certificate that you created. Before you run the script, replace the values between `< ... >`. Optionally, you can include an IP address `LISTENER_IP = (0.0.0.0)`. The listener IP address must be an IPv4 address. You can also use `0.0.0.0`.
152
152
153
153
Update the following Transact-SQL script for your environment on all [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instances:
154
154
155
155
```sql
156
156
CREATE ENDPOINT [Hadr_endpoint]
157
-
AS TCP
158
-
(
159
-
LISTENER_PORT =5022
160
-
)
161
-
FOR DATABASE_MIRRORING
157
+
AS TCP (LISTENER_PORT =5022)
158
+
FOR DATABASE_MIRRORING
162
159
(
163
-
ROLE = ALL,
164
-
AUTHENTICATION = CERTIFICATE dbm_certificate,
165
-
ENCRYPTION = REQUIRED ALGORITHM AES
160
+
ROLE = ALL,
161
+
AUTHENTICATION = CERTIFICATE dbm_certificate,
162
+
ENCRYPTION = REQUIRED ALGORITHM AES
166
163
);
167
164
168
165
ALTER ENDPOINT [Hadr_endpoint]
169
-
STATE = STARTED;
166
+
STATE = STARTED;
170
167
```
171
168
172
169
> [!NOTE]
173
170
> If you use [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Express edition on one node to host a configuration-only replica, the only valid value for `ROLE` is `WITNESS`. Run the following script on [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] Express edition:
174
171
175
172
```sql
176
173
CREATE ENDPOINT [Hadr_endpoint]
177
-
AS TCP
178
-
(
179
-
LISTENER_PORT =5022
180
-
)
181
-
FOR DATABASE_MIRRORING
174
+
AS TCP (LISTENER_PORT =5022)
175
+
FOR DATABASE_MIRRORING
182
176
(
183
-
ROLE = WITNESS,
184
-
AUTHENTICATION = CERTIFICATE dbm_certificate,
185
-
ENCRYPTION = REQUIRED ALGORITHM AES
177
+
ROLE = WITNESS,
178
+
AUTHENTICATION = CERTIFICATE dbm_certificate,
179
+
ENCRYPTION = REQUIRED ALGORITHM AES
186
180
);
187
181
188
182
ALTER ENDPOINT [Hadr_endpoint]
189
-
STATE = STARTED;
183
+
STATE = STARTED;
190
184
```
191
185
192
-
The TCP port on the firewall must be open for the listener port.
186
+
You must open the TCP port on the firewall for the listener port.
193
187
194
188
> [!IMPORTANT]
195
189
> The only authentication method supported for the database mirroring endpoint is `CERTIFICATE`. The `WINDOWS` option isn't available.
0 commit comments