其他分享
首页 > 其他分享> > Hive配置连接hiveserver2

Hive配置连接hiveserver2

作者:互联网

1.编辑Hive的hive-site.xml

  <property>
    <!-- hiveserver2用户名 -->
    <name>beeline.hs2.connection.user</name>
    <value>hive2</value>
  </property>

  <property>
    <!-- hiveserver2密码 -->
    <name>beeline.hs2.connection.password</name>
    <value>hive2</value>
  </property>

  <property>
     <!-- hiveserver2端口 -->
    <name>beeline.hs2.connection.hosts</name>
    <value>localhost:10000</value>
  </property>
2.测试是否成功
启动hiveserver2
$HIVE_HOME/bin/hiveserver2
 连接方式一
    $HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000;auth=hive2;password=hive2
连接方式二
    先启动beeline
    然后在beeline中连接hiveserver2:!connect jdbc:hive2://localhost:10000

标签:hs2,10000,hive2,Hive,hiveserver2,beeline,连接,localhost
来源: https://www.cnblogs.com/zhangjiahao/p/12934465.html