简体   繁体   English

JDBC可用性组连接错误

[英]JDBC availability group connection error

I'm trying to connect to an availability group through sqljdbc driver v4, but I get an error 我正在尝试通过sqljdbc驱动程序v4连接到可用性组,但是我收到错误

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the 
host ..., port 1433 has failed. Error: ".... Verify the 
connection properties. Make sure that an instance of SQL Server is running on 
the host and accepting TCP/IP connections at the port. Make sure that TCP 
connections to the port are not blocked by a firewall.".

The connection string is 连接字符串是

jdbc:sqlserver://...;multiSubnetFailover=true;databaseName=...;responseBuffering=full;selectMethod=direct;user=...;password=...

Any ideas what could get wrong? 什么想法可能会出错? I connect fine if I use the machine name directly, and the 1433 port is open, so it should not be a problem with the port or with the server being up. 如果我直接使用机器名称,并且1433端口是打开的,我连接正常,所以它不应该是端口问题或服务器启动。

问题是由于服务器名称,使用完全限定的域名(FQDN)解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM