Bird
0
0

Which of the following is the correct syntax to create a Kafka topic with 5 partitions using the Kafka CLI?

easy📝 Syntax Q3 of 15
Kafka - Performance Tuning
Which of the following is the correct syntax to create a Kafka topic with 5 partitions using the Kafka CLI?
Akafka-topics.sh --create --topic my-topic --partitions 5 --bootstrap-server localhost:9092
Bkafka-topics.sh --create --topic my-topic --partition-count 5 --bootstrap-server localhost:9092
Ckafka-topics.sh --new --topic my-topic --partitions=5 --server localhost:9092
Dkafka-topics.sh --make --topic my-topic --partitions 5 --bootstrap-server localhost:9092
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kafka CLI topic creation syntax

    The correct flag for partitions is '--partitions' and '--create' is used to create topics.
  2. Step 2: Verify option correctness

    kafka-topics.sh --create --topic my-topic --partitions 5 --bootstrap-server localhost:9092 uses correct flags and server parameter.
  3. Final Answer:

    kafka-topics.sh --create --topic my-topic --partitions 5 --bootstrap-server localhost:9092 -> Option A
  4. Quick Check:

    Correct CLI syntax = kafka-topics.sh --create --topic my-topic --partitions 5 --bootstrap-server localhost:9092 [OK]
Quick Trick: Use --partitions flag to set partition count [OK]
Common Mistakes:
MISTAKES
  • Using incorrect flag names like --partition-count
  • Using --new or --make instead of --create
  • Wrong server flag like --server

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes