Skip to content

Instantly share code, notes, and snippets.

@Youmoo
Last active August 29, 2015 14:02
Show Gist options
  • Save Youmoo/4c517a226947eba4cd20 to your computer and use it in GitHub Desktop.
Save Youmoo/4c517a226947eba4cd20 to your computer and use it in GitHub Desktop.

kafka quick start

start zookeeper

bin/zookeeper-server-start.sh config/zookeeper.properties

start kafka

bin/kafka-server-start.sh config/server.properties

create topic

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

show topics

bin/kafka-topics.sh --list --zookeeper localhost:2181

start producer

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
This is a message
This is another message

start consumer

bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
This is a message
This is another message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment