KAFKA commands - 1
A) Create KAFKA Topics
Command Format
#kafka-topics --create --topic [TOPIC NAME] --zookeeper [ZOOKEEPER HOSTNAME] --replication-factor [NUMBER OF REPLICAS] --partitions [NUMBER OF PARTITIONS]
Example:
#kafka-topics --create --topic mytesttopic --zookeeper myzkhost.cluster.com --replication-factor 2 --partitions 3
Here:-
[TOPIC NAME = the name of the topic which is to be created ],
[ZOOKEEPER HOSTNAME = zookeeper hostname ]
[NUMBER OF REPLICAS = number of replications for each partitions, It should not be greater than the number of Brokers ]
[NUMBER OF PARTITIONS = Number of partitions for a topic ]
B) Describe a topic
Command Format
#kafka-topics --describe --topic [ TOPIC NAME ] --zookeeper [ZOOKEEPER HOSTNAME ]
Example
#kafka-topics --describe --topic mytesttopic --zookeeper myzkhost.cluster.com
Topic:mytesttopic PartitionCount:3 ReplicationFactor:2 Configs:
Topic: mytesttopic Partition: 0 Leader: 10 Replicas: 10,30 Isr: 10,30
Topic: mytesttopic Partition: 1 Leader: 20 Replicas: 20,10 Isr: 20,10
Topic: mytesttopic Partition: 2 Leader: 30 Replicas: 30,20 Isr: 30,20
Leader = Leader partition residing on the particular broker ID
Replicas= Other brokers where the particular partition copies are hosted
ISR= In-Sync-Replicas, (the brokers which hosts the In-Sync copy of the same partition)
Comments
Post a Comment