Step by step run Kafka on Mac

1
2
3
4
5
6
terrence@igloo /usr/local/kafka
15:51:25 πœ† diff config/server.properties config/server.properties.orig
31c31
< listeners=PLAINTEXT://localhost:9092
---
> #listeners=PLAINTEXT://:9092
  • Start Zookeeper
1
igloo:kafka root# bin/zookeeper-server-start.sh config/zookeeper.properties
  • Start Kafka
1
igloo:kafka root# bin/kafka-server-start.sh config/server.properties
  • Create a new Kafka topic named β€œtest”
1
igloo:kafka root# bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
  • Initialise Producer in Console
1
2
3
4
5
terrence@igloo /usr/local/kafka_2.12-2.1.0
16:04:19 πœ† bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
>Hello World
>Wow
>
  • Initialize Consumer in Console to receive the messages
1
2
3
4
terrence@igloo /usr/local/kafka_2.12-2.1.0
16:06:11 πœ† bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
Hello World
Wow

Run Kafka Manager, an UI tool for managing Kafka.

1
2
terrence@igloo ~/bin/kafka-manager-1.3.3.18
16:16:47 πœ† env ZK_HOSTS="localhost:2181" bin/kafka-manager

Then visit http://localhost:9000

Create a Kafka cluster at first:

Kafka Cluster

Visit β€œtest” topic in Kafka cluster:

Kafka Manager

Contents