【发布时间】:2020-06-03 13:51:10
【问题描述】:
我正在尝试使用 spark 连接到位于不同集群中的远程配置单元服务器。使用了 hive2 和 thrift 但没有运气
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
当我使用 thrift 时:
javax.security.sasl.SaslException:客户端和服务器之间没有共同的保护层。
如果我在这里遗漏了什么,请告诉我。
【问题讨论】:
标签: hive