![两台服务器之间的 SQL 连接问题](https://linux22.com/image/671904/%E4%B8%A4%E5%8F%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B9%8B%E9%97%B4%E7%9A%84%20SQL%20%E8%BF%9E%E6%8E%A5%E9%97%AE%E9%A2%98.png)
我有两台 Windows Server 2012 R2 服务器 HOST1 和 HOST2。HOST1 有一个 Web 应用程序,可与 HOST2 上的 SQL Server 2014 实例通信。
在提取大量数据时,尤其是在计划集成期间,HOST1 会遇到导致进程失败的错误。问题始终是以下三条错误消息之一:
System.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.) ---> System.ComponentModel.Win32Exception (0x80004005): The semaphore timeout period has expired
System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Session Provider, error: 19 - Physical connection is not usable)
System.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception (0x80004005): An existing connection was forcibly closed by the remote host
我制作了一个小型测试应用程序,它只使用 ADO 将数据推送到 HOST2 或从 HOST2 拉取数据,以便从等式中消除我的产品。该工具可以可靠地重现错误。
同一网络上还有第三台服务器 HOST3(也是 2012 R2)。当我从 HOST3 运行该工具时,无法重现错误。我通过 VPN 从我的工作站运行该工具也没有问题。这表明 HOST1 有问题,或者至少 HOST1 和 HOST2 之间的通信有问题。
从诊断问题的角度来看,您将如何处理这个问题?