Bird
0
0

You tried to create a topic with this command:

medium📝 Debug Q14 of 15
Kafka - Topics and Partitions
You tried to create a topic with this command:
kafka-topics.sh --create --topic logs --partitions two --replication-factor 3 --bootstrap-server localhost:9092

What is the error?
AMissing --create flag
BInvalid number for partitions: 'two' should be a number
CReplication factor cannot be 3
DBootstrap server address is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check partitions parameter

    The partitions option expects a number, but 'two' is a word, causing a syntax error.
  2. Step 2: Verify other parameters

    Replication factor 3 and bootstrap server are valid; --create flag is present.
  3. Final Answer:

    Invalid number for partitions: 'two' should be a number -> Option B
  4. Quick Check:

    Partitions must be numeric [OK]
Quick Trick: Partitions must be numeric, not words [OK]
Common Mistakes:
  • Using words instead of numbers for partitions
  • Assuming replication factor 3 is invalid
  • Forgetting --create flag

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes