This error occurs when creating topic. Create command:
[hw@node01 bin]$ ./kafka-topics.sh --create --topic first --zookeeper node01:2181 --partitions 3 --replication-factor 1
The error is as follows:;
Error while executing topic command : Replication factor: 3 larger than available brokers: 0. [2022-02-26 15:55:45,948] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 3 larger than available brokers: 0. (kafka.admin.TopicCommand$)
Error reason: the problem occurs because the path stored by Kafka # broker in zookeeper is not the root directory, but the/Kafka # path
You can start the client of zookeeper to view the broker path of Kafka:
$ bin/zkCli.sh #Go to the client to view the path details $ ls -R /
Therefore, modify the command that you create Topic:
[hw@node01 bin]$ ./kafka-topics.sh --create --topic first --zookeeper node01:2181/kafka --partitions 1 --replication-factor 3
Similar Posts:
- Kafka creates topic error: org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.
- zookeeper is not a recognized option [How to Solve]
- Kafka startup error & problem solving
- kafka java.net.ConnectException: Connection timed out: no further information
- kafka java.net.ConnectException: Connection timed out: no further information
- Solution of failed tosend message exception in Kafka
- Zookeeper link error keepererrorcode = nodeexists for
- [Solved] Received subscribe acknowledgement with invalid QoS values from the broker
- [Solved] zookeeper deletes a directory node Error: authentication is not valid: /HBase/tokenauth
- An error is reported when zookeeper starts (the data directory permission is incorrect)