I am referring to a book on Kafka. To create a Kafka topic, it states:
Using the command line utility for creating topics on the Kafka server, let’s create a topic named replicated-kafkatopic with two partitions and two replicas:
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic replicated-kafkatopic
While text states to create 2 partitions and 2 replicas, arguments passed are: 3 for replication-factor and 1 for partitions.
Are arguments correct in context of what text states?
No, it must be a typo. If you want to create a topic with two partitions and two replicas, the command should be as follows:
kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 2 --partitions 2 --topic replicated-kafkatopic
The command that you have provided, creates a topic replicated-kafkatopic with 1 partition (--partitions 1) and 3 replicas (--replication-factor 3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With