hive Beeline命令

Last updated on November 20, 2024 am

🧙 Questions

直接使用hive命令连接hive,返回结果不直观,建议使用beeline连接hive

  • hive连接如下

20220920101155

  • beeline连接如下

20220920103011

☄️ Ideas

配置beeline账号密码
vim /hive/etc/hive-site.xml
<!-- ispong :) beeline username -->
<property>
    <name>hive.server2.thrift.client.user</name>
    <value>ispong</value>
</property>

<!-- ispong :) beeline password -->
<property>
    <name>hive.server2.thrift.client.password</name>
    <value>ispong123</value>
</property>
连接hive数据库

默认用户名: anonymous
默认密码为空

  • 内部连接
beeline
!connect jdbc:hive2://localhost:10000
username: anonymous
password:
  • 外部连接
beeline -n ispong -p ispong123 -u jdbc:hive2://localhost:10000
beeline -n anonymous -p '' -u jdbc:hive2://localhost:10000
  • 集群连接
beeline 
!connect jdbc:hive2://main1:2181,main2:2181,node1:2181,node2:2181,node3:2181/test;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=isxcode-hiveserver2
username: anonymous
password:

备注

获取帮助
beeline --help

hive Beeline命令
https://ispong.isxcode.com/hadoop/hive/hive Beeline命令/
Author
ispong
Posted on
February 11, 2022
Licensed under