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

猜你喜欢

转载自www.cnblogs.com/zhangjiahao/p/12934465.html
今日推荐