# Logstash-Kafka : each data pulled create new session on zookeeper

**URL:** <https://discuss.elastic.co/t/logstash-kafka-each-data-pulled-create-new-session-on-zookeeper/67652>\
**Category:** Logstash\
**Created:** [November 30, 2016, 4:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-each-data-pulled-create-new-session-on-zookeeper/67652 "2016-11-30T16:52:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlotte\_EGM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charlotte_egm/32/13503_2.png) [@Charlotte\_EGM](https://discuss.elastic.co/u/Charlotte_EGM)\
**Post date:** [November 30, 2016, 4:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-each-data-pulled-create-new-session-on-zookeeper/67652/1 "2016-11-30T16:52:07Z")

</div>

Hi,

I have an ELK suite with logstash pulling data from Kafka. Kafka is getting data from Fiware Orion-Cygnus (based on Apache Flume).

Everything is doing well for the 60 first data pushed. Then the connection with Cygnus is interrupted (error logs : "Connection reset by peer").

On the zookeeper side, I have the config of maximum 60 sessions per client. In the logs I see that zookeeper is disconnected because max of 60 sessios is reached.

Here is what happens :

> 2016-11-30 16:28:42,713 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /host:53190  
> 2016-11-30 16:28:42,713 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@854] - Connection request from old client /host:53190; will be dropped if server is in r-o mode  
> 2016-11-30 16:28:42,713 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /host:53190  
> 2016-11-30 16:28:42,714 [myid:] - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x15844781a120334 with negotiated timeout 10000 for client /host:53190

> 2016-11-30 16:29:13,864 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /host:53192  
> 2016-11-30 16:29:13,864 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@854] - Connection request from old client /host:53192; will be dropped if server is in r-o mode  
> 2016-11-30 16:29:13,864 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /host:53192  
> 2016-11-30 16:29:13,866 [myid:] - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x15844781a120335 with negotiated timeout 10000 for client /host:53192

> 2016-11-30 16:29:13,902 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /host:53194  
> 2016-11-30 16:29:13,902 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@854] - Connection request from old client /host:53194; will be dropped if server is in r-o mode  
> 2016-11-30 16:29:13,902 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /host:53194

As you can see, same client (with new port) is establishing a new session when a new data is pulshed to kafka.

I assume it is coming from logstash as the Orion-Cygnus-Kafka config is working well without this problem. It only appears when connecting to ELK suite.

Do you have any idea how can I solve this problem ?  
I found a very similar question [here](http://logstash-users.narkive.com/5BlVuqrD/logstash-kafka-error-closing-socket-and-web-console-consumer-xxxxx) but couldn't manage to make it work by the answer.  
I specified group name but doesn't change anything.

Thanks very much !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 28, 2016, 4:52pm UTC](https://discuss.elastic.co/t/logstash-kafka-each-data-pulled-create-new-session-on-zookeeper/67652/2 "2016-12-28T16:52:10Z")

</div>

Closed on December 28, 2016, 4:52pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
