for-win icon indicating copy to clipboard operation
for-win copied to clipboard

MSDTC service not work in Windows MSSQL Container

Open praveenkdevops opened this issue 7 years ago • 6 comments

Hi All ,

We are Facing MSDTC service cannot worked on windows container NEED DOCUMENT PLZ HELP Windows Server 2019 Docker version Docker version 18.09.0, build 4d60db4

Steps : We've created a windows MSSQL container thru below command as:

docker run --security-opt "credentialspec=file://Gmsa.json" --cpus=2 -m 4GB --storage-opt size=100G -itd --name testport -p 1433:1433 -e sa_password=password -e ACCEPT_EULA=Y -e 'MSSQL_RPC_PORT=135' -e 'MSSQL_DTC_TCP_PORT=51000' --isolation=hyperv k8s-master:5000/Mysqlserver

How can we use distributed transaction on windows sql container via linked server and also giving you an example as

BEGIN DISTRIBUTED TRAN select count(*) from [linkedServerName].master.sys.databases with (NOLOCK); ROLLBACK TRAN

LinkedServer might be from different sql container on same host OR with standalone SQL server (which is in domain).

We've already enabled the MSDTC on SQL container with below powershell as:

Set-DtcNetworkSetting -DtcName 'Local' -AuthenticationLevel 'NoAuth' -InboundTransactionsEnabled $True -OutboundTransactionsEnabled $True -RemoteClientAccessEnabled $True -RemoteAdministrationAccessEnabled $True -XATransactionsEnabled $True

ERROR: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers.

praveenkdevops avatar Mar 11 '19 15:03 praveenkdevops

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Jun 09 '19 01:06 docker-robott

MSDTC will not work on windows container because it requires Endpoint mapper for registering and discovering it's ports. The windows host's endpoint mapper always listen on port 135, so you cannot map the container's endpoint mapper to listen on 135. You will need a separate IP for the container.

chinhang avatar Jun 24 '19 22:06 chinhang

any feedback on this issue?

orialmog avatar Nov 28 '19 09:11 orialmog

Any action taking on this issue?

lmayorga1980 avatar Dec 09 '19 19:12 lmayorga1980

hi. has anyone ever got that running? I have a scenario now that involves NOT exposing any ports from the container but talking to the container via its IP directly instead of using localhost. In that scenario there is no conflicting port usage (135) and DTCs could theoretically talk to each other. I can see that DTC transactions are opened on both sides but I do get an exception:

Communication with the underlying transaction manager has failed.
System.Runtime.InteropServices.COMException : The MSDTC transaction manager was unable to pull the transaction from the source transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02B)

No clue on how to work around that.

rominator1983 avatar May 11 '20 12:05 rominator1983

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked

docker-robott avatar Jul 05 '20 03:07 docker-robott