Created on 10-19-2015 09:01 AM - edited 09-16-2022 02:44 AM
I've followed the Getting Started Guide, everything OK, and now I need to connect to Hive cluster via JDBC.
I have the following configuration:
Manager Node (cloudera1) 52.6.221.164
Worker Node 1 (cloudera2) 52.22.58.113
Worker Node 2 (cloudera3) 54.175.19.19
Worker Node 3 (cloudera4) 54.175.18.49
I have the following connection string:
jdbc:hive://52.22.58.113:10000/default;user=my_user;password=my_psw
When trying to establish a connection, the following exception is thrown by the driver:
[Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication: java.net.ConnectException: Connection refused: connect.
What's the right pair IP address - TCP port that I should use to connect?
Thank you
cghersi
Created 10-19-2015 03:11 PM
The JDBC string might be a bit different for Hive Server 2, actually. This is what used to be used when Beeline (CLI JDBC client) was used instead of Hue for some steps in the tutorial:
beeline -u jdbc:hive2://[Manager Node IP Address]:10000/default -n admin -d org.apache.hive.jdbc.HiveDriver
The `-n admin` may not be correct to use in this case, but perhaps /default is what's required for your JDBC connection string?
Created 10-19-2015 10:38 AM
Reposting as it looks like my reply via email was made into a new thread:
If you're connecting to Impala, use the IP address of one of the Worker
Nodes, and use this query string:
jdbc:hive2://**:21050/;auth=noSasl
If you're connecting to Hive, then use the IP address of the Manager Node
and port 10000.
Because there isn't anything about the authentication for these services
that is configured beyond the default, these ports are blocked from
machines outside the cluster. If you want to connect from outside the
cluster, you will need to look up the Network ACL for your CloudFormation
stack, and edit that Network ACL to allow access on the ports you're using.
Created 10-19-2015 11:13 AM
Hi Sean,
thank you for your reply.
I tried to connect to the manager, unfortunately in this case the program get stuck in the DriverManager.getConnection() method.
I triple-checked the ACL rules and the TCP port 10000 is allowed, as well as 21050 of Impala. for Impala everything works, for Hive it doesn't.
Any other idea?
If you want you can contact me at cristiano.ghersi _at_ plat.one
Thank you very much
cghersi
Created 10-19-2015 03:11 PM
The JDBC string might be a bit different for Hive Server 2, actually. This is what used to be used when Beeline (CLI JDBC client) was used instead of Hue for some steps in the tutorial:
beeline -u jdbc:hive2://[Manager Node IP Address]:10000/default -n admin -d org.apache.hive.jdbc.HiveDriver
The `-n admin` may not be correct to use in this case, but perhaps /default is what's required for your JDBC connection string?
Created 10-20-2015 06:38 AM
Hi Sean.
Finally the connection has been successful with the hive2 driver.
Thank you so much!
cghersi