直线不能连接到hiveserver2 [英] beeline not able to connect to hiveserver2

查看:609
本文介绍了直线不能连接到hiveserver2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CDH 5.3实例。
我通过首先启动配置单元,然后从命令行启动配置单元服务器来启动hive-server2。
在此之后,我使用直线连接到我的配置单元服务器2,但显然它无法如此。

 无法打开与jdbc的连接:hive2:// localhost:10000:java.net.ConnectException:连接被拒绝(状态= 08S01,code = 0)

另一个问题是,我试着查看hive-server2是否正在侦听端口10000.
我做了 sudo netstat -tulpn | grep:10000 但没有一个应用程序出现。
我还在hive-site.xml中添加了以下属性,但无济于事。为什么它不会显示在netstat上?

 < property> 
<名称> hive.server2.thrift.port< / name>
<值> 10000< /值>
< description>侦听的TCP端口号,默认10000< / description>
< / property>

直线连接命令:

 !connect jdbc:hive2:// localhost:10000 org.apache.hive.jdbc.HiveDriver 

当被要求输入用户名和密码时,我只需输入测试user和password
作为相应的值,然后就会抛出错误。
任何帮助都将被赞赏

解决方案

Hive从具有各种模式的客户端连接到直线。
$ b

1.嵌入模式:
服务器和客户端在同一台计算机上运行。无需TCP连接。

 如果hive.server2.authentication在HIVE_HOME / conf / hive-site.xml中为NONE,那么连接直线与下面的url 

连接URL:
!connect jdbc:hive2://

2。远程模式:
它支持多个客户端在以下认证方案的帮助下执行查询。



认证方案:

  i。)SASL认证:

如果HIVE_HOME / conf / hive-site中的hive.server2.authentication属性的值将.xml设置为SASL,然后将hive直线连接到以下url

直线URL:
!connect jdbc:hive2://< host>:< port> /< ;分贝>

ii。)NOSASL身份验证:
如果hive.server2.authentication是nosasl,则连接如下所示的直线。
直线网址:

!connect jdbc:hive2://< host>:< port> /< db> ;; auth = noSasl

希望这可以帮助您

参考文献:



https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_dataintegration/content/beeline-vs-hive-cli.html


I have a CDH 5.3 instance. I start the hive-server2 by first starting the hive-metastore and then the hive-server from command line. After this I use beeline to connect to my hive-server2 but apparently it is not able to so.

Could not open connection to jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (state=08S01,code=0)

Another issue, I tried to see if the hive-server2 was listening on port 10000. I did " sudo netstat -tulpn | grep :10000" but none of the applications came up. I also added the following property in the hive-site.xml but to no avail. Why it doesn't show up on the netstat?

<property>
   <name>hive.server2.thrift.port</name>
   <value>10000</value>
   <description>TCP port number to listen on, default 10000</description>
 </property>

The connect command on beeline:

!connect jdbc:hive2://localhost:10000 org.apache.hive.jdbc.HiveDriver

when asked for username and password, I just enter test "user" and "password" for the respective values and then it throws the error. Any help will be appreciated

解决方案

Hive Connecting to beeline from client having various Modes.

1.Embedded Mode: Both Server and Client runs in same machine. No TCP Connection required.

 If hive.server2.authentication is "NONE" in HIVE_HOME/conf/hive-site.xml then connect beeline with below url

Connection URL:
               !connect jdbc:hive2://

2. Remote Mode: It supports multiple clients to execute queries with help of following Authentication schemes.

Authentication Schemes:

i.)SASL Authentication:

   If value of "hive.server2.authentication" property in HIVE_HOME/conf/hive-site.xml to be set as "SASL" then connect hive beeline with below url

   Beeline URL:
             !connect jdbc:hive2://<host>:<port>/<db>

ii.)NOSASL Authentication:
   If "hive.server2.authentication" is nosasl then connect the beeline like below.
   Beeline URL:

             !connect jdbc:hive2://<host>:<port>/<db>;auth=noSasl

Hope this really helps you

References:

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_dataintegration/content/beeline-vs-hive-cli.html

这篇关于直线不能连接到hiveserver2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆