Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 628 Bytes

kafka.md

File metadata and controls

11 lines (7 loc) · 628 Bytes

Create a new topic in Kafka

kafka-topics --create --zookeeper {{ZOOKEEPER_URL}} --replication-factor {{REPLICATION_FACTOR}} --partitions {{PARTITIONS}} --topic {{TOPIC_NAME}}

  • ZOOKEEPER_URL: Zookeeper URL or IP:PORT
  • REPLICATION_FACTOR: Internal topic creation will fail until the cluster size meets this replication factor requirement.
  • PARTITIONS: Each partition is an ordered, immutable sequence of records that is continually appended to—a structured commit log.

Example

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test_raw