问题
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