使用 AWS Glue 连接到 Presto 数据库。无法通过 SSL 密钥库或证书

Connecting to Presto database using AWS Glue. Unable to pass SSL Keystore or Certificate

我在使用 AWS 胶水作业连接到 Presto 时遇到问题。代码是用 Spark Scala 编写的。我正在尝试使用以下代码连接到 Presto。

val datanot_in_hz = sqlcontext.read.format("jdbc").option("url", jdbcConUrl).option("driver", "io.prestosql.jdbc.PrestoDriver").option("SSL","true").option("SSLKeyStorePath","s3://test/presto_client.keystore").option("query", datanot_in_hz_sql).option("user", dbUserName).option("password", dbPassword).load()

我收到以下错误

2020-12-18 20:36:52,376 ERROR [main] glue.ProcessLauncher (Logging.scala:logError(70)): Exception in User Class: java.sql.SQLException : Error setting up SSL: s3:/test/presto_client.keystore (No such file or directory) io.prestosql.jdbc.PrestoDriverUri.setupClient(PrestoDriverUri.java:235) io.prestosql.jdbc.PrestoDriver.connect(PrestoDriver.java:88) org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory.apply(JdbcUtils.scala:63) org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory.apply(JdbcUtils.scala:54) org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:56) org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:210) org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:35) org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318) org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167) sddsurwithDAXreporting$.main(sddsurwithDAXreportingPresto.scala:89) sddsurwithDAXreporting.main(sddsurwithDAXreportingPresto.scala) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.amazonaws.services.glue.SparkProcessLauncherPlugin$class.invoke(ProcessLauncher.scala:38) com.amazonaws.services.glue.ProcessLauncher$$anon.invoke(ProcessLauncher.scala:67) com.amazonaws.services.glue.ProcessLauncher.launch(ProcessLauncher.scala:108) com.amazonaws.services.glue.ProcessLauncher$.main(ProcessLauncher.scala:21) com.amazonaws.services.glue.ProcessLauncher.main(ProcessLauncher.scala)

我尝试通过 pem 证书,但仍然失败并出现相同的错误。我已经检查了所有权限。我有一个 jar 文件,我可以从同一个文件夹访问它,我可以访问它。 当我 运行 使用 Eclipse 从我的机器中获取相同的代码时,它 运行 没问题。有人可以帮忙吗?我是 scala 的新手,这是我第一次尝试使用 SSL 证书连接到数据库。

AWS 支持建议在运行时将文件从 S3 复制到 tmp 文件夹,因为 Glue 无法正确读取路径