When deploying Kafka clusters with less than three nodes the default value of 3 for offsets.topic.replication.factor prohibits users from reading any values from topics.
Writing works fine, if topics are created with few enough partitions - or auto-created which observes available broker count for the replication factor.
But when reading for the first time, Kafka internally tries to create the __consumer_offsets topic, and this is required to have three partitions by default. And until this has been created no read requests are allowed.
The broker simply keeps logging
kafka [2023-05-05 15:20:39,078] INFO [Admin Manager on Broker 1001]: Error processing create topic request CreatableTopic(name='__consumer_offsets', numPartitions=50, replicationFactor=3, assignments=[], configs=[CreateableTopicConfig(name='compression.type', value='producer'), CreateableTopicConfig(name='cleanup.policy', value='compact'), CreateableTopicConfig(name='segment.bytes'
kafka org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 1.
Possible solutions are:
- documentation - this is not strictly speaking a bug, but also not nice
- catch it during validation in the operator and log an error
- automatically set this in the config when deploying less than 3 brokers
- ...
When deploying Kafka clusters with less than three nodes the default value of 3 for offsets.topic.replication.factor prohibits users from reading any values from topics.
Writing works fine, if topics are created with few enough partitions - or auto-created which observes available broker count for the replication factor.
But when reading for the first time, Kafka internally tries to create the
__consumer_offsetstopic, and this is required to have three partitions by default. And until this has been created no read requests are allowed.The broker simply keeps logging
Possible solutions are: