- Configure RPC and MSDTC ports
- Use mssql-conf to set the
network.rpcport
value. The following example sets it to 13500
sudo /opt/mssql/bin/mssql-conf set network.rpcport 13500
- Set the
distributedtransaction.servertcpport
value. The following example sets it to 51999.
sudo /opt/mssql/bin/mssql-conf set distributedtransaction.servertcpport 51999
- Restart SQL Server
sudo systemctl restart mssql-server
- Configure the firewall
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
sudo firewall-cmd --zone=public --add-port=51999/tcp --permanent
sudo firewall-cmd --zone=public --add-port=135/tcp --permanent
sudo firewall-cmd –reload
- Configure port routing
Configure the Linux server routing table so that RPC communication on port 135 is redirected to SQL Server's network.rpcport
sudo firewall-cmd --permanent --add-forward-port=port=135:proto=tcp:toport=13500
sudo firewall-cmd –reload
- Verify
At this point, SQL Server should be able to participate in distributed transactions. To verify that SQL Server is listening, run the netstat
command (you might have to first install the net-tools
package):
sudo netstat -tulpn | grep sqlservr
You should see output similar to the following:
tcp 0 0 0.0.0.0:1433 0.0.0.0:* LISTEN 13911/sqlservr
tcp 0 0 127.0.0.1:1434 0.0.0.0:* LISTEN 13911/sqlservr
tcp 0 0 0.0.0.0:13500 0.0.0.0:* LISTEN 13911/sqlservr
tcp 0 0 0.0.0.0:51999 0.0.0.0:* LISTEN 13911/sqlservr
tcp6 0 0 :::1433 :::* LISTEN 13911/sqlservr
tcp6 0 0 ::1:1434 :::* LISTEN 13911/sqlservr
tcp6 0 0 :::13500 :::* LISTEN 13911/sqlservr
tcp6 0 0 :::51999 :::* LISTEN 13911/sqlservr
Restart SQL Server
sudo systemctl restart mssql-server
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.