How to increase zookeeper connection timeout
<p>My <code>Kafka</code> consumer loosing connection to <code>Zookeeper</code> quite often and not able to connect due to connection timeout.</p>

<p>How to fix the issue?</p>

<p>thank you.
Below is the log.</p>

<pre><code>Exception in thread "main" org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 4000
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1223)
at org.I0Itec.zkclient.ZkClient.&lt;init&gt;(ZkClient.java:155)
at org.I0Itec.zkclient.ZkClient.&lt;init&gt;(ZkClient.java:129)
at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:89)
at kafka.utils.ZkUtils$.apply(ZkUtils.scala:71)
at kafka.consumer.ZookeeperConsumerConnector.connectZk(ZookeeperConsumerConnector.scala:181)
at kafka.consumer.ZookeeperConsumerConnector.&lt;init&gt;(ZookeeperConsumerConnector.scala:129)
at kafka.javaapi.consumer.ZookeeperConsumerConnector.&lt;init&gt;(ZookeeperConsumerConnector.scala:65)
at kafka.javaapi.consumer.ZookeeperConsumerConnector.&lt;init&gt;(ZookeeperConsumerConnector.scala:68)
at kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:120)
at kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala)
at com.steelwedge.consumer.JobConsumer.&lt;init&gt;(JobConsumer.java:53)
</code></pre>