gpt4 book ai didi

java - 在 EMR 上启动 Hive thrift 服务器时出错

转载 作者:可可西里 更新时间:2023-11-01 14:22:50 24 4
gpt4 key购买 nike

在下面的代码中,我试图从 spark 启动一个 hive thrift 服务器:

val conf = new SparkConf().setAppName("HiveDemo")

val sc = new SparkContext(conf)
val sql = new HiveContext(sc)

sql.setConf("hive.server2.thrift.port", "10001")

val df = sql.read.parquet("s3n://...")
df.registerTempTable("test")

HiveThriftServer2.startWithContext(sql)

while (true) {
Thread.`yield`()
}

我正在使用以下配置在 EMR 集群上运行此代码作为一个步骤:

emr-4.6.0
spark 1.6.1
hive 1.0.0

我正在连接到集群以测试表是否是使用 beeline 创建的:

!connect jdbc:hive2://localhost:10001

我收到错误:无法使用 JDBC Uri 打开客户端传输:jdbc:hive2://localhost:10001: java.net.ConnectException: Connection refused

在 EMR 上我是否缺少额外的设置步骤?

最佳答案

实际上这个问题已经在 Hive 中修复了 1.3.02.0.0 .所以升级你的版本。

出现这个问题是因为Beeline's use of failed connection(s) causes failures and leaks. .所有 ( error reproducing, how it is solved and which versions are containing the fix ) 都包含在此链接中。

希望对你有所帮助。

更新1:

您的 hive Server 是否以 HTTP 模式运行?

连接 URL 当 HiveServer2以 HTTP 模式运行:-

jdbc:hive2://<host>:<port>/<db>;transportMode=http;httpPath=<http_endpoint>

哪里:-

<http_endpoint>hive-site.xml中配置的对应HTTP端点.默认值为 cliservice。

HTTP 传输模式的默认端口是 10001。

资源链接:

  1. Hive Client Details
  2. Hive JDBC : Could not open client transport with JDBC Uri

关于java - 在 EMR 上启动 Hive thrift 服务器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37620802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com