zoukankan      html  css  js  c++  java
  • 通过JDBC连接Hive服务的连接串参数说明

    本文主要介绍通过JDBC连接Hive服务时,连接串中在不同场景下涉及到的参数,这些场景包括非Kerberos认证环境、Kerberos认证环境、Kerberos认证环境下使用代理用户及Kerberos认证环境下使用代理用户且指定队列等使用场景。

    1.非Kerberos认证环境下hive jdbc连接串
    !connect jdbc:hive2://${hive节点ip}:${hive端口号}/${需要连接的数据库名};

    说明:

    ${hive节点ip}——为Hive安装节点的ip或hostname

    ${hive端口号}——为Hive服务的端口号,默认为10000

    ${需要连接的数据库名}——为需要连接的Hive数据库名,如:default

    2.hive jdbc连接串
    !connect jdbc:hive2://${hive节点ip}:${hive端口号}/${需要连接的数据库名};principal=${hive principal};

    说明:

    ${hive节点ip}——为Hive安装节点的ip或hostname

    ${hive端口号}——为Hive服务的端口号,默认为10000

    ${需要连接的数据库名}——为需要连接的Hive数据库名,如:default

    ${hive principal}——为Hive服务的principal,此参数是在Hive集成Kerberos认证环境下使用,如果集群未使用Kerberos认证,则不需要配置该参数,如果集群是Kerberos认证环境,则该principal为hive-site.xml中hive.server2.authentication.kerberos.principal配置项的值

    3.通过代理模式连接hive
    !connect jdbc:hive2://${hive节点ip}:${hive端口号}/${需要连接的数据库名};principal=${hive principal};hive.server2.proxy.user=${proxyUserName};

    说明:

    ${hive节点ip}——为Hive安装节点的ip或hostname

    ${hive端口号}——为Hive服务的端口号,默认为10000

    ${需要连接的数据库名}——为需要连接的Hive数据库名,如:default

    ${hive principal}——为Hive服务的principal,此参数是在Hive集成Kerberos认证环境下使用,如果集群未使用Kerberos认证,则不需要配置该参数,如果集群是Kerberos认证环境,则该principal为hive-site.xml中hive.server2.authentication.kerberos.principal配置项的值

    ${proxyUserName}——为Hive代理的用户名

    4.hive jdbc连接串中指定代理用户、指定队列名
    !connect jdbc:hive2://${hive节点ip}:${hive端口号}/${需要连接的数据库名};principal=${hive principal};hive.server2.proxy.user=${proxyUserName}?mapreduce.job.queuename=${queueName};

    说明:

    ${hive节点ip}——为Hive安装节点的ip或hostname

    ${hive端口号}——为Hive服务的端口号,默认为10000

    ${需要连接的数据库名}——为需要连接的Hive数据库名,如:default

    ${hive principal}——为Hive服务的principal,此参数是在Hive集成Kerberos认证环境下使用,如果集群未使用Kerberos认证,则不需要配置该参数,如果集群是Kerberos认证环境,则该principal为hive-site.xml中hive.server2.authentication.kerberos.principal配置项的值

    ${queueName}——为执行Hive任务的队列名,该参数只支持执行引擎为MapReduce

  • 相关阅读:
    PointToPointNetDevice doesn't support TapBridgeHelper
    NS3系列—10———NS3 NodeContainer
    NS3系列—9———NS3 IP首部校验和
    NS3系列—8———NS3编译运行
    【习题 7-6 UVA
    【Good Bye 2017 C】 New Year and Curling
    【Good Bye 2017 B】 New Year and Buggy Bot
    【Good Bye 2017 A】New Year and Counting Cards
    【Educational Codeforces Round 35 D】Inversion Counting
    【Educational Codeforces Round 35 C】Two Cakes
  • 原文地址:https://www.cnblogs.com/sheng-sjk/p/14535727.html
Copyright © 2011-2022 走看看