2015-11-08 49 views
0

使用MAPR沙箱,如果我嘗試連接使用這種通過直線蜂巢:蜂巢JDBC通過直線連接問題

!connect jdbc:hive2:// 

它連接沒有問題

連接到:Apache的配置單元(1.2版。 0 MAPR-1508) 司機:蜂巢JDBC(1.2.0版本 - MAPR-1508) 事務隔離:TRANSACTION_REPEATABLE_READ

如果我嘗試與實際連接地址:

!connect jdbc:hive2://192.168.48.138:10000 

錯誤:無法打開客戶端傳輸與JDBC烏里:JDBC:hive2://192.168.48.138:10000:空(狀態= 08S01,代碼= 0) 0:JDBC:hive2: //192.168.48.138:10000(關閉)>

我可以通過CLI看到hiveserver2運行:

hs2    0  /opt/mapr/hive/hive-1.2/logs/mapr HiveServer2 

我可以從我的Mac遠程登錄到端口10000,並得到一個連接。

我還可以看到10000端口監聽

tcp  0  0 0.0.0.0:10000    0.0.0.0:*     LISTEN  9270/java 

任何想法?

回答

0

Hive從具有各種模式的客戶端連接到直線。

1.嵌入式模式: 服務器和客戶端都在同一臺機器上運行。不需要TCP連接。

If value of "hive.server2.authentication" property in hive-site.xml is "NONE" is known as an Hive server Connection in embedded mode. 

    If its value is NONE then you can use below url to connect with hive- beeline 
Connection URL: 
       !connect jdbc:hive2:// 

2.遠程模式: 它支持多個客戶提供以下驗證方案的幫助下執行查詢。

的身份驗證方案:

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 

希望這真的幫助你

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