您的位置:首页 > 其它

HIVE学习笔记:HiveServer2Beeline

2017-09-06 09:35 483 查看

前言

HiveServer2 supports a command shell Beeline that works with HiveServer2. It’s a JDBC client that is based on the SQLLine CLI (http://sqlline.sourceforge.net/). There’s detailed documentation of SQLLine which is applicable to Beeline as well.

Replacing the Implementation of Hive CLI Using Beeline

示例

启动元数据库与hiveserver2:

hive --service metastore &
hiveserver2 &


日志文件默认记录在/tmp/daya(用户名)/路径下,确保两个服务均已启动成功。使用
netstat -l
查看10000端口与10002端口是否处于监听状态。其中10000为默认TCP通信端口,10002端口为默认web页面管理端口。

进入beeline shell:

beeline


连接到server:

!connect jdbc:hive2://localhost:10000 scott tiger


显示表:

show tables;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  hive