我正在尝试使用 AWS Glue 将数据从 EC2 实例中的 SQL Server 上传到 RedShift。
我已经创建了 Connections 和 Crawlers 并且它工作正常。
然后我创建了一个 Job 来加载我得到以下错误的数据。
驱动程序无法使用安全套接字层 (SSL) 加密建立与 SQL Server 的安全连接。错误:“sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径”。
日志:
raceback (most recent call last):
File "script_2017-10-24-06-24-48.py", line 20, in <module>
datasource0 = glueContext.create_dynamic_frame.from_catalog(database = "XXX", table_name = "XXXXXXX", transformation_ctx = "datasource0")
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/PyGlue.zip/awsglue/dynamicframe.py", line 508, in from_catalog
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/PyGlue.zip/awsglue/context.py", line 120, in create_dynamic_frame_from_catalog
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/PyGlue.zip/awsglue/data_source.py", line 36, in getFrame
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 1133, in __call__
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/pyspark.zip/pyspark/sql/utils.py", line 63, in deco
File "/mnt/yarn/usercache/root/appcache/application_1508826088545_0001/container_1508826088545_0001_02_000001/py4j-0.10.4-src.zip/py4j/protocol.py", line 319, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o59.getDynamicFrame.
: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:1ee3a8e5-a3a1-4871-a94c-28907c04acef
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2392)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1777)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1969)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1616)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1447)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:788)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1187)
at com.amazonaws.services.glue.util.JDBCWrapper$$anonfun$getRawConnection$1.apply(JDBCUtils.scala:535)
at com.amazonaws.services.glue.util.JDBCWrapper$$anonfun$getRawConnection$1.apply(JDBCUtils.scala:535)
at com.amazonaws.services.glue.util.JDBCWrapper.catchSSLException(JDBCUtils.scala:514)
at com.amazonaws.services.glue.util.JDBCWrapper.getRawConnection(JDBCUtils.scala:535)
at com.amazonaws.services.glue.JDBCDataSource.getPrimaryKeys(DataSource.scala:392)
at com.amazonaws.services.glue.JDBCDataSource.getDynamicFrame(DataSource.scala:354)
at com.amazonaws.services.glue.DataSource$class.getDynamicFrame(DataSource.scala:45)
at com.amazonaws.services.glue.SparkSQLDataSource.getDynamicFrame(DataSource.scala:317)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)