【问题标题】:hive JDBC through beeline connection issuehive JDBC 通过直线连接问题
【发布时间】:2016-02-09 05:00:53
【问题描述】:

如果我尝试使用以下方式通过直线连接到 hive,则使用 mapr 沙箱:

    !connect jdbc:hive2://

连接没有问题

连接到:Apache Hive(版本 1.2.0-mapr-1508) 驱动程序:Hive JDBC(版本 1.2.0-mapr-1508) 事务隔离:TRANSACTION_REPEATABLE_READ

如果我尝试连接实际地址:

    !connect jdbc:hive2://192.168.48.138:10000

错误:无法使用 JDBC Uri 打开客户端传输:jdbc:hive2://192.168.48.138:10000: null (state=08S01,code=0) 0: jdbc:hive2://192.168.48.138:10000(关闭)>

我可以通过 cli 看到 hiveserver2 正在运行:

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

我可以从我的 mac telnet 到 10000 端口并获得连接。

我还可以看到端口 10000 正在监听

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

有什么想法吗?

【问题讨论】:

    标签: jdbc tcp hive


    【解决方案1】:

    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

    【讨论】:

      猜你喜欢
      • 2020-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 2021-07-12
      • 2015-08-31
      相关资源
      最近更新 更多