The process of configuring MSDTC for a Linux-based Docker container running SQL Server involves the following steps:
Ensure that the MSDTC service is installed on the container.
Modify the Dockerfile to include the MSDTC service by adding the following lines:
RUN apt-get update && apt-get install -y msdtc
Modify the MSDTC configuration settings by creating a custom msdtc.conf file and copying it to the /etc/msdtc directory in the container. The msdtc.conf file should include the following settings:
Security Configuration: NetworkDtcAccessClients = "anonymous" NetworkDtcAccessInbound = "allow" NetworkDtcAccessOutbound = "allow" NetworkDtcAccessTransactions = "allow" DtcLog: LogFileManagerMaxFiles = "30" DtcTransactionManager: TransactionManagerCommunication = "tcpip" TransactionManagerAddress = "0.0.0.0" RemoteTransactionTimeout = "120" TransactionManagerClusterAddress = "0.0.0.0"
Configure the SQL Server instance to support MSDTC by setting the "Enable Promotion of Distributed Transactions" option to True in SQL Server Configuration Manager.
Configure the firewall on the container to allow incoming connections on port 135 and outgoing connections on port 135 and 5000-5080.
Start the MSDTC service by running the following command in the container:
systemctl start msdtc
Finally, test the MSDTC configuration by running a distributed transaction involving multiple SQL Server instances in separate Docker containers.
Asked: 2023-03-28 11:00:00 +0000
Seen: 13 times
Last updated: Nov 29 '21