Last active
December 23, 2019 23:57
-
-
Save xbeta/9719679 to your computer and use it in GitHub Desktop.
Quick start on Kafka
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To Setup and build Kafka: | |
$ git clone [email protected]:apache/kafka.git | |
$ cd kafka | |
$ git checkout -b 0.8 remotes/origin/0.8 | |
$ ./gradlew jarAll | |
# Start Zookeeper | |
$ bin/zookeeper-server-start.sh config/zookeeper.properties | |
# Start Kafka | |
$ env JMX_PORT=9999 bin/kafka-server-start.sh config/server.properties | |
# Create a topic "trips" | |
$ bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic trips | |
# List all the topics | |
$ bin/kafka-topics.sh --list --zookeeper localhost:2181 | |
# Describe a topic | |
$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic trips | |
# To produce a topic | |
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic trips | |
# To consume a topic | |
$ bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic trips |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment