3

I have a kafka installed in my mac last year, which has many topics within the system. Now I upgrade the zookeeper and kafka to the latest version.

by running zookeeper, it is successful

zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties

Then a broker:

kafka-server-start /usr/local/etc/kafka/server.properties

however it comes up with the error

INFO [Admin Manager on Broker 0]: Error processing create topic request CreatableTopic(name='_confluent-license', numPartitions=1, replicationFactor=3, assignments=[], configs=[CreateableTopicConfig(name='cleanup.policy', value='compact'), CreateableTopicConfig(name='min.insync.replicas', value='2')]) (kafka.server.AdminManager)
org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 1.

How would I solve it?

user824624
  • 7,077
  • 27
  • 106
  • 183

2 Answers2

6

A Confluent enterprise license is stored in the _confluent-command topic. This topic is created by default and contains the license that corresponds to the license key supplied through the confluent.license property. So when you're starting the Kafka server it tries to create it with replication-factor of 3 but there is only 1 broker available so it failed.

Set confluent.topic.replication.factor property to 1 in /usr/local/etc/kafka/server.properties file.

Pardeep
  • 945
  • 10
  • 18
  • we shouldn't use this bundle without license ? – Learnis Oct 12 '20 at 13:13
  • 1
    Seems like the default of a assume cluster of 3 is dumb. Further, there are three separate replication factors to set: https://stackoverflow.com/a/62530484/562644 – Ryan Feb 15 '21 at 21:15
1

@Pardeep 's answer worked for me, but for me there were more replication factors to set (I'm using Confluent 6.2.1):

confluent.balancer.topic.replication.factor=1
confluent.durability.topic.replication.factor=1
confluent.license.topic.replication.factor=1
confluent.tier.metadata.replication.factor=1
transaction.state.log.replication.factor=1
offsets.topic.replication.factor=1

You can use findstr (on Windows) or grep (on Unix-based OS) to extract them all from the console output:

kafka-server-start /usr/local/etc/kafka/server.properties | findstr "replication.factor"
bgh
  • 1,986
  • 1
  • 27
  • 36