Hive 如何使用spark2.0连接到远程配置单元服务器

Hive 如何使用spark2.0连接到远程配置单元服务器,hive,Hive,我正在尝试使用spark连接到位于不同集群中的远程配置单元服务器。使用蜂箱和节俭,但没有运气 val s = SparkSession.builder().appName("Man test").config("hive.metastore.uris", "jdbc:hive2://abc.svr.yy.xxxx.net:2171/default;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;principal=hiv

我正在尝试使用spark连接到位于不同集群中的远程配置单元服务器。使用蜂箱和节俭,但没有运气

val s = SparkSession.builder().appName("Man test").config("hive.metastore.uris", "jdbc:hive2://abc.svr.yy.xxxx.net:2171/default;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;principal=hive/_HOST@abc.AD.xxx.COM").enableHiveSupport().getOrCreate()

val s = SparkSession.builder().appName("Man test").config("hive.metastore.uris", "thrift://xxxx.svr.us.yyyy.net:2000").config("spark.sql.warehouse.dir", "/apps/hive/warehouse").enableHiveSupport().getOrCreate()
println("in method session created")
s.sql("show databases").show()
我在使用jdbc:hive2时遇到以下错误

java.lang.RuntimeException:无法实例化org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

当我使用节俭时:
javax.security.sasl.SaslException
:客户端和服务器之间没有公共保护层


如果我在这里遗漏了什么,请告诉我。

我通过在JVM选项中添加以下内容解决了同样的问题

-Djavax.security.sasl.qop="auth-conf"

请参阅:

我通过在JVM选项中添加以下内容解决了相同的问题

-Djavax.security.sasl.qop="auth-conf"
见: