Created on 03-28-2017 11:13 AM - edited 09-16-2022 04:21 AM
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.
Created 03-28-2017 11:49 AM
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
Created 03-29-2017 10:33 AM
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.