Skip to content

Instantly share code, notes, and snippets.

@ekampf
Last active November 29, 2017 17:41
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save ekampf/8349429 to your computer and use it in GitHub Desktop.
Save ekampf/8349429 to your computer and use it in GitHub Desktop.
Setup Kafka (0.8.0) on OSX
brew install sbt
cd /tmp
wget http://apache.spd.co.il/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz
tar -zxvf kafka_2.8.0-0.8.0.tar.gz -C /usr/local/
cd /usr/local/kafka_2.8.0-0.8.0
sbt update
sbt package
cd /usr/local
ln -s kafka_2.8.0-0.8.0 kafka
echo "" >> ~/.bash_profile
echo "" >> ~/.bash_profile
echo "# KAFKA" >> ~/.bash_profile
echo "export KAFKA_HOME=/usr/local/kafka" >> ~/.bash_profile
source ~/.bash_profile
echo "export KAFKA=$KAFKA_HOME/bin" >> ~/.bash_profile
echo "export KAFKA_CONFIG=$KAFKA_HOME/config" >> ~/.bash_profile
source ~/.bash_profile
$KAFKA/zookeeper-server-start.sh $KAFKA_CONFIG/zookeeper.properties
$KAFKA/kafka-server-start.sh $KAFKA_CONFIG/server.properties
@thomascool
Copy link

wget http://apache.spd.co.il/kafka/0.8.2.0/kafka_2.11-0.8.2.0.tgz
tar -zxvf kafka_2.11-0.8.2.0.tgz -C /usr/local/
cd /usr/local/kafka_2.11-0.8.2.0

sbt update
sbt package

cd /usr/local
ln -s kafka_2.11-0.8.2.0 kafka

@levbrie
Copy link

levbrie commented May 24, 2015

Also, keep in mind that you want the first set of numbers to match up with the version of scala you have installed. To make this a little more ovbious:

# KAFKA INSTALLER:
# downloads, un-tars, moves to /usr/local, simlinks from full versioned name
# to kafka, exports into path in `.bash_profile`, and then starts
# zookeeper and kafka server

brew install sbt # ensure sbt is installed first!

# current kafka for scala 2.11: http://apache.spd.co.il/kafka/0.8.2.1/kafka_2.11-0.8.2.1.tgz

SCALA_VERSION="2.11"
KAFKA_VERSION="0.8.2.1"
KAFKA_VERSIONED_NAME="kafka_${SCALA_VERSION}-${KAFKA_VERSION}"
APACHE_DOWNLOAD_BASEPATH="http://apache.spd.co.il/kafka"
KAFKA_DOWNLOAD_URL="${APACHE_DOWNLOAD_BASEPATH}/${KAFKA_VERSION}/${KAFKA_VERSIONED_NAME}.tgz"

echo "DOWNLOAD URL"
echo "${KAFKA_DOWNLOAD_URL}"

cd /tmp

wget "${KAFKA_DOWNLOAD_URL}"
tar -zxvf "${KAFKA_VERSIONED_NAME}.tgz" -C /usr/local/
cd "/usr/local/${KAFKA_VERSIONED_NAME}"

sbt update
sbt package

cd /usr/local
ln -s "${KAFKA_VERSIONED_NAME}" kafka

echo "" >> ~/.bash_profile
echo "" >> ~/.bash_profile
echo "# KAFKA" >> ~/.bash_profile
echo "export KAFKA_HOME=/usr/local/kafka" >> ~/.bash_profile
source ~/.bash_profile

echo "export KAFKA=$KAFKA_HOME/bin" >> ~/.bash_profile
echo "export KAFKA_CONFIG=$KAFKA_HOME/config" >> ~/.bash_profile
source ~/.bash_profile

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