Support Questions
Find answers, ask questions, and share your expertise

hive connection with connect string jdbc

Highlighted

hive connection with connect string jdbc

34506-screenshot-from-2017-08-28-091244.png

Hello,

I tried to connect to hive using jdbc but i had the following error:

Service Hive check failed: Cannot open a hive connection with connect string jdbc:hive2://tcb-inspiron-5559:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;hive.server2.proxy.user=admin

I will be thankfull for your help.

thanks

4 REPLIES 4
Highlighted

Re: hive connection with connect string jdbc

Super Mentor

@salma zegdene

Please check if the Hostname "tcb-inspiron-5559:2181" is a correct FQDN? and is it reachable form the ambari server hsot?

Example: Login to the host "tcb-inspiron-5559" using SSH and then run the following command to verify of its FQDN is correct?

# hostname -f
# service iptables status
# service iptables stop

.

Also from the ambari server host try to connect to the host & port 2181 as following to see that there is no N/W or Firewall issue.

# telnet  tcb-inspiron-5559  2181
(OR)
# nc -v  tcb-inspiron-5559  2181

.

If you are not able to connect the Zookeeper instance then please double check if your Zookeeper is running fine and accessible on that host? Please check the following command output on host "tcb-inspiron-5559"

# ps -ef | grep zookeeper
# netstat -tnlpa | grep `cat /var/run/zookeeper/zookeeper_server.pid`


.

Also please let us know if this is a kerberized environment or Non kerberized. If it is kerberized cluster then please check if you are following the instructions for kerberized cluster Hive view :

https://community.hortonworks.com/articles/40658/configure-hive-view-for-kerberized-cluster.html

https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.2.0/bk_ambari-views/content/section_kerberos_se...

.

Highlighted

Re: hive connection with connect string jdbc

Super Mentor

@salma zegdene

Additionally can you please check and share the "/var/log/ambari-server/ambari-server.log" as soon as you see the mentioned error on HIve View UI. I guess we should see a more detailed stackTrace of the error inside either "ambari-server.log" or inside the view specific log file "/var/log/ambari-server/hive-next-view/hive-view.log".

.

Highlighted

Re: hive connection with connect string jdbc

Expert Contributor

Please check ambari user ownership oh hdfs

hdfs dfs -chown admin:hadoop /user/admin

Re: hive connection with connect string jdbc

Expert Contributor

For future readers, this problem/symptom can occur due to hive.exec.scratchdir creating too many subdirectories. In one case, I had over 1,400,000 subdirectories under /tmp/hive

To fix:

  • hdfs dfs -rm -r /tmp/hive/*
  • Restart Hive from Ambari
  • Test Hive View