Bird
0
0

Which of the following is the correct syntax to create a Kafka topic named logs with 2 partitions and replication factor 1?

easy📝 Syntax Q3 of 15
Kafka - Topics and Partitions
Which of the following is the correct syntax to create a Kafka topic named logs with 2 partitions and replication factor 1?
Akafka-topics.sh --create --topic logs --partitions 2 --replication-factor 1
Bkafka-topics.sh --create --topic logs --partition 2 --replicas 1
Ckafka-topics.sh --new --topic logs --partitions 2 --replication 1
Dkafka-topics.sh --create --topic logs --partitions=2 --replication-factor=1
Step-by-Step Solution
Solution:
  1. Step 1: Check correct flags and syntax

    The correct flags are '--partitions' and '--replication-factor' without '=' signs.
  2. Step 2: Validate the command structure

    kafka-topics.sh --create --topic logs --partitions 2 --replication-factor 1 uses correct flags and syntax to create the topic with 2 partitions and replication factor 1.
  3. Final Answer:

    kafka-topics.sh --create --topic logs --partitions 2 --replication-factor 1 -> Option A
  4. Quick Check:

    Correct syntax uses --partitions and --replication-factor [OK]
Quick Trick: Use --partitions and --replication-factor without '=' for topic creation [OK]
Common Mistakes:
  • Using --partition instead of --partitions
  • Adding '=' signs in flags
  • Using invalid flags like --replicas

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes