Hi Ali, Try changing the default value for the streams producer retries to something large, since the default is 0 (which means that if a broker is temporarily down, streams would give that error), e.g., :
final Properties props = new Properties(); props.put(StreamsConfig.APPLICATION_ID_CONFIG, ID); ... props.put(ProducerConfig.RETRIES_CONFIG, 10); Note that the default is now changed in 0.10.2.1 (which is being voted on). While you're there, another important config we changed in 0.10.2.1 is max.poll.interval.ms, so I'd recommend changing that too. This is to avoid rebalancing during long state recoveries: props.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, Integer.toString(Integer.MAX_VALUE)); Thanks Eno > On 8 Apr 2017, at 03:54, Ali Akhtar <[email protected]> wrote: > > I have a 3 node kafka cluster which is being managed via kubernetes, in > docker containers. > > Recently, one of the 3 nodes went down, and was automatically re-created by > kubernetes. > > However, now whenever I try to consume from one of my Kafka topics, thru > Kafka Streaming, i get the error: > >> 6687 [StreamThread-1] WARN org.apache.kafka.clients.NetworkClient - > Error while fetching metadata with correlation id 1 : > {my_topic=LEADER_NOT_AVAILABLE} > >> org.apache.kafka.streams.errors.StreamsException: Topic not found during > partition assignment: my_topic > > When I tried to re-create the topic via 'kafka-topics.sh --create', I > received: > >> Error while executing topic command : Topic "my_topic" already exists. > > Any ideas what's going on here, and how to have Kafka recover from a node > going down and automatically elect a new leader?
