Skip to content

Instantly share code, notes, and snippets.

@fornarat
Last active October 9, 2015 21:53
Show Gist options
  • Save fornarat/129bfbdd70cea19e77df to your computer and use it in GitHub Desktop.
Save fornarat/129bfbdd70cea19e77df to your computer and use it in GitHub Desktop.
Kafka up & running in 5'
http://kafka.apache.org/documentation.html#quickstart
Prerequisites:
# adding java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Install:
cd /opt/
wget http://apache.rediris.es/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz
tar -xzf kafka_2.11-0.8.2.1.tgz
cd kafka_2.11-0.8.2.1/
Start:
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
Examples:
cd /opt/kafka_2.11-0.8.2.1/
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
bin/kafka-topics.sh --list --zookeeper localhost:2181
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
bin/kafka-console-producer.sh
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment