Bird
0
0

Which of the following is the correct syntax to create a Kafka topic named 'logs' with 3 partitions using the Kafka CLI?

easy📝 Syntax Q3 of 15
Kafka - Basics and Event Streaming
Which of the following is the correct syntax to create a Kafka topic named 'logs' with 3 partitions using the Kafka CLI?
Akafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092
Bkafka-create-topic --name logs --partitions 3
Ccreate topic logs with partitions=3
Dkafka-topics --new --topic logs --partitions=3
Step-by-Step Solution
Solution:
  1. Step 1: Recall Kafka CLI topic creation syntax

    The correct command uses 'kafka-topics --create' with '--topic', '--partitions', and '--bootstrap-server' flags.
  2. Step 2: Check each option

    kafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 matches the correct syntax; others use invalid commands or flags.
  3. Final Answer:

    kafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 -> Option A
  4. Quick Check:

    Kafka topic creation syntax = kafka-topics --create --topic logs --partitions 3 --bootstrap-server localhost:9092 [OK]
Quick Trick: Use kafka-topics --create with --topic and --partitions [OK]
Common Mistakes:
  • Using wrong command like kafka-create-topic
  • Omitting --bootstrap-server flag
  • Incorrect flag names or syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes