Support Questions

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

unable to connect thrift server using beeline

avatar
Explorer

when am connecting to thrift server using beeline it's showing  below error

Beeline version 1.2.1.spark2 by Apache Hive
beeline> !connect jdbc:hive2://host:10000
Connecting to jdbc:hive2://host:10000
Enter username for jdbc:hive2://host:10000: admin-sbarik2
Enter password for jdbc:hive2://host:10000: ********
org/apache/hive/service/cli/thrift/TCLIService$Iface
0: jdbc:hive2://host:10000 (closed)>

 

it's automatically closed.

1 ACCEPTED SOLUTION

avatar
Explorer

actually in oracle Database previously am not entry  my user id and password 

after entry the same connection is established. It's a minor issue

 

thanks for your support.

 

View solution in original post

20 REPLIES 20

avatar
Master Mentor

@soumya 

 

Spark SQL is Spark’s interface for working with structured and semi-structured data so it is not what I asked Hive Metastore uses  Mysql; MariaDB, SQL Server, Oracle etc for its metastore !!
If you can't provide infor requested it will be difficult to help you out!

avatar
Explorer

when am giving below connect ion string showing below error

beeline> !connect jdbc:hive2//awshv2200:10000
scan complete in 0ms
19/10/21 03:40:04 ERROR ClassNameCompleter: Fail to parse the class name from the Jar file due to the exception:java.io.FileNotFoundException: minlog-1.2.jar (No such file or directory)
19/10/21 03:40:04 ERROR ClassNameCompleter: Fail to parse the class name from the Jar file due to the exception:java.io.FileNotFoundException: objenesis-1.2.jar (No such file or directory)
19/10/21 03:40:04 ERROR ClassNameCompleter: Fail to parse the class name from the Jar file due to the exception:java.io.FileNotFoundException: reflectasm-1.07-shaded.jar (No such file or directory)
scan complete in 553ms
No known driver to handle "jdbc:hive2//awshv2200:10000"

 

 

please note as my configuration in hive-site.xml the transport mode is binary

can you share me the the connection string when transport mode is binary 

am using same same host i;e 

am currently login with host awshv2200 and my spark thrift server host is awshv2200 and port no-10000

avatar
Explorer

please find the configuration

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>oracle.jdbc.OracleDriver</value>
</property>

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:oracle:thin:@DFJHNNJHJUUI:4355:KKJH0033</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>

 

please share your suggestion what need to check and configuration 

avatar
Master Mentor

@soumya 

 

From your property files, your backend database is Oracle! There is something very weird about the information you are sharing with members that's why we can't resolve your problem?

Can you get the value of your hive-site.xml "javax.jdo.option.ConnectionURL" that should confirm oracle

All along you claimed you were using MySQL database for your metastore? But the connect string to an oracle database is different,here is the syntax for connecting

"jdbc:oracle:thin:@localhost/remote_host:port:db_name"  so according to your shared  hive-site.xml  correct connect is 

"jdbc:oracle:thin:@DFJHNNJHJUUI:4355:KKJH0033"

"jdbc:oracle:thin:@<hoostname[DFJHNNJHJUUI]>:port[4355]:db_name[KKJH0033]

Else connecting  Direct - Binary Transport Mode example below
beeline -n hive -p hive -u "jdbc:hive2://osaka.com:10000/sparktest" 

Ranger_using_Mysql_dbRanger_using_Mysql_db

 

Hs2 mode portsHs2 mode ports

 

Connecting to my Sparktest databaseConnecting to my Sparktest database

 

Hive_using_Mysql_metastoreHive_using_Mysql_metastore

 

Please clarify

avatar
Explorer

Thanks for your support but no luck facing same issue connection closed automatically.

 

can you help me for an important shell script

write a shell script to connect spark thrift server using beeline...

 

request you please share the syntax .....

avatar
Explorer

As per you previous conversation

All along you claimed you were using MySQL database for your metastore? But the connect string to an oracle database is different,here is the syntax for connecting

"jdbc:oracle:thin:@localhost/remote_host:port:db_name"  so according to your shared  hive-site.xml  correct connect is 

"jdbc:oracle:thin:@DFJHNNJHJUUI:4355:KKJH0033"

"jdbc:oracle:thin:@<hoostname[DFJHNNJHJUUI]>:port[4355]:db_name[KKJH0033]

Else connecting  Direct - Binary Transport Mode example below
beeline -n hive -p hive -u "jdbc:hive2://osaka.com:10000/sparktest" 

-----------------------------------------------------------------------------------------------------------------------------

as per my current configuration file

<configuration>

<!-- hnj ThriftServer authentication ldap -->
<property>
<name>hive.server2.authentication</name>
<value>LDAP</value>
</property>
<property>
<name>spark.sql.hive.thriftServer.adf.authenticationProvider</name>
<value>com.dmz.adf.analyze.spark2adf.thriftserver.auth.hnzLdapAuthenticationProvider</value>
</property>

2. am using 10000 port 

3. connection url is "jdbc:oracle:thin:@DFJHNNJHJUUI:4355:KKJH0033" and also i have user id and password 

4. Transport mode is binary

5. my thrift srver host is (awsdev3344 )

am using awsdev3344 server for connection to thrift server (awsdev3344 ) using beeline 

am using below connection string 

Beeline version 1.2.1.spark2 by Apache Hive
beeline>!connect jdbc:hive2://awsdev3344 :10000 

but  connection is closed automatically.

i already share you the connection details please share the connection string transport mode is binary so that i can process

 

 

avatar
Expert Contributor

Hi @soumya,

 

It seems there is some confusion here.

As per my understanding, you are trying to connect to Spark Thrift Server via beeline. Please correct me, if I am wrong.

 

You you to be able to connect to Spark Thrift server via beeline, you need to make sure you are providing the correct hostname and portnumber in the JDBC URL you are using in the beeline.

 

For example:

jdbc:hive2://host:portnumber/

 

Here, the "host" will be the Hostname of the server where Spark Thriftserver is running.

Let us say it is running on abc.soumya.com.

The default portnumber for Spark Thriftserver is 10000.

But this portnumber can be configured to something else as well. You need to find the correct portnumber.

 

Thus, you connect string would look like below:

jdbc:hive2://abc.soumya.com:10000/

 

You can refer the below link for more information on this:

https://spark.apache.org/docs/latest/sql-distributed-sql-engine.html

avatar
Explorer

Hi 

THANKS FOR THE INFO.

ISSUE RESOLVE .

 

avatar
Master Mentor

@soumya 

Good to hear that can you share what solution worked for you this way other who encounter the same problem can quickly resolve it.

Thats what we csll community contribution 

Happy hadooping

 

avatar
Expert Contributor

Hi @soumya,

 

Can you please confirm exactly how the issue was resolved.

Please do accept the answer which helped you.