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
Copy file name to clipboardExpand all lines: docs/linux/sql-server-linux-configure-msdtc.md
+43-32Lines changed: 43 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: How to Configure MSDTC on Linux
3
3
description: In this article, learn how to configure the Microsoft Distributed Transaction Coordinator (MSDTC) on Linux.
4
4
author: rwestMSFT
5
5
ms.author: randolphwest
6
-
ms.date: 07/03/2025
6
+
ms.date: 11/24/2025
7
7
ms.service: sql
8
8
ms.subservice: linux
9
9
ms.topic: how-to
@@ -20,7 +20,9 @@ MSDTC on Linux is supported on [!INCLUDE [sssql17-md](../includes/sssql17-md.md)
20
20
21
21
## Overview
22
22
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.
24
26
25
27
MSDTC uses two configuration parameters for the **mssql-conf** utility:
26
28
@@ -37,25 +39,25 @@ The following MSDTC configurations are supported:
37
39
38
40
| Transaction standard | Data sources | ODBC driver | JDBC driver |
39
41
| --- | --- | --- | --- |
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 |
43
45
44
46
For more information, see [Understanding XA Transactions](../connect/jdbc/understanding-xa-transactions.md#configuration-instructions).
45
47
46
48
## MSDTC configuration steps
47
49
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)].
49
51
50
-
- Configure `network.rpcport` and `distributedtransaction.servertcpport`using**mssql-conf**.
52
+
- Configure `network.rpcport` and `distributedtransaction.servertcpport`with**mssql-conf**.
51
53
- 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`.
53
55
54
56
The following sections provide detailed instructions for each step.
55
57
56
58
## Configure RPC and MSDTC ports
57
59
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.
59
61
60
62
1. Use **mssql-conf** to set the `network.rpcport` value. The following example sets it to 13500.
61
63
@@ -69,15 +71,17 @@ First, configure `network.rpcport` and `distributedtransaction.servertcpport` us
69
71
sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport 51999
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)
81
85
82
86
The following example shows how to create these rules on **Ubuntu**.
83
87
@@ -87,23 +91,27 @@ sudo ufw allow from any to any port 135 proto tcp
87
91
sudo ufw allow from any to any port 13500 proto tcp
88
92
```
89
93
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**.
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.
99
107
100
108
## Configure port routing
101
109
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).
103
111
104
-
### Port routing in Ubuntu and SLES
112
+
### [Port routing in Ubuntu and SLES](#tab/ubuntu)
105
113
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.
107
115
108
116
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.
109
117
@@ -114,7 +122,7 @@ Ubuntu and SLES don't use the **firewalld** service, so **iptable** rules are an
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.
118
126
119
127
1. View the routing rules you created with the following command:
120
128
@@ -137,34 +145,36 @@ Ubuntu and SLES don't use the **firewalld** service, so **iptable** rules are an
137
145
> [!NOTE]
138
146
> You must have super user (sudo) privileges to edit the `rc.local` or `after.local` files.
139
147
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.
141
149
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:
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**.
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:
160
170
161
171
```bash
162
172
sudo netstat -tulpn | grep sqlservr
163
173
```
164
174
165
175
You should see output similar to the following example:
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.
179
189
180
190
## Configure authentication on RPC communication for MSDTC
181
191
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:
183
193
184
194
| Setting | Description |
185
195
| --- | --- |
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. |
189
199
190
-
## Additional guidance
200
+
## Supportability and compatibility
191
201
192
-
### Active directory
202
+
### Active Directory
193
203
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.
195
205
196
206
### Windows and Linux
197
207
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:
0 commit comments