A new way to access hive cli

When I was using hive cli today, I found that the "hive" command that I used often suddenly didn't work, as shown in the figure:

The owner has been stuck and asked the professionals about what task might be stuck. So I was provided with a new way of access- beeline .

The usage example is as follows:

[root@slave3 ~]# beeline
Beeline version 1.2.1000.2.5.3.0-37 by Apache Hive
beeline> !connect jdbc:hive2://slave1.hdp.test.cq:2181,slave2.hdp.test.cq:2181,slave3.hdp.test.cq:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
Connecting to jdbc:hive2://slave1.hdp.test.cq:2181,slave2.hdp.test.cq:2181,slave3.hdp.test.cq:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
Enter username for jdbc:hive2://slave1.hdp.test.cq:2181,slave2.hdp.test.cq:2181,slave3.hdp.test.cq:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2: hive
Enter password for jdbc:hive2://slave1.hdp.test.cq:2181,slave2.hdp.test.cq:2181,slave3.hdp.test.cq:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2: ****
Connected to: Apache Hive (version 1.2.1000.2.5.3.0-37)
Driver: Hive JDBC (version 1.2.1000.2.5.3.0-37)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://slave1.hdp.test.cq:2181,slave> show databases;
+----------------------------+--+
|       database_name        |
+----------------------------+--+
| ad_data                    |
| adlog                      |
| bdc_dm                     |
| bdc_dwd                    |
| bdc_search                 |
| default                    |
| hive_aqtest                |
| hive_aqtest11              |
| hive_bdata_flow            |
| hive_kf_center             |
| hive_order_center          |
| hive_order_center2         |
| hive_pay_center            |
| hive_pq_test2              |
| hive_project1              |
| hive_quanxian_wyz_0926_01  |
| hive_quanxian_wyz_0926_02  |
| hive_sdaf                  |
| hive_sunzhiqi12123         |
| hive_test1                 |
| hive_test1212              |
| hive_test123               |
| hive_test123222            |
| hive_test123456            |
| hive_test_project1         |
| hive_testa_20181213        |
| hive_testa_20181217        |
| hive_testa_20181219        |
| hive_testb_20181218        |
| panqiang                   |
| pq                         |
| pq_test                    |
| sunjsd                     |
| yuewenhao                  |
+----------------------------+--+
34 rows selected (0.133 seconds)
0: jdbc:hive2://slave1.hdp.test.cq:2181,slave> 

 

Guess you like

Origin blog.csdn.net/qq_28411869/article/details/87183075