Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

beeline - no current connection

Solved Go to solution

beeline - no current connection

New 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

Accepted Solutions

Re: beeline - no current connection

Super 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

3 REPLIES 3

Re: beeline - no current connection

Super 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

Re: beeline - no current connection

@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>
Highlighted

Re: beeline - no current connection

New 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.

Don't have an account?
Coming from Hortonworks? Activate your account here