Bird
0
0

How do you specify the number of partitions when creating a Kafka topic using the command line?

easy📝 Syntax Q3 of 15
Kafka - Topics and Partitions

How do you specify the number of partitions when creating a Kafka topic using the command line?

Akafka-topics.sh --create --topic myTopic --partition-count 3 --bootstrap-server localhost:9092
Bkafka-topics.sh --create --topic myTopic --partitions 3 --bootstrap-server localhost:9092
Ckafka-topics.sh --create --topic myTopic --num-partitions 3 --bootstrap-server localhost:9092
Dkafka-topics.sh --create --topic myTopic --set-partitions 3 --bootstrap-server localhost:9092
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kafka topic creation syntax

    The correct flag to specify partitions is '--partitions'.
  2. Step 2: Analyze options

    Only kafka-topics.sh --create --topic myTopic --partitions 3 --bootstrap-server localhost:9092 uses the correct flag '--partitions' with a valid integer.
  3. Final Answer:

    kafka-topics.sh --create --topic myTopic --partitions 3 --bootstrap-server localhost:9092 -> Option B
  4. Quick Check:

    Use '--partitions' flag to set partition count [OK]
Quick Trick: Use '--partitions' flag to set partition count [OK]
Common Mistakes:
  • Using incorrect flags like --partition-count
  • Using non-numeric values for partitions
  • Confusing '--partitions' with '--num-partitions'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes