title: HIVE HA via zookeeper (JDBC)
body: <p>I appreciate every help, thank you!
  I'm using Hive HA via zookeeper, this is my hive-site.xml (HA part):</p>
  
  <pre><code>&lt;property&gt;
    &lt;name&gt;hive.server2.support.dynamic.service.discovery&lt;/name&gt;
    &lt;value&gt;true&lt;/value&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.server2.zookeeper.namespace&lt;/name&gt;
    &lt;value&gt;hiveserver2&lt;/value&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.zookeeper.quorum&lt;/name&gt;
    &lt;value&gt;hadoopcluster01:2181,hadoopcluster02:2181&lt;/value&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.zookeeper.client.port&lt;/name&gt;
    &lt;value&gt;2181&lt;/value&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>When I'm using beeline:</p>
  
  <pre><code> !connect jdbc:hive2://hadoopcluster01:2181,hadoopcluster02:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
  </code></pre>
  
  <p>It's perfectly works!</p>
  
  <p>When I'm using cloudera jdbc (v: 2.5.15) connect to a single hiveserver2:</p>
  
  <pre><code>Class.forName("com.cloudera.hive.jdbc41.HS2Driver");
  DriverManager.getConnection("jdbc:hive2://hadoopcluster01:10000", prop);
  </code></pre>
  
  <p>It's perfectly works!</p>
  
  <p>But when I try to connect to zookeeper via jdbc:</p>
  
  <pre><code>Class.forName("com.cloudera.hive.jdbc41.HS2Driver");
  DriverManager.getConnection("jdbc:hive2://zk=hadoopcluster01:2181,hadoopcluster02:2181/hiveserver2", prop);
  </code></pre>
  
  <p>not work:</p>
  
  <pre><code>[2015-11-11 09:35:29.426] boot - 5832  INFO [main] --- ZooKeeper: Initiating client connection, connectString=hadoopcluster01:2181 sessionTimeout=3000 watcher=com.cloudera.hive.hivecommon.api.ZookeeperDynamicDiscovery$1@74455848
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main-SendThread(hadoopcluster01.nebu.local:2181)] --- ClientCnxn: Opening socket connection to server hadoopcluster01.nebu.local/192.168.99.71:2181. Will not attempt to authenticate using SASL (unknown error)
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main] --- ZooKeeper: Initiating client connection, connectString=hadoopcluster02:2181 sessionTimeout=3000 watcher=com.cloudera.hive.hivecommon.api.ZookeeperDynamicDiscovery$1@4e7912d8
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main-SendThread(hadoopcluster01.nebu.local:2181)] --- ClientCnxn: Socket connection established to hadoopcluster01.nebu.local/192.168.99.71:2181, initiating session
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main-SendThread(hadoopcluster02.nebu.local:2181)] --- ClientCnxn: Opening socket connection to server hadoopcluster02.nebu.local/192.168.99.72:2181. Will not attempt to authenticate using SASL (unknown error)
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main-SendThread(hadoopcluster02.nebu.local:2181)] --- ClientCnxn: Socket connection established to hadoopcluster02.nebu.local/192.168.99.72:2181, initiating session
  [2015-11-11 09:35:29.426] boot - 5832  INFO [main-SendThread(hadoopcluster01.nebu.local:2181)] --- ClientCnxn: Session establishment complete on server hadoopcluster01.nebu.local/192.168.99.71:2181, sessionid = 0x150f58353570006, negotiated timeout = 6000
  [2015-11-11 09:35:29.457] boot - 5832  INFO [main-SendThread(hadoopcluster02.nebu.local:2181)] --- ClientCnxn: Session establishment complete on server hadoopcluster02.nebu.local/192.168.99.72:2181, sessionid = 0x250f582c7990001, negotiated timeout = 6000
  [2015-11-11 09:35:29.457] boot - 5832  INFO [main] --- ZooKeeper: Session: 0x250f582c7990001 closed
  [2015-11-11 09:35:29.457] boot - 5832  INFO [main-EventThread] --- ClientCnxn: EventThread shut down
  java.sql.SQLException: [Cloudera][HiveJDBCDriver](500170) Error occured while setting up Zookeeper Dynamic Discovery: [Cloudera][HiveJDBCDriver]Error Occured Connecting to ZooKeeper: At: hadoopcluster01:2181 With Error Message: Path length must be &gt; 0..
      at com.cloudera.hive.hivecommon.api.ZooKeeperEnabledExtendedHS2Factory.createClient(Unknown Source)
      at com.cloudera.hive.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
      at com.cloudera.hive.hive.core.HiveJDBCConnection.connect(Unknown Source)
      at com.cloudera.hive.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
      at com.cloudera.hive.jdbc.common.AbstractDriver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:664)
      at java.sql.DriverManager.getConnection(DriverManager.java:208)
      at com.nebu.nldpconnection.main.NLDPConnectionTest.getConnection(NLDPConnectionTest.java:81)
      at com.nebu.nldpconnection.main.NLDPConnectionTest.run(NLDPConnectionTest.java:214)
      at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:677)
      at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:695)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
  Caused by: com.cloudera.hive.support.exceptions.GeneralException: [Cloudera][HiveJDBCDriver](500170) Error occured while setting up Zookeeper Dynamic Discovery: [Cloudera][HiveJDBCDriver]Error Occured Connecting to ZooKeeper: At: hadoopcluster01:2181 With Error Message: Path length must be &gt; 0..
      ... 14 more
  </code></pre>