hive 以beeline的模式启动
beeline启动之前先确保 ,metastore 以及hiveserver2服务已经启动
hive 启动元数据服务
nohup hive --service metastore &
hive 启动 hiveserver2 服务
nohup hive --service hiveserver2 &
hive 启动客户端连接beeline
beeline -u jdbc:hive2://localhost:10000
启动中发生错误:
Error:Cauld not establish conmection to jdbc:hive2://localhost:100:Required field 'client protocol' is unset!S
nSessionReq(client_protocol:null,configuration: [use:database=default}) (state=08S01,code=0)
Beeline version 1.2.1.spark2 by Apache Hive
产生原因:
安装了hive和spark后,两者的bin目录下都存在beeline指令,使用beeline连接时,用的指令是spark下的beeline,未能使用到hive下的beeline指令。
解决:
可以去到hive的bin目录下启动beeline指令,或者全路径指定hive下的beeline.例如:$HIVE_HOME=/opt/install/hive/,可以使用
/opt/install/hive/bin/beeline -u jdbc:hive2://localhost:10000