You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SQL Server推送合并复制连接订阅失败问题求助

SQL Server合并复制推送事务连接失败排查

我正尝试配置带推送事务的合并复制,谷歌服务器和本地PC均部署SQL Server,已安装Radmin VPN,可通过SQL Server Management Studio(SSMS)使用命名实例双向连接,一切正常。我创建了发布服务器和快照,但在错误日志中收到以下信息:

The process could not connect to Subscriber 'WIN-GGH2H07UGC4'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20084)
Get help: http://help/MSSQL_REPL20084
Named Pipes Provider: Could not open a connection to SQL Server [1326]. (Source: MSSQLServer, Error number: 1326)
Get help: http://help/1326
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (Source: MSSQLServer, Error number: 1326)
Get help: http://help/1326
Query timeout expired, Failed Command: (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
The merge process failed to execute a query because the query timed out. If this failure continues, increase the query timeout for the process. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. > (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
The subscription to publication 'sync_repl' could not be verified. Ensure that all Merge Agent command line parameters are specified correctly and that the subscription is correctly configured. If the Publisher no longer has information about this subscription, drop and recreate the subscription. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201019)
Get help: http://help/MSSQL_REPL-2147201019

我已开放防火墙1433和14333端口(两个SQL Server实例分别使用这两个端口),且已允许远程连接,请问问题出在哪里?


排查方案
  • 检查复制代理的连接字符串:SSMS能连接不代表复制代理用的连接字符串正确。打开复制监视器,找到对应的合并代理,查看其命令行参数里的订阅服务器连接字符串,确认是否用了IP地址+端口的格式(比如TCP:192.168.x.x,14333),而不是仅用机器名WIN-GGH2H07UGC4——VPN环境下可能存在NetBIOS名称解析失败,导致代理尝试用命名管道连接(错误里的Named Pipes Provider就是信号)。
  • 验证命名管道端口是否开放:错误提示命名管道连接失败,即使你用TCP端口,复制代理可能优先尝试命名管道。需要在两边防火墙开放命名管道对应的端口(默认445),或者在连接字符串里强制指定TCP协议,避免代理走命名管道。
  • 检查SQL Server代理服务的权限:合并代理是运行在SQL Server代理下的,需要确认代理服务的账号有足够权限访问订阅服务器的SQL实例。如果用的是本地系统账号,在跨机器的VPN环境下可能没有网络访问权限,建议改用域账号或者有双方机器权限的本地账号。
  • 调整合并代理的超时时间:错误里提到查询超时,可在复制监视器里编辑合并代理的属性,把查询超时值调大(比如从默认300秒改成600秒),同时开启详细日志,查看具体是哪个操作超时,定位瓶颈。
  • 重新创建订阅并指定协议:如果以上都无效,删除现有订阅,重新创建时手动指定订阅服务器的连接协议为TCP/IP,明确填写IP和端口,不要依赖机器名解析。

内容的提问来源于stack exchange,提问作者user22915712

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 17:05:14