hive-beeline-dbeaver-access

Hive2 Server and Beeline access
Hive2 Server and Beeline access



Search for the existing hive2 server job
$ ps -ef | grep hive2
mkm        21582   17014  0 20:48 pts/1    00:00:00 grep --color=auto hive2

If hive2 process not found, start by below command
$ hiveserver2
2024-07-14 17:10:56: Starting HiveServer2
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/mkm/mm/softwares/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mkm/mm/softwares/hadoop-2.9.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = d3c66d8a-cc2d-479b-9a82-6e29b74f4d73



Now try connect to Hive from beeline, Syntax
$ beeline -u "jdbc:hive2:"//:"jdbc:hive2://localhost:10000/" -n '' -p ''
Normal standalone hive installation, Username and password will be blank.
$ beeline -u "jdbc:hive2://localhost:10000/default" -n '' -p ''
beeline>
Alternate way of entering beeline
$ beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/mkm/mm/softwares/hive-3.1.3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mkm/mm/softwares/hadoop-2.9.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.3 by Apache Hive
beeline> !connect "jdbc:hive2://localhost:10000"
Connecting to jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000:  //blank for standalone hive
Enter password for jdbc:hive2://localhost:10000:  //blank for standalone hive
Connected to: Apache Hive (version 3.1.3)
Driver: Hive JDBC (version 3.1.3)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://localhost:10000>

Hive2 Server Web UI will be available at
http://localhost:10002/



1. Download DBeaver setup file (deb) for Ubuntu and install it(dpkg -i path/to/dbeaver-xxx.deb)
2. Open DBeaver > Database > New Database Conection > Select Apache Hive
3. Select host as localhost and port as 10000 or alternatively use URL as jdbc:hive2://localhost:10000
4. Blank username and password(Hive Single node setup)
5. Test the connection and save
6. If SSH is enabled, go to ssh tab and choose "Use SSH Tunnel"
7. Give host as localhost, Authentication Method: Password if you have supplied
8. Otherwise choose public key > Choose generated key file
9. Default location is ~/.ssh/id_rsa.pub
Pre-requisite is Hive2 Server should be up and running.

Comments

Popular posts from this blog

hadoop-installation-ubuntu

jenv-tool

hive-installation-in-ubuntu