<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94016#M57508</link>
    <description>Hi Nanda,&lt;BR /&gt;&lt;BR /&gt;Are you using Cloudera Manager? If yes, can you go to CM &amp;gt; Hue &amp;gt; Instances &amp;gt; Hue Server &amp;gt; Processes, and then check the hbase-conf/hbase-site.xml and hive-conf/hive-site.xml files and confirm if ZK configurations are set properly there?&lt;BR /&gt;&lt;BR /&gt;Are all Hue instances having the same issue?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Eric</description>
    <pubDate>Wed, 14 Aug 2019 04:03:55 GMT</pubDate>
    <dc:creator>EricL</dc:creator>
    <dc:date>2019-08-14T04:03:55Z</dc:date>
    <item>
      <title>Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94015#M57507</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using Hue--&amp;gt; Hive editor to submit a query on an external table and View created on top an Hbase table. I have 3 instances of Hue running in my cluster(1 among them as Load balancer).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.When a submit a query from Beeline on this external table and View. It works perfectly fine.&lt;/P&gt;
&lt;P&gt;2. When i submit the same query from Hue it doesn't work.(simple query like: select * from hbase_view limit 10)&lt;/P&gt;
&lt;P&gt;3. hbase-site.xml, hive-site.xml all have zookeeper.quorum defined correctly(I have 5 zookeeper server instances, so it has 5 nodes in zookeeper.quorum properties). Clientport:2181. That also looks fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am getting below error in hive-server2.log file when a query is submitted from Hue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of trying to connect to one of the zookeeper host, it is trying to connect to localhost4/127.0.0.1:2181. This is not the case when query runs successfully, it takes any of the zookeeper node for client connection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2019-08-13 22:10:23,353 INFO&amp;nbsp; org.apache.zookeeper.ClientCnxn: [HiveServer2-Background-Pool: Thread-8315-SendThread(localhost4:2181)]: Opening socket connection to server localhost4/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)&lt;/P&gt;
&lt;P&gt;2019-08-13 22:10:23,353 WARN&amp;nbsp; org.apache.zookeeper.ClientCnxn: [HiveServer2-Background-Pool: Thread-8315-SendThread(localhost4:2181)]: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect&lt;/P&gt;
&lt;P&gt;java.net.ConnectException: Connection refused&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2019-08-13 22:10:27,855 ERROR org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper: [HiveServer2-Background-Pool: Thread-8315]: ZooKeeper getData failed after 4 attempts&lt;/P&gt;
&lt;P&gt;2019-08-13 22:10:27,855 WARN&amp;nbsp; org.apache.hadoop.hbase.zookeeper.ZKUtil: [HiveServer2-Background-Pool: Thread-8315]: hconnection-0x5bd726980x0, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server&lt;/P&gt;
&lt;P&gt;org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/meta-region-server&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1151)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Eventually the query fails without even generating a mapreduce application/job:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2019-08-13 22:10:46,572 ERROR org.apache.hadoop.hive.ql.exec.Task: [HiveServer2-Background-Pool: Thread-8315]: Job Submission failed with exception 'org.apache.hadoop.hbase.client.RetriesExhaustedException(Can't get the locations)'&lt;/P&gt;
&lt;P&gt;org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:329)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:157)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:61)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why is it trying to connect to localhost:2181 instead of zookeeper hosts? Any solutions for this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nanda&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 11:36:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94015#M57507</guid>
      <dc:creator>nanda_bigdata</dc:creator>
      <dc:date>2026-04-21T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94016#M57508</link>
      <description>Hi Nanda,&lt;BR /&gt;&lt;BR /&gt;Are you using Cloudera Manager? If yes, can you go to CM &amp;gt; Hue &amp;gt; Instances &amp;gt; Hue Server &amp;gt; Processes, and then check the hbase-conf/hbase-site.xml and hive-conf/hive-site.xml files and confirm if ZK configurations are set properly there?&lt;BR /&gt;&lt;BR /&gt;Are all Hue instances having the same issue?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Eric</description>
      <pubDate>Wed, 14 Aug 2019 04:03:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94016#M57508</guid>
      <dc:creator>EricL</dc:creator>
      <dc:date>2019-08-14T04:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94017#M57509</link>
      <description>&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;I just checked hbase-site.xml,hive-site.xml from CM-&amp;gt;Hue-&amp;gt;Instances-&amp;gt; processes tab as well.&lt;/P&gt;&lt;P&gt;They all look good. Below is an example from hive-site.xml, it is the same in hbase-site.xml as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This problem is not happening on all 3 Hue Web UI, for some users it is working in Hue1 and not working in other two, for some users it works in Hue1 and Hue2, But not in Hue3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a load balanced Hue(recommended one to use among 3 Hue instances) . Here it is not working for 90% of the users including my ID). Are we hitting maximum client connections to Zookeeper (&lt;SPAN&gt;maxClientCnxns=60 in my cluster). If that is the case, I don't even see any errors in zookeeper logs saying "too many connections from &amp;lt;IP_address&amp;gt; max is 60" etc.,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error is same for all users. Unable to submit mapreduce job "can't get locations of Hbase regions/data" and client trying to connect to zookeeper on localhost:2181 instead of actual zookeeper nodes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;name&amp;gt;hive.zookeeper.quorum&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;ZK1,ZK2,ZK3,ZK4,ZK5&amp;lt;/value&amp;gt;
  &amp;lt;/property&amp;gt;
  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;hive.zookeeper.client.port&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;2181&amp;lt;/value&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 04:58:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94017#M57509</guid>
      <dc:creator>nanda_bigdata</dc:creator>
      <dc:date>2019-08-14T04:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94018#M57510</link>
      <description>&lt;P&gt;This is how my zoo.cfg looks :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tickTime=2000&lt;BR /&gt;initLimit=10&lt;BR /&gt;syncLimit=5&lt;BR /&gt;dataDir=/bdp/znode/cdh&lt;BR /&gt;dataLogDir=/bdp/znode/cdh&lt;BR /&gt;clientPort=2181&lt;BR /&gt;maxClientCnxns=60&lt;BR /&gt;minSessionTimeout=4000&lt;BR /&gt;maxSessionTimeout=60000&lt;BR /&gt;autopurge.purgeInterval=24&lt;BR /&gt;autopurge.snapRetainCount=5&lt;BR /&gt;quorum.auth.enableSasl=false&lt;BR /&gt;quorum.cnxn.threads.size=20&lt;BR /&gt;server.1=ZK1:3181:4181&lt;BR /&gt;server.2=ZK2:3181:4181&lt;BR /&gt;server.3=ZK3:3181:4181&lt;BR /&gt;server.4=ZK4:3181:4181&lt;BR /&gt;server.5=ZK5:3181:4181&lt;BR /&gt;leaderServes=yes&lt;BR /&gt;authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider&lt;BR /&gt;kerberos.removeHostFromPrincipal=true&lt;BR /&gt;kerberos.removeRealmFromPrincipal=true&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 04:26:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94018#M57510</guid>
      <dc:creator>nanda_bigdata</dc:creator>
      <dc:date>2019-08-14T04:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94020#M57512</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35763"&gt;@nanda_bigdata&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, could you please also check the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In CM &amp;gt; Hive &amp;gt; Configuration, ensure that the&amp;nbsp;&lt;STRONG&gt;HBase Service&lt;/STRONG&gt; property is set to the existing HBase service&lt;/LI&gt;&lt;LI&gt;In CM &amp;gt; HBase &amp;gt; Instances, ensure you have &lt;STRONG&gt;Gateway&lt;/STRONG&gt; roles assigned to all the hosts in your cluster. If not, add them.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Restart the necessary services and deploy client configuration if you make any changes above and try agian.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;André&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 07:34:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94020#M57512</guid>
      <dc:creator>araujo</dc:creator>
      <dc:date>2019-08-14T07:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper client connecting to localhost:2181 instead of Zookeeper quorum hosts</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94065#M57536</link>
      <description>&lt;P&gt;Hi Andre,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution is right.&lt;/P&gt;&lt;P&gt;But my situation was little different.&lt;/P&gt;&lt;P&gt;Below are the checks and fix I did with cloudera support helping me in the process:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. From Hive-server2 logs we found that one of the Hiveserver2 instance is not talking to zookeeper quorum(only in case of querying Hbase data)&lt;/P&gt;&lt;P&gt;2. Installed Hbase-gateway services on all the Hue instances and Hiveserver2 instances.&lt;/P&gt;&lt;P&gt;3. restart Hbase services and Deploy client configuration.&lt;/P&gt;&lt;P&gt;4. Restart the Hiveserver2 instance which had the problem of trying to connect to localhost:2181 as zookeeper quorum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then tried to submit the query from beeline and Hue . All worked as expected this time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 01:46:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Zookeeper-client-connecting-to-localhost-2181-instead-of/m-p/94065#M57536</guid>
      <dc:creator>nanda_bigdata</dc:creator>
      <dc:date>2019-08-15T01:46:51Z</dc:date>
    </item>
  </channel>
</rss>

