zookeeper-server-start.sh
- starting Zookeeperkafka-server-start.sh
- start Kafkakafka-topics.sh
- manage topics in Kafkakafka-console-producer.sh
- script for sending messages to Kafka topickafka-console-consumer.sh
- script for consuming messages from Kafka topickafka-run-class.sh
- script for running different tools (list of tools can be found here)
The following paths are standard paths on OSX when Kafka is installed via Brew. At the time of writing current Kafka version is 0.11.0.1. All the commands are executed from within /usr/local/Cellar/kafka/0.11.0.1/libexec/bin
./zookeeper-server-start.sh ../config/zookeeper.properties
./kafka-server-start.sh ../config/server.properties
./kafka-topics.sh --create --topic example-topic --zookeeper localhost:2181 --partitions 1 --replication-factor 1
./kafka-topics.sh --list
./kafka-console-consumer.sh --topic example-topic --from-beginning --bootstrap-server localhost:9092
./kafka-console-producer.sh --topic example-topic --broker-list localhost:9092
> {"event":"EXAMPLE", "data":{"id":"123", "name":"Piotr"}, "metadata":{"version":"001"}, "timestamp":"2017-11-05T00:00:00Z" }
./kafka-run-class.sh --topic example-topic --zookeeper zookeeper-server.com:2181 --group example-group
For create a topic,
--zookeeper is deprecated
use --bootstrap-server
https://kafka.apache.org/quickstart