Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

How to recover the jdbc url of hive from zookeeper mode to direct mode

Explorer

Dear all:

I am using hdp 2.5.0 and enable the hive HA. then the jdbc url connectstring becomes like this.

jdbc:hive2://m1.hdp.local:2181,m2.hdp.local:2181,m3.hdp.local:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2

I can connect to hs2 using the jdbc url connectstring via beeline successfully. but cann't connect to it using finereport/kettle, etc. I think these BI tools don't support the zookeeper mode. But I don't know how to recover the jdbc connect mode from zookeeper mode to direct mode. Can you? By the way, i have already tried to connect to hs2 using jdbc connecstring such as jdbc:hive2://m1.hdp.local:10000/default via beeline. but i didn't work, cann't connect to hs2.

2 REPLIES 2

Contributor

Assuming that you will want to connect in direct, binary transport mode, in a nonsecure env, this is how the jdbc connection string should look like (this is what you have tried):

jdbc:hive2://<host>:<port>/<db>

If your hiveserver runs on m1.hdp.local:10000, and the database name is default, then the connection string you tried should have worked:

jdbc:hive2://m1.hdp.local:10000/default

Since it did not work, I suppose you hiveserver has different port or runs on an other host. You should be able to check these in Ambari.

Please consult to these docs on the various connection modes and corresponding connection strings.

https://community.hortonworks.com/articles/4103/hiveserver2-jdbc-connection-url-examples.html

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-ConnectionUR...

Explorer

THX pbarna,

I have checked all, the host which hiveserver2 runs on is m1.hdp.local and the port is also 10000. Maybe I should reinstall the hive services if i want to recover the jdbc url of hive from zookeeper mode to direct mode.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.