Postgresql 通过证书文件从hadoop连接到Postgres
我想通过证书文件(client.crt、root.crt、client.key.der)从spark作业(在Thread上启动)连接到postgres,但我遇到了这个问题,我在Thread日志中找到了它: “无法打开SSL证书文件/hdfsPath/../client.crt。” 这是我的代码:Postgresql 通过证书文件从hadoop连接到Postgres,postgresql,apache-spark,hadoop,Postgresql,Apache Spark,Hadoop,我想通过证书文件(client.crt、root.crt、client.key.der)从spark作业(在Thread上启动)连接到postgres,但我遇到了这个问题,我在Thread日志中找到了它: “无法打开SSL证书文件/hdfsPath/../client.crt。” 这是我的代码: val props = new Properties() props.put("user", userPostgres) props.put("driver",
val props = new Properties()
props.put("user", userPostgres)
props.put("driver", driverOfPostgres)
props.setProperty("ssl", "true")
props.setProperty("sslmode", "Require")
props.setProperty("sslkey", hdfsPath/client.key.der)
props.setProperty("sslcert", hdfsPath/client.crt)
props.setProperty("sslrootcert", hdfsPath/root.crt)
也许用户缺少权限?