MSDTC - 尝试建立安全连接时出错(独立)
首先,我不知道这是否可能,但让我描述一下我的场景。
我有一组 WCF 服务,一个 SQL Server 2008 数据库,全部运行在 Windows Server 2008 上。当我连接到 LAN 时,所有这些都可以正常工作,但是我将使用这个盒子进行演示,我想使其在独立模式下工作(即不连接到任何网络)。
当我尝试在独立模式下执行此操作时,SQL Server 数据库似乎正在工作(我能够检索数据)。 但是,当我尝试从 WCF 服务的事务范围内插入数据时,在客户端我收到通信错误异常。 检查 Windows 事件日志,我看到有一条消息“MSDTC 在尝试与系统建立安全连接时遇到错误”。
有谁知道需要在 DTC 上设置什么才能使其工作
First off, I don't know if this is possible, but let me describe my scenario.
I have a set of WCF services, a SQL Server 2008 Database all running on Windows Server 2008. All of this works fine when I am connected to my LAN, however I am going to be using this box for a demo, and I would like to make it work in standalone mode (ie, not connected to any network).
When I attempt to do this in standalone mode, the SQL Server database appears to be working (I am able to retrieve data). However when I try and insert data within a transaction scope from the WCF services, on the client side I am getting a communication fault exception. Checking the windows event logs, I see that there is a message along the lines of "MSDTC encountered an error while attempting to establish a secure connection with system ".
Does anyone know what needs to be set on the DTC to allow this to work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
考虑到所发生的事情,这个错误现在是完全有道理的。
这里的问题是,在部署到服务器的应用程序之一中的某个位置,我们引用了该服务器无法访问的硬编码 dns 名称(因为它是独立的)。 据我了解,DTC 试图传输交易,但未能根据计算机名称建立地址,这就是它失败的地方。 由于该应用程序是 WCF 服务,因此该错误被很好地混淆了,但最终我们通过打开服务跟踪进行了跟踪。
希望对遇到类似错误的其他人有所帮助。 请注意硬编码值。
In context of what happened, the error now makes perfect sense.
The problem here was that somewhere in one of the applications deployed to the server, we were referring to a hardcoded dns name that was inaccessible by this server (since it was standalone). From what I understand, the DTC attempted to flow the transaction, failed to establish the address from the computer name and that was where it bombed out. As the application was a WCF service, the error was pretty well obfuscated, but eventually we traced by turning on service tracing.
Hope that helps anyone else that encounters a similar error. Beware the hardcoded values.
这可能与 WCF 服务用于连接数据库的连接字符串有关。 尝试使用数据源=。 或 Data Source=localhost,以确保您使用的是环回网络适配器 (127.0.0.1)。
Windows 机器上是否运行了防火墙? 服务器是域的一部分吗?
我还建议查看 MS DTC(组件服务 MMC 插件)的安全设置对话框。 尝试将“事务管理器通信”设置为“无需身份验证”,并勾选大多数其他选项作为基线。
It could be to do with the connection string the WCF services use to connect to the database. Try using Data Source=. or Data Source=localhost, to ensure you are using the loopback network adapter (127.0.0.1).
Is there a firewall running on the Windows machine? Is the server part of a domain?
I would also suggest looking at the security settings dialog of MS DTC (Component Services MMC plugin). Try setting the "Transaction Manager Communication" to "No Authentication Required" and ticking most other options as a base line.