Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Connect hive with zookeeper in java

avatar
New Member

String url = "jdbc:hive2://huge-agent02:10000/";

Class.forName(driverName);

conn =(Connection) DriverManager.getConnection(url, "hive", "hive");

when i replace url to zookeeper url (jdbc:hive2://huge-server:2181,huge-agent02:2181,huge-agent01:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2), it can not connected hive,why?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Ye Jun

Are you passing the driverName as "org.apache.hive.jdbc.HiveDriver" ?

Also when you say with the mentioned url it can not connect .... does it mean that you are getting any error? Or is it getting hung for a long time?

Are the host names resolvable from the host where you are running the code?

Example: (from Client machine)

# telnet huge-server  2181
# telnet huge-agent02  2181
# telnet huge-agent01 2181

.

View solution in original post

10 REPLIES 10

avatar
New Member

@Jay SenSharma, can you tell the exact version where this issue was fixed i am currently using 2.4.0.0-169, when if i use 1.2.1000.2.5.0.0-1245, i am getting other errors like hiveserver2 not starting or some zookeeper error. is this https://issues.apache.org/jira/browse/HIVE-11581