Hive(16):hiveserver2服务

1、hiveserver2功能

    优势:将hive变成一个服务对外开放,通过客户端去链接。开启hiveserver2,然后使用beeline客户端访问,有验证的方法,从而限制用户访问权限,保证数据库安全。

2、启动hiveserver2并且连接方法

(1)单独启动hiveserver2和beeline

    启动服务  (需要一直保持界面不能关闭,所以,一般不用)

bin/hiveserver2

    启动客户端

bin/beeline
!connect jdbc:hive2://bigdata.hadoop2.com:10000

(2)一步到位

bin/beeline -u jdbc:hive2://bigdata.hadoop2.com:10000 -n hadoop2 -p hadoop2 

3.配置方法【后台启动hiveserver2】

(1)在操作beeline的时候,hiveserver2会有回显信息,操作成功会有ok,失败会有错误信息
          所以在开启bin/hiveserver2的时候,使用nohup让进程在后台启动,并且把回显的数据添加到文本中

nohup bin/hiveserver2  > myout.file 2>&1 &

(2)hiveserver2如果链接不上,超时,可以修改参数,把L去掉,添加到hive-site.xml

        <property>
            <name>hive.server2.long.polling.timeout</name>
            <value>5000L</value>
            <description>Time in milliseconds that HiveServer2 will wait, before responding to asynchronous calls that use long polling</description>
        </property>

(3)会发现hiveserver2几乎没有权限验证,是因为配置文件中,默认没有开启

     <property>
        <name>hive.server2.authentication</name>
        <value>NONE</value>
        <description>
          Expects one of [nosasl, none, ldap, kerberos, pam, custom].
          Client authentication types.
            NONE: no authentication check
            LDAP: LDAP/AD based authentication
            KERBEROS: Kerberos/GSSAPI authentication
            CUSTOM: Custom authentication provider
                    (Use with property hive.server2.custom.authentication.class)
            PAM: Pluggable authentication module
            NOSASL:  Raw transport
        </description>
      </property>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值