Kafka useful commands on Macbook or linux
Start up the Zookeeper. ./zookeeper-server-start.sh ../config/zookeeper.properties Add the below properties in the server.properties listeners=PLAINTEXT://localhost:9092auto.create.topics.enable=false Start up the Kafka Broker ./kafka-server-start.sh ../config/server.properties How to create a topic ? ./kafka-topics.sh –create –topic test-topic –bootstrap-server localhost:9092 –replication-factor 1 –partitions 4 Output: Created topic test-topic. Describe Topic command ./kafka-topics.sh –describe –topic test-topic –bootstrap-server localhost:9092 output: Topic: test-topic TopicId: O-uBj0D_R6aMhKMsTUgqhg PartitionCount: 4 ReplicationFactor: 1 Configs: segment.bytes=1073741824 Topic: test-topic. Partition: 0 Leader: 0. Replicas: 0. Isr: 0 Topic: test-topic. Partition: 1. Leader: 0. Replicas: 0. Isr: 0 Topic: test-topic. Partition: 2. Leader: 0. Replicas: 0. Isr: 0 Topic: test-topic. Partition: 3. Leader: 0. Replicas: 0. Isr: 0 How ...