Search code examples
apache-kafkaaws-msk

AWS MSK (Kafka) LEADER_NOT_AVAIABLE while pushing event to topic


I've provisioned MSK, 2 nodes, while pushing mesage to topic get success but with following warning

 18:33:06.318 [kafka-producer-network-thread | producer-1]
  WARN  o.apache.kafka.clients.NetworkClient - [Producer clientId=producer-1] 
  Error while fetching metadata with correlation id 1: 
  {mytopic=LEADER_NOT_AVAILABLE}

Any ideas why this can be? My first guess I need more than 2 nodes. Thanks.


Solution

  • Reason was in automatic topic creation, when topic created automatically with default replication factor of 1 was applied, when I create topic manualy with correct replication factor 3 (same as nodes count) problem went away.