【问题标题】:How to connect SQLServer using JDBC connection in AWS Glue如何在 AWS Glue 中使用 JDBC 连接来连接 SQLServer
【发布时间】:2020-03-09 02:14:02
【问题描述】:

在提供 JDBC URL 格式后,我想使用 JDBC 连接选项将数据从 Glue 加载到 SQL Server 中

jdbc:sqlserver://host:port;databaseName=db_name, User name, and Password

,在测试连接时,我收到下面给出的错误。 谁能帮我解决我哪里出错了?

2019-11-13 09:29:01 INFO  CatalogClient:682 - Got connection 'SQLServer' info from Catalog with url: jdbc:sqlserver://32.238.81.66:1433/Glue_Test
2019-11-13 09:29:02 INFO  CatalogClient:718 - JDBC configuration for connection Staken QLServer: JDBCConfiguration(url=jdbc:sqlserver://32.238.81.66:1433/Glue_Test, hostname=32.238.81.66, port=1433, databaseVendor=sqlserver, databaseVersion=null, connectionName=SQLServer, path=Glue_Test, subnetId=subnet-3d416a13, availabilityZone=us-east-1b, securityGroups=[sg-c4d3929b], enforceSSL=false, customJDBCCert=null, skipCustomJDBCCertValidation=null, customJDBCCertString=null)
2019-11-13 09:29:02 INFO  JdbcConnection:46 - Starting connecter. driver SQLServerDriver:2
2019-11-13 09:29:02 INFO  JdbcConnection:64 - Attempting to connect with SSL host matching: jdbc:sqlserver://32.238.81.66:1433;database={Glue_Test};hostNameInCertificate=32.238.81.66
2019-11-13 09:29:17 INFO  JdbcConnection:73 - SSL connection to data store using host matching failed. Retrying without host matching.
2019-11-13 09:29:17 INFO  JdbcConnection:87 - Attempting to connect with SSL: jdbc:sqlserver://32.238.81.66:1433;database={Glue_Test}
2019-11-13 09:29:32 INFO  JdbcConnection:92 - SSL connection to data store failed. Retrying without SSL.
2019-11-13 09:29:32 INFO  JdbcConnection:106 - Attempting to connect without SSL: jdbc:sqlserver://32.238.81.66:1433;database={Glue_Test}
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. The TCP/IP connection to the host 32.238.81.66, 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.". Exiting with error code 30

【问题讨论】:

  • 如果您可以上传代码 sn-p,说明您尝试从胶水脚本访问数据库的准确程度,这将很有帮助。

标签: sql-server jdbc aws-glue


【解决方案1】:

胶水连接的工作方式与您在任何 VPC 中允许通信的方式非常相似。 Glue 将启动一个弹性网络接口以促进与您的数据库的通信。您可以测试的第一件事是,在与数据库相同的子网和安全组中启动一个实例,然后执行“nc -vz dbendpoint port”。如果您可以成功连接,这将确认安全组允许在该端口上进行通信。

从胶水使用相同的子网和安全组,这应该没有问题。您也可以以此为参考:https://docs.aws.amazon.com/glue/latest/dg/start-connecting.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-10
    • 2021-11-26
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 1970-01-01
    相关资源
    最近更新 更多