title: Kafka stops after a certain period of time, lost brokers
body: <p>I have 4 kafka  running with debezium. After some days running well, three kafka machines get out of the network for a period of time and, on <code>connectDistributed.out</code> log file I have a lot of messages with the following error:</p>
  
  <pre><code>[2020-05-04 13:27:02,526] WARN [Consumer clientId=connector-consumer-sink-warehouse-6, 
  groupId=connect-sink-warehouse] 133 partitions have leader brokers without a matching listener,
   including [SCT010-2, SC2010-2, SC1010-0, SC1010-1, SF4010-0, SUB010-0, SUB010-1, SWP010-0, 
  SWP010-1, ACO010-2] (org.apache.kafka.clients.NetworkClient:1044)
  </code></pre>
  
  <p>I have 4 Kafka machines, brokers from 0 to 3</p>
  
  <pre><code>192.168.240.70 - Broker 0
  192.168.240.71 - Broker 1
  192.168.240.72 - Broker 2
  192.168.240.73 - Broker 3
  </code></pre>
  
  <p>Zookeeper: </p>
  
  <p><code>192.168.240.70</code></p>
  
  <p>Follow my <code>server.properties</code> - There are the same, except the <code>listeners</code>, <code>advertised.listeners</code> that points for the same IP of the machine that Kafka is installed and <code>broker.id</code> that must be unique (from 0 to 3):</p>
  
  <pre><code>broker.id=0
  listeners=CONTROLLER://192.168.240.70:9091,INTERNAL://192.168.240.70:9092
  advertised.listeners=CONTROLLER://192.168.240.70:9091,INTERNAL://192.168.240.70:9092
  listener.security.protocol.map=CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT
  control.plane.listener.name=CONTROLLER
  inter.broker.listener.name=INTERNAL
  num.network.threads=3
  num.io.threads=8
  socket.send.buffer.bytes=102400
  socket.receive.buffer.bytes=102400
  socket.request.max.bytes=104857600
  log.dirs=/home/william/kafka/data/kafka/
  num.partitions=3
  num.recovery.threads.per.data.dir=1
  offsets.topic.replication.factor=3
  transaction.state.log.replication.factor=3
  transaction.state.log.min.isr=1
  log.retention.hours=150
  log.retention.bytes=200000000000
  log.segment.bytes=1073741824
  log.retention.check.interval.ms=300000
  
  zookeeper.connect=192.168.240.70:2181
  zookeeper.connection.timeout.ms=6000
  group.initial.rebalance.delay.ms=3
  </code></pre>
  
  <p>The kafka topics (configs/offsets and status) shows problems in replication. There are some related with listeners config?</p>
  
  <p><a href="https://i.stack.imgur.com/NEwha.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NEwha.png" alt="kafka manager under replicated info"></a></p>
  
  <p>About the connectors health:</p>
  
  <p><a href="https://i.stack.imgur.com/48O0k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48O0k.png" alt="connectors health on kafka connect"></a></p>
  
  <p>And, on kafka connect. only one broker are presented:</p>
  
  <p><a href="https://i.stack.imgur.com/TbvSs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TbvSs.png" alt="kafka brokers"></a></p>
  
  <p>How can I fix this error? Seems to be something related to leader election or finding the leader after a long time without broker access.</p>