Hive3 detailed tutorial (IV) the use of beeline

Miss Zhu 2022-02-13 08:38:51 阅读数:784

hive3 hive detailed tutorial iv

beeline It provides a graphical table structure pieced together in a simple string on the command line , As shown in the figure below , Than hive The client has better user experience .
 Insert picture description here
To configure beeline Connect , Need to be in hadoop Of etc/core.site.xml Add the following configuration permission code to the file :

<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>

start-up metastore service

hive --service metastore

 Insert picture description here
Reopen a connection , start-up hiveserver2

hive --service hiveserver2

 Insert picture description here
Reopen a connection , Get into beeline client :

beeline

Wait a moment and execute the following command on the next command line :

!connect jdbc:hive2://hp301:10000

Then follow the prompts , Input in sequence mysql user name 、 password , You can enter beeline Connect , As shown in the figure below . You can use hive Command operation data .
 Insert picture description here
If you can't enter in the process beeline Connect , It can be turned off hadoop And then reinitialize hive data .

copyright:author[Miss Zhu],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130838492881.html