【问题标题】:JDBC connection failsJDBC 连接失败
【发布时间】:2019-08-01 15:05:19
【问题描述】:

我正在尝试通过 JDBC 将 AWS Glue 连接到 Azure SQL Server。我尝试了 jdbc url 的不同设置但没有成功。 URL 如下所示:

jdbc:sqlserver://domain.windows.net:1433/database
jdbc:sqlserver://domain.windows.net:1433;databaseName=database

在 AWS 的文档中,SQL Server 语法是 jdbc:sqlserver://host:port;databaseName=db_name

出于测试目的,我使用了 Squirrel SQL 并成功连接到我的 Azure SQL Server。

当我尝试在 AWS Glue 中建立测试连接时,AWS CloudWatch 给了我以下日志:

Attempting to connect with SSL: jdbc:sqlserver://domain.windows.net:1433;database={database}
SSL connection to data store failed. Retrying without SSL.
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. The TCP/IP connection to the host domain.windows.net, port 1433 has failed. Error: "Connection timed out: no further information. 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.".

对我来说奇怪的是连接中的“{”括号。 Azure 的连接字符串告诉我,连接本身应该如下所示:

jdbc:sqlserver://domain.windows.net:1433;database=database

也许这是问题所在,但我不知道如何解决。

【问题讨论】:

    标签: sql-server amazon-web-services jdbc etl aws-glue


    【解决方案1】:

    您必须设置您在 JDBC 连接期间定义的安全组的出站和入站规则。将出站规则设置为允许的所有流量。还允许您的 azure 数据库中的 tcp 流量。

    【讨论】:

      【解决方案2】:

      因为您可以从 squirrel 成功连接到 Azure SQL; Azure 端的情况很好。

      一个问题可能是 SSL;但很可能不是因为它在没有 SSL 的情况下重试也失败了。

      在胶水端;请查看该端口是否允许出站连接。

      【讨论】:

      • 感谢您的回答,但我已将出站规则设置为所有流量。
      猜你喜欢
      • 2012-09-18
      • 2018-06-22
      • 2015-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多