Skip to content

Commit 5385014

Browse files
authored
Merge pull request #35927 from rwestMSFT/rw-1124-linux-msdtc
Refresh Linux MSDTC article
2 parents 145f243 + 71f8212 commit 5385014

File tree

1 file changed

+43
-32
lines changed

1 file changed

+43
-32
lines changed

docs/linux/sql-server-linux-configure-msdtc.md

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: How to Configure MSDTC on Linux
33
description: In this article, learn how to configure the Microsoft Distributed Transaction Coordinator (MSDTC) on Linux.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: 07/03/2025
6+
ms.date: 11/24/2025
77
ms.service: sql
88
ms.subservice: linux
99
ms.topic: how-to
@@ -20,7 +20,9 @@ MSDTC on Linux is supported on [!INCLUDE [sssql17-md](../includes/sssql17-md.md)
2020

2121
## Overview
2222

23-
Distributed transactions are enabled on SQL Server on Linux by introducing MSDTC and remote procedure call (RPC) endpoint mapper functionality within SQL Server. By default, an RPC endpoint-mapping process listens on port 135 for incoming RPC requests and provides registered components information to remote requests. Remote requests can use the information returned by endpoint mapper to communicate with registered RPC components, such as MSDTC services. A process requires super user privileges to bind to well-known ports (port numbers less than 1024) on Linux. To avoid starting SQL Server with root privileges for the RPC endpoint mapper process, system administrators must use iptables to create Network Address Translation to route traffic on port 135 to SQL Server's RPC endpoint-mapping process.
23+
You enable distributed transactions on [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux by introducing MSDTC and remote procedure call (RPC) endpoint mapper functionality within [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)]. By default, an RPC endpoint-mapping process listens on port 135 for incoming RPC requests and provides registered components information to remote requests. Remote requests can use the information returned by endpoint mapper to communicate with registered RPC components, such as MSDTC services.
24+
25+
A process requires super user privileges to bind to well-known ports (port numbers less than 1024) on Linux. To avoid starting [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] with root privileges for the RPC endpoint mapper process, system administrators must use **iptables** to create Network Address Translation to route traffic on port 135 to the [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] instance's RPC endpoint-mapping process.
2426

2527
MSDTC uses two configuration parameters for the **mssql-conf** utility:
2628

@@ -37,25 +39,25 @@ The following MSDTC configurations are supported:
3739

3840
| Transaction standard | Data sources | ODBC driver | JDBC driver |
3941
| --- | --- | --- | --- |
40-
| **OLE-TX transactions** | SQL Server on Linux | Yes | No |
41-
| **XA distributed transactions** | SQL Server, other ODBC, and JDBC data sources that support XA | Yes (requires version 17.3 or higher) | Yes |
42-
| **Distributed transactions on linked server** | SQL Server | Yes | No |
42+
| **OLE-TX transactions** | [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux | Yes | No |
43+
| **XA distributed transactions** | [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], other ODBC, and JDBC data sources that support XA | Yes (requires 17.3 or later versions) | Yes |
44+
| **Distributed transactions on linked server** | [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] | Yes | No |
4345

4446
For more information, see [Understanding XA Transactions](../connect/jdbc/understanding-xa-transactions.md#configuration-instructions).
4547

4648
## MSDTC configuration steps
4749

48-
There are three steps to configure MSDTC communication and functionality. If the necessary configuration steps aren't done, SQL Server doesn't enable MSDTC functionality.
50+
Complete the following three steps to configure MSDTC communication and functionality for [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)].
4951

50-
- Configure `network.rpcport` and `distributedtransaction.servertcpport` using **mssql-conf**.
52+
- Configure `network.rpcport` and `distributedtransaction.servertcpport` with **mssql-conf**.
5153
- Configure the firewall to allow communication on `distributedtransaction.servertcpport` and port 135.
52-
- Configure Linux server routing so that RPC communication on port 135 is redirected to SQL Server's `network.rpcport`.
54+
- Configure Linux server routing so that RPC communication on port 135 is redirected to the [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] instance's `network.rpcport`.
5355

5456
The following sections provide detailed instructions for each step.
5557

5658
## Configure RPC and MSDTC ports
5759

58-
First, configure `network.rpcport` and `distributedtransaction.servertcpport` using **mssql-conf**. This step if specific to SQL Server and common across all supported distributions.
60+
Configure `network.rpcport` and `distributedtransaction.servertcpport` with **mssql-conf**. This step is specific to [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] and common across all supported distributions.
5961

6062
1. Use **mssql-conf** to set the `network.rpcport` value. The following example sets it to 13500.
6163

@@ -69,15 +71,17 @@ First, configure `network.rpcport` and `distributedtransaction.servertcpport` us
6971
sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport 51999
7072
```
7173

72-
1. Restart SQL Server.
74+
1. Restart [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)].
7375

7476
```bash
7577
sudo systemctl restart mssql-server
7678
```
7779

7880
## Configure the firewall
7981

80-
The second step is to configure the firewall to allow communication on `servertcpport` and port 135. This enables the RPC endpoint-mapping process and MSDTC process to communicate externally to other transaction managers and coordinators. The actual steps for this vary depending on your Linux distribution and firewall.
82+
Configure the firewall to allow communication on `servertcpport` and port 135. This step enables the RPC endpoint-mapping process and MSDTC process to communicate externally to other transaction managers and coordinators. The actual procedure varies depending on your Linux distribution and firewall.
83+
84+
### [Configure Ubuntu](#tab/ubuntu)
8185

8286
The following example shows how to create these rules on **Ubuntu**.
8387

@@ -87,23 +91,27 @@ sudo ufw allow from any to any port 135 proto tcp
8791
sudo ufw allow from any to any port 13500 proto tcp
8892
```
8993

90-
The following example shows how this could be done on **Red Hat Enterprise Linux (RHEL)**:
94+
### [Configure Red Hat Enterprise Linux (RHEL)](#tab/rhel)
95+
96+
The following example shows how to create these rules on **RHEL**.
9197

9298
```bash
9399
sudo firewall-cmd --zone=public --add-port=51999/tcp --permanent
94100
sudo firewall-cmd --zone=public --add-port=135/tcp --permanent
95101
sudo firewall-cmd --reload
96102
```
97103

104+
---
105+
98106
It's important to configure the firewall before configuring port routing in the next section. Refreshing the firewall can clear the port routing rules in some cases.
99107

100108
## Configure port routing
101109

102-
Configure the Linux server routing table so that RPC communication on port 135 is redirected to SQL Server's `network.rpcport`. Configuration mechanism for port forwarding on different distribution might differ. The following sections provide guidance for Ubuntu, SUS Enterprise Linux (SLES), and Red Hat Enterprise Linux (RHEL).
110+
Configure the Linux server routing table so that RPC communication on port 135 is redirected to the [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] instance's `network.rpcport`. The configuration mechanism for port forwarding might differ on different distributions. The following sections provide guidance for Ubuntu, SUSE Enterprise Linux (SLES), and Red Hat Enterprise Linux (RHEL).
103111

104-
### Port routing in Ubuntu and SLES
112+
### [Port routing in Ubuntu and SLES](#tab/ubuntu)
105113

106-
Ubuntu and SLES don't use the **firewalld** service, so **iptable** rules are an efficient mechanism to achieve port routing. The **iptable** rules might not persist during restarts, so the following commands also provide instructions for restoring the rules after a restart.
114+
Ubuntu and SLES don't use the **firewalld** service, so **iptables** rules are an efficient mechanism to achieve port routing. The **iptables** rules might not persist during restarts, so the following commands also provide instructions for restoring the rules after a restart.
107115

108116
1. Create routing rules for port 135. In the following example, port 135 is directed to the RPC port, 13500, defined in the previous section. Replace `<ipaddress>` with the IP address of your server.
109117

@@ -114,7 +122,7 @@ Ubuntu and SLES don't use the **firewalld** service, so **iptable** rules are an
114122
-j DNAT --to-destination <ip>:13500 -m comment --comment RpcEndPointMapper
115123
```
116124

117-
The `--comment RpcEndPointMapper` parameter in the previous commands assists with managing these rules in later commands.
125+
The `--comment RpcEndPointMapper` parameter in the previous commands helps you manage these rules in later commands.
118126

119127
1. View the routing rules you created with the following command:
120128

@@ -137,34 +145,36 @@ Ubuntu and SLES don't use the **firewalld** service, so **iptable** rules are an
137145
> [!NOTE]
138146
> You must have super user (sudo) privileges to edit the `rc.local` or `after.local` files.
139147
140-
The **iptables-save** and **iptables-restore** commands, along with `rc.local`/`after.local` startup configuration, provide a basic mechanism to save and restore iptables entries. Depending on your Linux distribution, there might be more advanced or automated options available. For example, an Ubuntu alternative is the `iptables-persistent` package to make entries persistent.
148+
The `iptables-save` and `iptables-restore` commands, along with `rc.local`/`after.local` startup configuration, provide a basic mechanism to save and restore **iptables** entries. Depending on your Linux distribution, there might be more advanced or automated options available. For example, an Ubuntu alternative is the `iptables-persistent` package to make entries persistent.
141149

142-
The previous steps assume a fixed IP address. If the IP address for your SQL Server instance changes (due to manual intervention or DHCP), you must remove and recreate the routing rules if they were created with iptables. If you need to recreate or delete existing routing rules, you can use the following command to remove old `RpcEndPointMapper` rules:
150+
The previous steps assume a fixed IP address. If the IP address for your [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] instance changes (due to manual intervention or DHCP), you must remove and recreate the routing rules if you created them with **iptables**. If you need to recreate or delete existing routing rules, use the following command to remove old `RpcEndPointMapper` rules:
143151

144152
```bash
145153
sudo iptables -S -t nat | grep "RpcEndPointMapper" | sed 's/^-A //' | while read rule; do iptables -t nat -D $rule; done
146154
```
147155

148-
### Port routing in RHEL
156+
### [Port routing in RHEL](#tab/rhel)
149157

150-
On distributions that use **firewalld** service, such as Red Hat Enterprise Linux, the same service can be used for both opening the port on the server and internal port forwarding. For example, on Red Hat Enterprise Linux, you should use **firewalld** service (via **firewall-cmd** configuration utility with `-add-forward-port` or similar options) to create and manage persistent port forwarding rules instead of using iptables.
158+
On distributions that use the **firewalld** service, such as Red Hat Enterprise Linux, you can use the same service for both opening the port on the server and internal port forwarding. For example, on Red Hat Enterprise Linux, use the **firewalld** service (via the **firewall-cmd** configuration utility with `-add-forward-port` or similar options) to create and manage persistent port forwarding rules instead of using **iptables**.
151159

152160
```bash
153161
sudo firewall-cmd --permanent --add-forward-port=port=135:proto=tcp:toport=13500
154162
sudo firewall-cmd --reload
155163
```
156164

165+
---
166+
157167
## Verify
158168

159-
At this point, SQL Server should be able to participate in distributed transactions. To verify that SQL Server is listening, run the **netstat** command (if you're using RHEL, you might have to first install the **net-tools** package):
169+
At this point, [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] should be able to participate in distributed transactions. To verify that [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is listening, run the **netstat** command. If you're using RHEL, you might have to first install the **net-tools** package:
160170

161171
```bash
162172
sudo netstat -tulpn | grep sqlservr
163173
```
164174

165175
You should see output similar to the following example:
166176

167-
```bash
177+
```output
168178
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 13911/sqlservr
169179
tcp 0 0 127.0.0.1:1434 0.0.0.0:* LISTEN 13911/sqlservr
170180
tcp 0 0 0.0.0.0:13500 0.0.0.0:* LISTEN 13911/sqlservr
@@ -175,33 +185,34 @@ tcp6 0 0 :::13500 :::* LISTEN 13911/sqlservr
175185
tcp6 0 0 :::51999 :::* LISTEN 13911/sqlservr
176186
```
177187

178-
However, after a restart, SQL Server doesn't start listening on the `servertcpport` until the first distributed transaction. In this case, you wouldn't see SQL Server listening on port 51999 in this example until the first distributed transaction.
188+
However, after a restart, [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] doesn't start listening on the `servertcpport` until the first distributed transaction. In this case, you wouldn't see [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] listening on port 51999 in this example until the first distributed transaction.
179189

180190
## Configure authentication on RPC communication for MSDTC
181191

182-
MSDTC for SQL Server on Linux doesn't use authentication on RPC communication by default. However, when the host machine is joined to an Active Directory domain, it's possible to configure MSDTC to use authenticated RPC communication using following **mssql-conf** settings:
192+
MSDTC for [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux doesn't use authentication on RPC communication by default. However, when the host machine is joined to an Active Directory domain, you can configure MSDTC to use authenticated RPC communication by using the following **mssql-conf** settings:
183193

184194
| Setting | Description |
185195
| --- | --- |
186-
| `distributedtransaction.allowonlysecurerpccalls` | Configure secure only RPC calls for distributed transactions. Default value is 0. |
187-
| `distributedtransaction.fallbacktounsecurerpcifnecessary` | Configure security only RPC calls for distributed transactions. Default value is 0. |
188-
| `distributedtransaction.turnoffrpcsecurity` | Enable or disable RPC security for distributed transactions. Default value is 0. |
196+
| `distributedtransaction.allowonlysecurerpccalls` | Configure secure only RPC calls for distributed transactions. The default value is 0. |
197+
| `distributedtransaction.fallbacktounsecurerpcifnecessary` | Configure security only RPC calls for distributed transactions. The default value is 0. |
198+
| `distributedtransaction.turnoffrpcsecurity` | Enable or disable RPC security for distributed transactions. The default value is 0. |
189199

190-
## Additional guidance
200+
## Supportability and compatibility
191201

192-
### Active directory
202+
### Active Directory
193203

194-
Microsoft recommends using MSDTC with RPC enabled if SQL Server is enrolled into an Active Directory configuration. If SQL Server is configured to use Active Directory authentication, MSDTC uses mutual authentication RPC security by default.
204+
Microsoft recommends using MSDTC with RPC enabled if [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is enrolled in an Active Directory configuration. If you configure [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] to use Active Directory authentication, MSDTC uses mutual authentication RPC security by default.
195205

196206
### Windows and Linux
197207

198-
If a client on a Windows operating system needs to enlist into distributed transaction with SQL Server on Linux, it must have the following minimum version of Windows operating system:
208+
If a client on a Windows operating system needs to enlist into distributed transaction with [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] on Linux, it must have the following minimum version of Windows operating system:
199209

200-
| Operating system | Minimum version | OS Build |
210+
| Operating system | Minimum version | OS build |
201211
| --- | --- | --- |
202212
| [Windows Server](/windows-server/get-started/windows-server-release-info) | 1903 | 18362.30.190401-1528 |
203213
| [Windows 10](/windows/release-information/) | 1903 | 18362.267 |
204214

205215
## Related content
206216

207217
- [What is SQL Server on Linux?](sql-server-linux-overview.md)
218+
- [How to use distributed transactions with SQL Server Linux containers](sql-server-linux-configure-msdtc-docker.md)

0 commit comments

Comments
 (0)