java – 在EMR上启动配置单元thrift服务器时出错

在下面的代码中我试图从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:连接被拒绝

我在EMR上缺少一个额外的设置步骤吗?

最佳答案 实际上这个问题已在Hive
1.3.0
2.0.0中修复.因此请升级您的版本.

出现此问题的原因是Beeline’s use of failed connection(s) causes failures and leaks..所有(错误复制,如何解决以及哪些版本包含修复程序)都包含在此链接中.

希望它会对你有所帮助.

UPDATE1:

您的配置单元服务器是否在HTTP模式下运行?

HiveServer2在HTTP模式下运行时的连接URL: –

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

哪里:-

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

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

资源链接:

> Hive Client Details
> Hive JDBC : Could not open client transport with JDBC Uri

点赞