Skip to content

Instantly share code, notes, and snippets.

@craigminihan
Last active April 14, 2016 09:25
Show Gist options
  • Save craigminihan/334a4c3be3d134e48afc to your computer and use it in GitHub Desktop.
Save craigminihan/334a4c3be3d134e48afc to your computer and use it in GitHub Desktop.
Create a Kafka 0.9 node running on Ubuntu 14.04
sudo su
add-apt-repository -y ppa:webupd8team/java
apt-get update
apt-get -y install oracle-java8-installer
apt-get -y install wget unzip zookeeperd
mkdir ~/Downloads
cd ~/Downloads
wget "http://mirror.ox.ac.uk/sites/rsync.apache.org/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz" -O kafka.tgz
mkdir -p /opt/kafka
cd /opt/kafka
tar xvfz ~/Downloads/kafka.tgz --strip 1
echo "delete.topic.enable = true" >> config/server.properties
# add kafka as a service (note: this init script uses nohup and doesn't have a JMX_PORT defined)
cd /etc/init.d
wget https://gist.githubusercontent.com/superscott/a1c67871cdd54b0c8693/raw/1a66fafd7fd39d8ba251e194ed123700dcd4d77b/kafka
chmod 755 kafka
update-rc.d kafka defaults
service zookeeper start
service kafka start
# install kafkat
apt-get -y install ruby ruby-dev build-essential
gem install kafkat --source https://rubygems.org --no-ri --no-rdoc
echo '{"kafka_path": "/opt/kafka", "log_path": "/tmp/kafka-logs", "zk_path": "localhost:2181"}' > /etc/kafkatcfg
# install kafka-manager
cd ~
git clone https://github.com/yahoo/kafka-manager.git
cd kafka-manager
./sbt clean dist
cd /opt
unzip ~/kafka-manager/target/universal/kafka-manager-1.3.0.4.zip
mv kafka-manager-1.3.0.4 kafka-manager
cd kafka-manager
# update the kafka-manager.zkhosts setting
cd conf
nano application.conf
# update the setting here
# run with:
# bin/kafka-manager -Dhttp.port=80
@craigminihan
Copy link
Author

A script to install Zookeeper and Kafka, kafkat and kafka-manager on a single Ubuntu node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment