Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

beeline - no current connection

avatar
Contributor

Hi,

I'm currently working through tutorial

http://hortonworks.com/hadoop-tutorial/hello-world-an-introduction-to-hadoop-hcatalog-hive-and-pig/#...

Section 2.2.10 - Beeline

As instructed I do the following

1. Run Putty

2. Login as maria_dev

3. run 'sudo su hive' (su hive just asks me for a password and I've tried maria_dev's and roots with no luck)

4. run 'beeline'

5. beeline starts and I get the version number and the prompt changes to beeline>

But then no matter what I run I get the message back 'No current connection'.

Even if I run 'quit;' The steps in the tutorial seem pretty basic so I dont know where I'm going wrong. Any ideas?

Thanks, Nic

1 ACCEPTED SOLUTION

avatar
Master Guru
@Nic Hopper

After entering into beeline shell, you need to give connection string to connect to Hiveserver2.

Please use below command in beeline shell to connect to HS2

!connect jdbc:hive2://<hiveserver2-hostname-or-ip>:10000/<database-name>

After you run above command, you will have to provide username and password based on authentication mechanism that you have configured for Hiveserver2 (by default it's none)

Please refer below document for more details

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients

View solution in original post

3 REPLIES 3

avatar
Master Guru
@Nic Hopper

After entering into beeline shell, you need to give connection string to connect to Hiveserver2.

Please use below command in beeline shell to connect to HS2

!connect jdbc:hive2://<hiveserver2-hostname-or-ip>:10000/<database-name>

After you run above command, you will have to provide username and password based on authentication mechanism that you have configured for Hiveserver2 (by default it's none)

Please refer below document for more details

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients

avatar

@Nic Hopper

If you have Kerberos enabled you need to connect as:

!connect jdbc:hive2://<hiveserver2_hostname>:10001/<database_name>;transportMode=http;httpPath=cliservice;principal=<hive_principal>

avatar
Contributor

Thank you both for the responses. Greatly appreciate both.

Kuldeep - That worked perfectly

Daniel - Very useful to know, I'm sure it will end up being used down the line.