【问题标题】:How to connect to remote hive server using spark2.0如何使用 spark2.0 连接到远程 Hive 服务器
【发布时间】: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


    【解决方案1】:

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

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

    见:https://github.com/prestodb/presto/issues/8604

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-05
      • 2014-12-09
      • 2016-12-01
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 2017-04-02
      • 2014-07-17
      相关资源
      最近更新 更多