连接已启动,但没有一个提供程序

6qftjkof  于 2021-07-09  发布在  Spark
关注(0)|答案(1)|浏览(316)

我正在解决通过jdbc连接在pyspark中写入Dataframe时收到的错误,该连接使用keytab和数据库属性参数中的principal进行kerberos身份验证。
由于我没有收到通知gss initiate failed错误,因此使用kerberos凭据通过jdbc成功启动连接,但我得到:

Illegal Argument Exception: requirement failed: JDBC connection     initiated but not exactly one provider found which can handle it. Found        active providers:

我运行的代码是:

df_spark.write.jdbc(url=db_props[‘url’], table=‘schema.table’,   mode=‘overwrite’, properties=db_props)

仔细检查后,非法参数异常是一个py4jjavaerror,源于py4j中的java_gateway.py模块。我找不到关于这个错误的更多信息。感谢你的帮助,如果有人已经看到它或可以看出发生了什么!

sy5wg1nm

sy5wg1nm1#

这是一个普遍的问题,所以这是一个普遍的答案:
很好,但是老文章:https://datamountaineer.com/2016/01/15/spark-jdbc-sql-server-kerberos/
对于spark 3.1-https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html
甚至一个关于jdbc中kerberos的请求:https://github.com/apache/spark/pull/24421
请尝试学习一些东西,尝试一些东西,然后问更具体的问题。

相关问题