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
This article describes how to configure the Microsoft Distributed Transaction Coordinator (MSTDC) on Linux. MSDTC support on Linux was introduced in SQL Server 2019 CTP 2.0.
21
+
22
+
## Supported MSDTC configurations
23
+
24
+
The following MSDTC configurations are supported:
25
+
26
+
- OLE-TX Distributed transactions against SQL Server on Linux for both ODBC/JDBC providers.
27
+
- XA Distributed transactions against SQL Server on Linux using both ODBC/JDBC provider (requires the use of the latest ODBC provider).
28
+
- Distributed transactions on Linked server.
29
+
30
+
For limitations and known issues for MSDTC in CTP 2.0, see [Release notes for SQL Server 2019 CTP on Linux](sql-server-linux-release-notes-2019.md#msdtc).
31
+
32
+
## MSDTC configuration overview
33
+
34
+
Distributed transactions are enabled on SQL Server on Linux by introducing MSDTC and RPC endpoint mapper functionality within SQL Server. By default, an RPC endpoint mapping process listens on port 135 for incoming RPC requests and routes that to appropriate components (such as the MSDTC service). A process requires super user privilege to bind to system 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 NAT translation to route traffic on port 135 to SQL Server's RPC endpoint mapping process.
35
+
36
+
SQL Server 2019 introduces two configuration parameters for the mssql-conf utility.
37
+
38
+
| mssql-conf setting | Description |
39
+
|---|---|
40
+
|**network.rpcport**| The RPC port that the RPC endpoint manager process binds to. |
41
+
|**network.servertcpport**| The port that the MSDTC server listens to. |
42
+
43
+
For more information about these settings and other related MSDTC settings, see [Configure SQL Server on Linux with the mssql-conf tool](sql-server-linux-configure-mssql-conf.md#msdtc).
44
+
45
+
There are three steps to configure MSDTC communication and functionality.
46
+
47
+
- Configure **network.rpcport** and **distributedtransaction.servertcpport** using mssql-conf.
48
+
- Configure Linux server routing so that RPC communication on port 135 is redirected to SQL Server's **network.rpcport**.
49
+
- Configure the firewall to allow communication on both **rpcport** and **servertcpport** so the RPC endpoint mapping process and MSDTC process can communicate externally to other transaction managers and coordinators.
50
+
51
+
> [!IMPORTANT]
52
+
> If the neccessary configuration steps are not done, SQL Server will not enable MSDTC functionality.
53
+
54
+
The following sections provide detailed instructions for each step.
55
+
56
+
## Configure RPC and MSDTC ports
57
+
58
+
First, configure **network.rpcport** and **distributedtransaction.servertcpport** using mssql-conf.
59
+
60
+
1. Use mssql-conf to set the **network.rpcport** value. The following example sets it to 13500.
61
+
62
+
```bash
63
+
sudo /opt/mssql/bin/mssql-conf set network.rpcport 13500
64
+
```
65
+
66
+
1. Set the **distributedtransaction.servertcpport** value. The following example sets it to 51999.
67
+
68
+
```bash
69
+
sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport 51999
70
+
```
71
+
72
+
1. Restart SQL Server.
73
+
74
+
```bash
75
+
sudo systemctl restart mssql-server
76
+
```
77
+
78
+
## Configure port routing
79
+
80
+
Configure the Linux server routing table so that RPC communication on port 135 is redirected to SQL Server's **network.rpcport**. The iptable rules may not persist during reboots, so the following commands also provide instructions for restoring the rules after a reboot.
81
+
82
+
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.
83
+
84
+
```bash
85
+
iptables -t nat -A PREROUTING -d <ip> -p tcp --dport 135 -m addrtype --dst-type LOCAL -j DNAT --to-destination <ip>:13500
86
+
87
+
iptables -t nat -A OUTPUT -d <ip> -p tcp --dport 135 -m addrtype --dst-type LOCAL -j DNAT --to-destination <ip>:13500
88
+
```
89
+
90
+
1. View the routing rules you created with the following command:
91
+
92
+
```bash
93
+
sudo iptables -t nat -L
94
+
```
95
+
96
+
1. Save the routing rules to a file on your machine.
97
+
98
+
```bash
99
+
iptables-save > /etc/iptables.conf
100
+
```
101
+
102
+
1. Add the following command to `/etc/rc.local` to reload the rules after a reboot.
103
+
104
+
```bash
105
+
iptables-restore < /etc/iptables.conf
106
+
```
107
+
108
+
> [!TIP]
109
+
> If you need to recreate or delete existing routing rules, you can use the `-D` parameter of **iptable** and specify the name of the routing rule to remove.
110
+
111
+
## Configure the firewall
112
+
113
+
The final step is to configure the firewall to allow communication on both **rpcport** and **servertcpport**. The actual steps for this will vary depending on your Linux distribution and firewall. The following example shows how to create these rules on Ubuntu.
114
+
115
+
```bash
116
+
sudo ufw allow from any to any port 13500 proto tcp
117
+
sudo ufw allow from any to any port 51999 proto tcp
118
+
```
119
+
120
+
The following example shows how this could be done on Red Hat Enterprise Linux:
At this point, SQL Server should be able to participate in distributed transactions. To verify that SQL Server is listening, run the following command:
However, after a restart, SQL Server does not start listening on the **servertcpport** until the first distributed transaction. In this case you would not see SQL Server listening on port 51999 in this example until the first distributed transaction.
150
+
151
+
## Next steps
152
+
153
+
For more information about SQL Server on Linux, see [SQL Server on Linux](sql-server-linux-overview.md).
|[Collation](#collation)| Set a new collation for SQL Server on Linux. |
26
26
|[Customer feedback](#customerfeedback)| Choose whether or not SQL Server sends feedback to Microsoft. |
27
-
|[Database Mail Profile](#dbmail)| Set the default database mail profile for SQL Server on Linux |
27
+
|[Database Mail Profile](#dbmail)| Set the default database mail profile for SQL Server on Linux.|
28
28
|[Default data directory](#datadir)| Change the default directory for new SQL Server database data files (.mdf). |
29
29
|[Default log directory](#datadir)| Changes the default directory for new SQL Server database log (.ldf) files. |
30
30
|[Default master database file directory](#masterdatabasedir)| Changes the default directory for the master database files on existing SQL installation.|
|[Local Audit directory](#localaudit)| Set a a directory to add Local Audit files. |
38
38
|[Locale](#lcid)| Set the locale for SQL Server to use. |
39
39
|[Memory limit](#memorylimit)| Set the memory limit for SQL Server. |
40
+
|[Microsoft Distributed Transaction Coordinator](#msdtc)| Configure and troubleshoot MSDTC on Linux. |
40
41
|[TCP port](#tcpport)| Change the port where SQL Server listens for connections. |
41
42
|[TLS](#tls)| Configure Transport Level Security. |
42
43
|[Traceflags](#traceflags)| Set the traceflags that the service is going to use. |
@@ -441,6 +442,46 @@ The **memory.memorylimitmb** setting controls the amount physical memory (in MB)
441
442
sudo systemctl restart mssql-server
442
443
```
443
444
445
+
## <a id="msdtc"></a> Configure MSDTC
446
+
447
+
The **network.rpcport** and **distributedtransaction.servertcpport** settings are used to configure the Microsoft Distributed Transaction Coordinator (MSDTC). To change these settings, run the following commands:
448
+
449
+
1. Run the mssql-conf script as root with the **set**commandfor"network.rpcport":
450
+
451
+
```bash
452
+
sudo /opt/mssql/bin/mssql-conf set network.rpcport <rcp_port>
453
+
```
454
+
455
+
2. Then set the "distributedtransaction.servertcpport" setting:
456
+
457
+
```bash
458
+
sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport <servertcpport_port>
459
+
```
460
+
461
+
In addition to setting these values, you must also configure routing and update the firewall for port 135. For more information on how to do this, see [How to configure MSDTC on Linux](sql-server-linux-configure-msdtc.md).
462
+
463
+
There are several other settings formssql-conf that you can use to monitor and troubleshoot MSDTC. The following table briefly describes these settings. For more information on their use, see the detailsin the Windows support article, [How to enable diagnostic tracing for MS DTC](https://support.microsoft.com/en-us/help/926099/how-to-enable-diagnostic-tracing-for-ms-dtc-on-a-windows-based-compute).
464
+
465
+
| mssql-conf setting | Description |
466
+
|---|---|
467
+
| distributedtransaction.allowonlysecurerpccalls | Configure secure only rpc calls for distributed transactions |
468
+
| distributedtransaction.fallbacktounsecurerpcifnecessary | Configure security only rpc calls for distributed |transactions
469
+
| distributedtransaction.maxlogsize | DTC transaction log file size in MB. Default is 64MB |
470
+
| distributedtransaction.memorybuffersize | Circular buffer size in which traces are stored. This size is in MB and default is 10MB |
471
+
| distributedtransaction.servertcpport | MSDTC rpc server port |
472
+
| distributedtransaction.trace_cm | Traces in the connection manager |
473
+
| distributedtransaction.trace_contact | Traces the contact pool and contacts |
| distributedtransaction.trace_misc | Traces that cannot be categorized into the other categories |
477
+
| distributedtransaction.trace_proxy | Traces that are generated in the MSDTC proxy |
478
+
| distributedtransaction.trace_svc | Traces service and .exe file startup |
479
+
| distributedtransaction.trace_trace | The trace infrastructure itself |
480
+
| distributedtransaction.trace_util | Traces utility routines that are called from multiple locations |
481
+
| distributedtransaction.trace_xa | XA Transaction Manager (XATM) tracing source|
482
+
| distributedtransaction.tracefilepath | Folder in which trace files should be stored |
483
+
| distributedtransaction.turnoffrpcsecurity | Enable or disable RPC security for distributed transactions |
484
+
444
485
## <a id="tcpport"></a> Change the TCP port
445
486
446
487
The **network.tcpport** setting changes the TCP port where SQL Server listens for connections. By default, this port is set to 1433. To change the port, run the following commands:
@@ -451,13 +492,13 @@ The **network.tcpport** setting changes the TCP port where SQL Server listens fo
451
492
sudo /opt/mssql/bin/mssql-conf set network.tcpport <new_tcp_port>
452
493
```
453
494
454
-
1. Restart the SQL Server service:
495
+
2. Restart the SQL Server service:
455
496
456
497
```bash
457
498
sudo systemctl restart mssql-server
458
499
```
459
500
460
-
1. When connecting to SQL Server now, you must specify the custom port with a comma (,) after the hostname or IP address. For example, to connect with SQLCMD, you would use the following command:
501
+
3. When connecting to SQL Server now, you must specify the custom port with a comma (,) after the hostname or IP address. For example, to connect with SQLCMD, you would use the following command:
461
502
462
503
```bash
463
504
sqlcmd -S localhost,<new_tcp_port> -U test -P test
The following release notes apply to SQL Server 2019 CTP running on Linux. This article is broken into sections for each release. Each release has a link to a support article describing the CU changes as well as links to the Linux package downloads.
21
21
22
22
> [!TIP]
23
-
> To learn about new Linux features in SQL Server 2019, see [What's new in SQL Server 2019 CTP 2.0 for Linux](../sql-server/what-s-new-in-sql-server-ver15.md#sqllinux).
23
+
> To learn about new Linux features in SQL Server 2019, see [What's new in SQL Server 2019](../sql-server/what-s-new-in-sql-server-ver15.md).
24
24
25
25
## Supported platforms
26
26
@@ -58,9 +58,9 @@ If you are updating existing SQL Server packages, run the appropriate update com
58
58
-[Install SQL Server vNext Machine Learning Services R and Python support on Linux](sql-server-linux-setup-machine-learning.md)
59
59
-[Enable SQL Server Agent](sql-server-linux-setup-sql-agent.md)
60
60
61
-
## <aid="CU9-GDR2"></a> CU9-GDR2 (August 2018)
61
+
## <aid="CTP20"></a> CTP 2.0 (September 2018)
62
62
63
-
This is a security update that also includes the previously released CU (CU9) for SQL Server 2017. The SQL Server engine version for this release is 14.0.3035.2. For information about the fixes and improvements in this release, see [https://support.microsoft.com/en-us/help/4293805](https://support.microsoft.com/en-us/help/4293805).
63
+
The following sections provide package locations and known issues for the CTP 2.0 release. To learn more about new features for Linux on SQL Server 2019, see the [What's new in SQL Server 2019](../sql-server/what-s-new-in-sql-server-ver15.md).
64
64
65
65
### Package details
66
66
@@ -72,6 +72,12 @@ For manual or offline package installations, you can download the RPM and Debian
#### <aid="msdtc"></a> Microsoft Distributed Transaction Coordinator
78
+
79
+
Currently, MSDTC requires transactions to be unauthenticated. For example, if you are using a linked server from SQL Server on Windows to SQL Server on Linux or use a Windows client application to start a distributed transaction against SQL Server on Linux, then MSDTC on Windows server/client is required to use option "No Authentication Required".
0 commit comments