Unable to connect to beeline

I am trying to connect to beeline. It throws the following error.

[nikhilvemula@gw02 ~]$ hostname -f
gw02.itversity.com
[nikhilvemula@gw02 ~]$ beeline
Beeline version 1.2.1.spark2 by Apache Hive
beeline> !connect jdbc:hive2://gw02.itversity.com/
Connecting to jdbc:hive2://gw02.itversity.com/
Enter username for jdbc:hive2://gw02.itversity.com/: nikhilvemula
Enter password for jdbc:hive2://gw02.itversity.com/: ********************************
2018-06-19 12:54:17 INFO  Utils:310 - Supplied authorities: gw02.itversity.com
2018-06-19 12:54:17 INFO  Utils:397 - Resolved authority: gw02.itversity.com
2018-06-19 12:54:17 INFO  HiveConnection:203 - Will try to open client transport with JDBC Uri: jdbc:hive2://gw02.itversity.com/
2018-06-19 12:54:17 INFO  HiveConnection:208 - Could not open client transport with JDBC Uri: jdbc:hive2://gw02.itversity.com/
2018-06-19 12:54:17 INFO  HiveConnection:229 - Transport Used for JDBC connection: nullError: Could not open client transport with JDBC Uri: jdbc:hive2://gw02.itversity.com/: Cannot open without port. (state=08S01,code=0)
0: jdbc:hive2://gw02.itversity.com/ (closed)>

@nikhil23 You have to use the host nn01.itversity.com, username scott and password is tiger

!connect jdbc:hive2://nn01.itversity.com:10000
username:scott
password:tiger

PFA for reference

Screenshot%20from%202018-06-20%2011-20-06

Thanks @BaLu_SaI

Is the username and password same for all? or by default ?

was password get changed? I am trying to login same way but not working

Hello @Vikrant_Singh_Rana the host is changed. please use bellow connection URL with username ‘scott’ and password ‘tiger’.

!connect jdbc:hive2://rm01.itversity.com:10000

1 Like

Thanks. I am able to connect now. Just curious to know that why I am not able to see or run any query on Hive tables. probably they are on other server. is it?

I can access to only those tables which are present there in beeline server.

can we also create table on hive using beeline… is there specific settings there?

Hi,
I am trying to connect to hive through beeline using this command:

beeline -u jdbc:hive2://

but its not getting connect properly and throwing errors while executing any command inside it. Pls help with the right way to connect.

Hi @deeptii,

First enter into beeline by just typing beeline
then use the following url to connect to hive

!connect jdbc:hive2://gw02.itversity.com:10000/

1 Like

What is the id and password to connect? If I try to use my DB it is giving permission delined error. I tried Scott

Hi @das.nabarun,

Please use your lab login credentials.

Hello,
I am still not able to connect to Hive even with new hostname. Please help me with what I am doing wrong?

**beeline> !connect jdbc:hive2://gw02.itversity.com:10000/**
Connecting to jdbc:hive2://gw02.itversity.com:10000/
Enter username for jdbc:hive2://gw02.itversity.com:10000/: itv001901
Enter password for jdbc:hive2://gw02.itversity.com:10000/: ********************************
22/03/06 23:20:47 [main]: WARN jdbc.Utils: Could not retrieve canonical hostname for gw02.itversity.com
java.net.UnknownHostException: gw02.itversity.com: Name or service not known
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:1.8.0_282]
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[?:1.8.0_282]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[?:1.8.0_282]
        at java.net.InetAddress.getAllByName0(InetAddress.java:1277) ~[?:1.8.0_282]
        at java.net.InetAddress.getAllByName(InetAddress.java:1193) ~[?:1.8.0_282]
        at java.net.InetAddress.getAllByName(InetAddress.java:1127) ~[?:1.8.0_282]
        at java.net.InetAddress.getByName(InetAddress.java:1077) ~[?:1.8.0_282]
        at org.apache.hive.jdbc.Utils.getCanonicalHostName(Utils.java:701) [hive-jdbc-3.1.2.jar:3.1.2]
        at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:178) [hive-jdbc-3.1.2.jar:3.1.2]
        at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) [hive-jdbc-3.1.2.jar:3.1.2]
        at java.sql.DriverManager.getConnection(DriverManager.java:664) [?:1.8.0_282]
        at java.sql.DriverManager.getConnection(DriverManager.java:208) [?:1.8.0_282]
        at org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.Commands.connect(Commands.java:1641) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.Commands.connect(Commands.java:1536) [hive-beeline-3.1.2.jar:3.1.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
        at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:56) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1384) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1423) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:1287) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1071) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:538) [hive-beeline-3.1.2.jar:3.1.2]
        at org.apache.hive.beeline.BeeLine.main(BeeLine.java:520) [hive-beeline-3.1.2.jar:3.1.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323) [hadoop-common-3.3.0.jar:?]
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236) [hadoop-common-3.3.0.jar:?]
22/03/06 23:20:47 [main]: WARN jdbc.HiveConnection: Failed to connect to gw02.itversity.com:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://gw02.itversity.com:10000/: java.net.UnknownHostException: gw02.itversity.com (state=08S01,code=0)

@nithya_nanda The cluster is upgraded and there is a change in the connection string. Please use the below connection string to connect to the beeline.

!connect jdbc:hive2://m02.itversity.com:10000/;auth=noSasl

1 Like

thank you. this worked :slight_smile: