AWS Glue-无法连接到mysql
Hi在此实例中,数据库安全组对所有入站流量(所有端口-所有源)开放 我还能够在mysql workbench或Datagrip中很好地连接到数据库,它们肯定使用jdbc连接字符串AWS Glue-无法连接到mysql,mysql,amazon-web-services,jdbc,aws-glue,Mysql,Amazon Web Services,Jdbc,Aws Glue,Hi在此实例中,数据库安全组对所有入站流量(所有端口-所有源)开放 我还能够在mysql workbench或Datagrip中很好地连接到数据库,它们肯定使用jdbc连接字符串 2019-05-21 14:12:03 INFO CatalogClient:651 - Got connection 'tem-sas-main' info from Catalog with url: jdbc:mysql://my-database-example:3306/sas_tem_central 201
2019-05-21 14:12:03 INFO CatalogClient:651 - Got connection 'tem-sas-main' info from Catalog with url: jdbc:mysql://my-database-example:3306/sas_tem_central
2019-05-21 14:12:03 INFO CatalogClient:684 - JDBC configuration for connection tem-sas-main: JDBCConfiguration(url=jdbc:mysql://my-database-example:3306/sas_tem_central, hostname=my-database-example, port=3306, databaseVendor=mysql, databaseVersion=null, connectionName=tem-sas-main, path=sas_tem_central, subnetId=subnet-0717c4db096e84393, availabilityZone=eu-west-1a, securityGroups=[sg-074b074ebc51c2315], enforceSSL=false)
2019-05-21 14:12:03 INFO JdbcConnection:42 - Starting connecter. driver com.mysql.jdbc.Driver@7e5d9a50
2019-05-21 14:12:03 INFO JdbcConnection:60 - Attempting to connect with SSL host matching: jdbc:mysql://my-database-example:3306/sas_tem_central
2019-05-21 14:14:15 INFO JdbcConnection:69 - SSL connection to data store using host matching failed. Retrying without host matching.
2019-05-21 14:14:15 INFO JdbcConnection:83 - Attempting to connect with SSL: jdbc:mysql://my-database-example:3306/sas_tem_central
2019-05-21 14:16:26 INFO JdbcConnection:88 - SSL connection to data store failed. Retrying without SSL.
2019-05-21 14:16:26 INFO JdbcConnection:102 - Attempting to connect without SSL: jdbc:mysql://my-database-example:3306/sas_tem_central
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
还要注意,我的JDBC连接字符串是
jdbc:mysql://my-database-example:3306/sas_tem_central
如果将Require SSL connection设置为false,则在MySQL引擎中使用AWS RDS时,不需要创建JDBC连接。您可以在创建连接时使用Amazon RDS
您的连接字符串看起来正确 我也遇到了同样的问题,发现我必须解决一些问题:
在与AWS架构师交谈之后,我可以确认Glue目前无法与MySql版本8配合使用。这在我能找到的任何地方都没有记录。(胶水文档/常见问题解答中没有突出指出) 下表列出了AWS Glue支持的JDBC驱动程序版本
Microsoft SQL Server 6.x
MySQL 5.1
Oracle Database 11.2
PostgreSQL 42.x
Amazon Redshift 4.1
现在,您可以从AWS Glue作业连接到MySQL 8和其他更新的数据库
s3://yourS3bucket/path/mysql-connector-java-8.0.21.jar
(该脚本中没有新行)您的MySQL实例是否通过SSL进行安全保护?如果是,则您需要使用来自公认的公共证书颁发机构的证书:您如何尝试使用glue进行连接。请提供一些代码片段。@HarshBafna我正在尝试通过JDBC连接进行连接,并且我的连接字符串为“jdbc:mysql://my-database-example:3306/sas_tem_central"-还需要SSL连接是错误的。我假设您在glue etl中提供了一些连接到MySQL的spark代码。您可以分享您正在做的示例吗。@FaizRasool:您在glue连接中配置的VPC/安全组是否与连接到RDS实例的VPC/安全组相同。然后您可以将此设置为问题的答案,您可以使用它r拥有自己的JDBC驱动程序和一些配置,以使其能够与MySQL 8一起工作,请参阅,这不是现成的,它需要一些配置。即使您选择Amazon RDS,它仍然会生成JDBC字符串作为连接URI。
datasink4 = glueContext.write_dynamic_frame.from_jdbc_conf
(frame = dropnullfields3, catalog_connection = “GLUE-CONNECTION-NAME”,
connection_options = {
"customJdbcDriverS3Path": "s3://yourS3Bucket/path/mysql-connector-java-8.0.21.jar",
"customJdbcDriverClassName": "com.mysql.cj.jdbc.Driver",
"user": “#DBuserName#”, "password": “DbUsersPassword”,
"url":"jdbc:mysql://dbname.url.region.rds.amazonaws.com/schemaName,
"connectionType": "mysql", "dbtable": “tablenameInDb”,
"database": “schemaName”}, transformation_ctx = "datasink4")