Complete the code to create a Kafka topic named 'my-topic'.
bin/kafka-topics.sh --create --topic [1] --bootstrap-server localhost:9092
The command creates a Kafka topic named my-topic.
Complete the code to create a Kafka topic with 3 partitions.
bin/kafka-topics.sh --create --topic my-topic --partitions [1] --bootstrap-server localhost:9092
The --partitions option sets the number of partitions. Here, 3 partitions are created.
Fix the error in the command to create a topic with replication factor 2.
bin/kafka-topics.sh --create --topic my-topic --partitions 3 --replication-factor [1] --bootstrap-server localhost:9092
The replication factor must be at least 1 and not exceed the number of brokers. Here, 2 is correct.
Fill both blanks to create a topic named 'logs' with 4 partitions.
bin/kafka-topics.sh --create --topic [1] --partitions [2] --bootstrap-server localhost:9092
The topic name is logs and the number of partitions is 4.
Fill all three blanks to create a topic named 'events' with 6 partitions and replication factor 3.
bin/kafka-topics.sh --create --topic [1] --partitions [2] --replication-factor [3] --bootstrap-server localhost:9092
The topic name is events, partitions are 6, and replication factor is 3.
