Starting ZooKeeper
zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
Start/Stop Kafka after starting up Zoo Keeper
kafka-server-start /usr/local/etc/kafka/server.properties
Creating Topic ‘Test’
open a terminal:
kafka-topics –create –zookeeper localhost:2181 -replication-factor 1 –partitions 1 –topic test
Creating Consumer
open a terminal:
kafka-console-consumer –bootstrap-server localhost:9092 –topic test –from-beginning
we wait for the producers to produce for topic ‘test’
Produce for our topic Test
kafka-console-producer –broker-list localhost:9092 –topic test
> haha
> hehe
> hoho
Now in your consumer terminal, you should see the texts come up