Skip to content

Commit 7c2abb1

Browse files
authored
Merge pull request #30310 from rwestMSFT/rw-0405-refresh-linux-2022
[WIP] Old Linux article refresh (articles older than 2023)
2 parents fbfa635 + 955dc24 commit 7c2abb1

58 files changed

Lines changed: 896 additions & 912 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/linux/includes/change-docker-password.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.topic: include
88
ms.custom:
99
- linux-related-content
1010
---
11-
The **SA** account is a system administrator on the SQL Server instance that's created during setup. After you create your SQL Server container, the `MSSQL_SA_PASSWORD` environment variable you specified is discoverable by running `echo $MSSQL_SA_PASSWORD` in the container. For security purposes, change your SA password:
11+
The `SA` account is a system administrator on the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance that's created during setup. After you create your [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] container, the `MSSQL_SA_PASSWORD` environment variable you specified is discoverable by running `echo $MSSQL_SA_PASSWORD` in the container. For security purposes, change your SA password:
1212

1313
1. Choose a strong password to use for the SA user.
1414

docs/linux/includes/cluster-availability-group-create-post.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.custom:
1010
---
1111
## Add a database to the availability group
1212

13-
Ensure that the database you add to the availability group is in the full recovery model and has a valid log backup. If this is a test database or a newly created database, take a database backup. On the primary SQL Server, run the following Transact-SQL script to create and back up a database called `db1`:
13+
Ensure that the database you add to the availability group is in the full recovery model and has a valid log backup. If this is a test database or a newly created database, take a database backup. On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)], run the following Transact-SQL script to create and back up a database called `db1`:
1414

1515
```sql
1616
CREATE DATABASE [db1];
@@ -19,15 +19,15 @@ BACKUP DATABASE [db1]
1919
TO DISK = N'/var/opt/mssql/data/db1.bak';
2020
```
2121

22-
On the primary SQL Server replica, run the following Transact-SQL script to add a database called `db1` to an availability group called `ag1`:
22+
On the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica, run the following Transact-SQL script to add a database called `db1` to an availability group called `ag1`:
2323

2424
```sql
2525
ALTER AVAILABILITY GROUP [ag1] ADD DATABASE [db1];
2626
```
2727

2828
### Verify that the database is created on the secondary servers
2929

30-
On each secondary SQL Server replica, run the following query to see if the `db1` database was created and is synchronized:
30+
On each secondary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica, run the following query to see if the `db1` database was created and is synchronized:
3131

3232
```sql
3333
SELECT * FROM sys.databases WHERE name = 'db1';
Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: rwestMSFT
33
ms.author: randolphwest
4-
ms.date: 09/15/2022
4+
ms.date: 07/15/2024
55
ms.service: sql
66
ms.subservice: linux
77
ms.topic: include
@@ -13,17 +13,15 @@ ms.custom:
1313
Before you create the availability group, you need to:
1414

1515
- Set your environment so that all the servers that will host availability replicas can communicate.
16-
- Install SQL Server.
16+
- Install [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)].
1717

18-
> [!NOTE]
19-
>
20-
> 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. For distribution-specific instructions to create the cluster and add the availability group as a cluster resource, see the links under "Next steps."
18+
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.
2119

2220
1. Update the computer name for each host.
2321

24-
Each SQL Server name must be:
22+
Each [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance name must be:
2523

26-
- 15 characters or less.
24+
- 15 characters or fewer.
2725
- Unique within the network.
2826

2927
To set the computer name, edit `/etc/hostname`. The following script lets you edit `/etc/hostname` with **vi**:
@@ -32,11 +30,10 @@ Before you create the availability group, you need to:
3230
sudo vi /etc/hostname
3331
```
3432

35-
2. Configure the hosts file.
33+
1. Configure the hosts file.
3634

37-
> [!NOTE]
38-
>
39-
> 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.
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.
4037
4138
The hosts file on every server contains the IP addresses and names of all servers that will participate in the availability group.
4239

@@ -54,7 +51,7 @@ Before you create the availability group, you need to:
5451

5552
The following example shows `/etc/hosts` on `node1` with additions for `node1`, `node2`, and `node3`. In this sample, `node1` refers to the server that hosts the primary replica, and `node2` and `node3` refer to servers that host the secondary replicas.
5653

57-
```
54+
```output
5855
127.0.0.1    localhost localhost4 localhost4.localdomain4
5956
::1       localhost localhost6 localhost6.localdomain6
6057
10.128.18.12 node1
@@ -64,56 +61,56 @@ Before you create the availability group, you need to:
6461

6562
### Install SQL Server
6663

67-
Install SQL Server. The following links point to SQL Server installation instructions for various distributions:
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:
6865

69-
- [Red Hat Enterprise Linux](../quickstart-install-connect-red-hat.md)
70-
- [SUSE Linux Enterprise Server](../quickstart-install-connect-suse.md)
71-
- [Ubuntu](../quickstart-install-connect-ubuntu.md)
66+
- [Quickstart: Install SQL Server and create a database on Red Hat](../quickstart-install-connect-red-hat.md)
67+
- [Quickstart: Install SQL Server and create a database on SUSE Linux Enterprise Server](../quickstart-install-connect-suse.md)
68+
- [Quickstart: Install SQL Server and create a database on Ubuntu](../quickstart-install-connect-ubuntu.md)
7269

7370
## Enable Always On availability groups
7471

75-
Enable Always On availability groups for each node that hosts a SQL Server instance, and then restart `mssql-server`. Run the following script:
72+
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:
7673

7774
```bash
7875
sudo /opt/mssql/bin/mssql-conf set hadr.hadrenabled 1
7976
sudo systemctl restart mssql-server
8077
```
8178

82-
## Enable an AlwaysOn_health event session
79+
## Enable an AlwaysOn_health Event session
8380

84-
You can optionally enable extended events (XE) to help with root-cause diagnosis when you troubleshoot an availability group. Run the following command on each instance of SQL Server:
81+
You can optionally enable Extended Events (XE) to help with root-cause diagnosis when you troubleshoot an availability group. Run the following command on each instance of [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)]:
8582

8683
```SQL
87-
ALTER EVENT SESSION AlwaysOn_health ON SERVER WITH (STARTUP_STATE=ON);
84+
ALTER EVENT SESSION AlwaysOn_health ON SERVER WITH (STARTUP_STATE = ON);
8885
GO
8986
```
9087

91-
For more information about this XE session, see [Configure extended events for Always On availability groups](../../database-engine/availability-groups/windows/always-on-extended-events.md).
88+
For more information about this XE session, see [Configure Extended Events for availability groups](../../database-engine/availability-groups/windows/always-on-extended-events.md).
9289

9390
## Create a certificate
9491

95-
The SQL Server service on Linux uses certificates to authenticate communication between the mirroring endpoints.
92+
The [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service on Linux uses certificates to authenticate communication between the mirroring endpoints.
9693

97-
The following Transact-SQL script creates a master key and a certificate. It then backs up the certificate and secures the file with a private key. Update the script with strong passwords. Connect to the primary SQL Server instance. To create the certificate, run the following Transact-SQL script:
94+
The following Transact-SQL script creates a master key and a certificate. It then backs up the certificate and secures the file with a private key. Update the script with strong passwords. Connect to the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instance. To create the certificate, run the following Transact-SQL script:
9895

9996
```SQL
100-
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '**<Master_Key_Password>**';
97+
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<Master_Key_Password>';
10198
CREATE CERTIFICATE dbm_certificate WITH SUBJECT = 'dbm';
10299
BACKUP CERTIFICATE dbm_certificate
103-
TO FILE = '/var/opt/mssql/data/dbm_certificate.cer'
104-
WITH PRIVATE KEY (
105-
FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
106-
ENCRYPTION BY PASSWORD = '**<Private_Key_Password>**'
107-
);
100+
TO FILE = '/var/opt/mssql/data/dbm_certificate.cer'
101+
WITH PRIVATE KEY (
102+
FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
103+
ENCRYPTION BY PASSWORD = '<Private_Key_Password>'
104+
);
108105
```
109106

110-
At this point, your primary SQL Server 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.
107+
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.
111108

112-
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 SQL Server instances that will host the replicas.
109+
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.
113110

114111
```bash
115112
cd /var/opt/mssql/data
116-
scp dbm_certificate.* root@**<node2>**:/var/opt/mssql/data/
113+
scp dbm_certificate.* root@<node2>:/var/opt/mssql/data/
117114
```
118115

119116
On each target server, give permission to the mssql user to access the certificate.
@@ -125,58 +122,57 @@ chown mssql:mssql dbm_certificate.*
125122

126123
## Create the certificate on secondary servers
127124

128-
The following Transact-SQL script creates a master key and a certificate from the backup that you created on the primary SQL Server replica. Update the script with strong passwords. The decryption password is the same password that you used to create the .pvk file in a previous step. To create the certificate, run the following script on all secondary servers:
125+
The following Transact-SQL script creates a master key and a certificate from the backup that you created on the primary [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] replica. Update the script with strong passwords. The decryption password is the same password that you used to create the .pvk file in a previous step. To create the certificate, run the following script on all secondary servers:
129126

130127
```SQL
131-
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '**<Master_Key_Password>**';
128+
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<Master_Key_Password>';
132129
CREATE CERTIFICATE dbm_certificate
133130
FROM FILE = '/var/opt/mssql/data/dbm_certificate.cer'
134131
WITH PRIVATE KEY (
135-
FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
136-
DECRYPTION BY PASSWORD = '**<Private_Key_Password>**'
137-
);
132+
FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
133+
DECRYPTION BY PASSWORD = '<Private_Key_Password>'
134+
);
138135
```
139136

140137
## Create the database mirroring endpoints on all replicas
141138

142-
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.
139+
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.
143140

144-
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`.
141+
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`.
145142

146-
Update the following Transact-SQL script for your environment on all SQL Server instances:
143+
Update the following Transact-SQL script for your environment on all [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] instances:
147144

148145
```SQL
149146
CREATE ENDPOINT [Hadr_endpoint]
150-
AS TCP (LISTENER_PORT = **<5022>**)
147+
AS TCP (LISTENER_PORT = 5022)
151148
FOR DATABASE_MIRRORING (
152149
ROLE = ALL,
153150
AUTHENTICATION = CERTIFICATE dbm_certificate,
154151
ENCRYPTION = REQUIRED ALGORITHM AES
155-
);
152+
);
156153

157154
ALTER ENDPOINT [Hadr_endpoint] STATE = STARTED;
158155
```
159156

160-
> [!NOTE]
157+
> [!NOTE]
161158
>
162-
> If you use SQL Server Express Edition on one node to host a configuration-only replica, the only valid value for `ROLE` is `WITNESS`. Run the following script on SQL Server Express Edition:
159+
> 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:
163160
164161
```SQL
165162
CREATE ENDPOINT [Hadr_endpoint]
166-
AS TCP (LISTENER_PORT = **<5022>**)
163+
AS TCP (LISTENER_PORT = 5022)
167164
FOR DATABASE_MIRRORING (
168165
ROLE = WITNESS,
169166
AUTHENTICATION = CERTIFICATE dbm_certificate,
170167
ENCRYPTION = REQUIRED ALGORITHM AES
171-
);
168+
);
172169

173170
ALTER ENDPOINT [Hadr_endpoint] STATE = STARTED;
174171
```
175172

176173
The TCP port on the firewall must be open for the listener port.
177174

178-
> [!IMPORTANT]
179-
>
180-
> For the SQL Server 2017 release, the only authentication method supported for the database mirroring endpoint is `CERTIFICATE`. The `WINDOWS` option will be enabled in a future release.
175+
> [!IMPORTANT]
176+
> For [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)], the only authentication method supported for the database mirroring endpoint is `CERTIFICATE`. The `WINDOWS` option isn't available.
181177
182178
For more information, see [The database mirroring endpoint (SQL Server)](../../database-engine/database-mirroring/the-database-mirroring-endpoint-sql-server.md).

docs/linux/includes/cluster-pacemaker-concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The following tables describe the outcome of an outage for primary or secondary
7070
| `REQUIRED_COPIES_TO_COMMIT = 0` | User has to issue a manual `FAILOVER`.<br />Might have data loss.<br />New primary is R/W | Primary is R/W, running exposed to data loss. |
7171
| `REQUIRED_COPIES_TO_COMMIT = 1` <sup>1</sup> | Cluster automatically issues `FAILOVER`<br />No data loss.<br />New primary rejects all connections until former primary recovers and joins availability group as secondary. | Primary rejects all connections until secondary recovers. |
7272

73-
<sup>1</sup> SQL Server resource agent for Pacemaker default behavior.
73+
<sup>1</sup> [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] resource agent for Pacemaker default behavior.
7474

7575
### Availability group - three sync replicas
7676

@@ -79,4 +79,4 @@ The following tables describe the outcome of an outage for primary or secondary
7979
| `REQUIRED_COPIES_TO_COMMIT = 0` | User has to issue a manual `FAILOVER`.<br />Might have data loss.<br />New primary is R/W | Primary is R/W |
8080
| `REQUIRED_COPIES_TO_COMMIT = 1` <sup>1</sup> | Cluster automatically issues `FAILOVER`.<br />No data loss.<br />New primary is RW | Primary is R/W |
8181

82-
<sup>1</sup> SQL Server resource agent for Pacemaker default behavior.
82+
<sup>1</sup> [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] resource agent for Pacemaker default behavior.

docs/linux/includes/cluster-pacemaker-configure-rhel.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: rwestMSFT
33
ms.author: randolphwest
4-
ms.date: 09/15/2022
4+
ms.date: 07/15/2024
55
ms.service: sql
66
ms.subservice: linux
77
ms.topic: include
@@ -15,10 +15,10 @@ ms.custom:
1515
sudo firewall-cmd --reload
1616
```
1717

18-
> If the firewall doesn't have a built-in high-availability configuration, open the following ports for Pacemaker.
19-
>
20-
> * TCP: Ports 2224, 3121, 21064
21-
> * UDP: Port 5405
18+
If the firewall doesn't have a built-in high-availability configuration, open the following ports for Pacemaker.
19+
20+
- TCP: Ports 2224, 3121, 21064
21+
- UDP: Port 5405
2222

2323
1. Install Pacemaker packages on all nodes.
2424

@@ -51,9 +51,9 @@ ms.custom:
5151
sudo pcs cluster enable --all
5252
```
5353

54-
**RHEL8**
54+
**RHEL 8**
5555

56-
For RHEL 8, you will need to authenticate the nodes separately. Manually enter in the Username and Password for hacluster when prompted.
56+
For RHEL 8, you need to authenticate the nodes separately. Manually enter in the Username and Password for hacluster when prompted.
5757

5858
```bash
5959
sudo pcs host auth <node1> <node2> <node3>
@@ -65,7 +65,7 @@ ms.custom:
6565
> [!NOTE]
6666
> If you previously configured a cluster on the same nodes, you need to use `--force` option when running `pcs cluster setup`. This option is equivalent to running `pcs cluster destroy`. To re-enable Pacemaker, run `sudo systemctl enable pacemaker`.
6767
68-
1. Install SQL Server resource agent for SQL Server. Run the following commands on all nodes.
68+
1. Install [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] resource agent for [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)]. Run the following commands on all nodes.
6969

7070
```bash
7171
sudo yum install mssql-server-ha

0 commit comments

Comments
 (0)