Connecting oracle database using spark with Kerberos authentication?

本小妞迷上赌 提交于 2021-02-07 09:01:15

问题


My jdbc is connected to oracle database using krb5loginmodule without any issue, by giving keytab file or ticket cache.But, due to performance, I want to connect my oracle database using Spark. If I use simple username and password, I am able to connect my spark application to Oracle database using below snippet:

Dataset<Row> empDF = sparkSession.read().format("jdbc")
            .option("url", "jdbc:oracle:thin:hr/1234@//127.0.0.1:1522/orcl")
            .option("dbtable", "hr.employees")
            //.option("user", "hr")
            //.option("password", "1234")
            .option("driver", "oracle.jdbc.driver.OracleDriver")
            .load();
empDF.printSchema();
empDF.show();

Now, how can I enable Kerberos authentication using keytab, instead of using a hardcoded username and password? I don't want to use a ticket cache by manually doing kinit.

来源:https://stackoverflow.com/questions/58944946/connecting-oracle-database-using-spark-with-kerberos-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!