方式1:hive交互shell
1.在hive客户端,配置hive到环境变量的前提下,在节点的任意位置 直接输入hive + 回车
方式2:hive jdbc服务(推荐)
启动服务 hiveserver2
前台启动
cd /export/servers/hive-1.1.0-cdh5.14.0
bin/hive --service hiveserver2
后台启动
cd /export/servers/hive-1.1.0-cdh5.14.0
nohup bin/hive --service hiveserver2 &
beeline连接hiveserver2
bin/beeline
beeline> !connect jdbc:hive2://node01.hadoop.com:10000
注意:如果使用beeline方式连接hiveserver2,一定要保证hive在mysql当中的元数据库已经创建成功,不然就会拒绝连接