Skip to content

Instantly share code, notes, and snippets.

@amitgaur
Created June 20, 2014 22:07
Show Gist options
  • Save amitgaur/e23503a8841a6cf8862b to your computer and use it in GitHub Desktop.
Save amitgaur/e23503a8841a6cf8862b to your computer and use it in GitHub Desktop.
Kafka Setup on EC2 Instance
curl -O http://www.scala-lang.org/files/archive/scala-2.10.4.tgz
tar xvf scala-2.10.4.tgz
curl https://archive.apache.org/dist/kafka/0.8.1/kafka_2.10-0.8.1.tgz -O
tar zxvf kafka_2.10-0.8.1.tgz
export PATH=$PATH:$HOME/bin:/home/ec2-user/scala-2.10.4/bin:/home/ec2-user/kafka_2.10-0.8.1/bin
#Start Zookeeper
nohup bin/zookeeper-server-start.sh config/zookeeper.properties &
nohup bin/kafka-server-start.sh config/server.properties &
#Producer
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test &
bin/kafka-topics.sh --list --zookeeper localhost:2181
#Consumer
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment