hive启动的两种方式

一、hive

[root@mihaoyu151 conf]# hive
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
21/11/09 13:56:01 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
21/11/09 13:56:01 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.user does not exist
21/11/09 13:56:01 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.password does not exist

Logging initialized using configuration in jar:file:/opt/soft/hive110/lib/hive-common-1.1.0-cdh5.14.2.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> show databases;
OK
default
Time taken: 4.195 seconds, Fetched: 1 row(s)
hive> exit;

二、beeline

第一种

[root@mihaoyu151 conf]# hive --service hiveserver2
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
21/11/09 11:09:22 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
21/11/09 11:09:22 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.user does not exist
21/11/09 11:09:22 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.password does not exist

另开一个会话

[root@mihaoyu151 conf]# beeline -u jdbc:hive2://192.168.133.151:10000
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop26/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
scan complete in 1ms
Connecting to jdbc:hive2://192.168.133.151:10000
Connected to: Apache Hive (version 1.1.0-cdh5.14.2)
Driver: Hive JDBC (version 1.1.0-cdh5.14.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 1.1.0-cdh5.14.2 by Apache Hive
0: jdbc:hive2://192.168.133.151:10000> show databases;
INFO  : Compiling command(queryId=root_20211109110101_d9435f2b-d37f-4d00-bd9c-7bedefa15ddd): show databases
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=root_20211109110101_d9435f2b-d37f-4d00-bd9c-7bedefa15ddd); Time taken: 0.567 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=root_20211109110101_d9435f2b-d37f-4d00-bd9c-7bedefa15ddd): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=root_20211109110101_d9435f2b-d37f-4d00-bd9c-7bedefa15ddd); Time taken: 0.027 seconds
INFO  : OK
+----------------+--+
| database_name  |
+----------------+--+
| default        |
+----------------+--+
1 row selected (0.932 seconds)
0: jdbc:hive2://192.168.133.151:10000>

第二种后台启动

[root@mihaoyu151 conf]nohup ../bin/hive --service hiveserver2 &
[1] 5252
[root@mihaoyu151 conf]# nohup: ignoring input and appending output to ‘nohup.out’

直接回车

[root@mihaoyu151 conf]# jps
2464 NodeManager
1938 NameNode
5252 RunJar
5332 Jps
2057 DataNode
2346 ResourceManager
2206 SecondaryNameNode

[root@mihaoyu151 conf]# beeline -u jdbc:hive2://192.168.133.151:10000
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop26/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
scan complete in 1ms
Connecting to jdbc:hive2://192.168.133.151:10000
Connected to: Apache Hive (version 1.1.0-cdh5.14.2)
Driver: Hive JDBC (version 1.1.0-cdh5.14.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 1.1.0-cdh5.14.2 by Apache Hive
0: jdbc:hive2://192.168.133.151:10000> show databases;
INFO  : Compiling command(queryId=root_20211109110606_930f6b21-ffdc-4ae5-a7ff-b07f991881e7): show databases
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=root_20211109110606_930f6b21-ffdc-4ae5-a7ff-b07f991881e7); Time taken: 0.046 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=root_20211109110606_930f6b21-ffdc-4ae5-a7ff-b07f991881e7): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=root_20211109110606_930f6b21-ffdc-4ae5-a7ff-b07f991881e7); Time taken: 0.017 seconds
INFO  : OK
+----------------+--+
| database_name  |
+----------------+--+
| default        |
+----------------+--+
1 row selected (0.154 seconds)
0: jdbc:hive2://192.168.133.151:10000>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

honconM

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值