Contents
Kafka CentOS Installation Instructions
If you’re here, you’re probably knows what `Kafka` is and what it should be used for.
If not, visit Apache Kafka page to learn more
Prerequisites
- wget (yum install wget)
- tar (yum install tar)
Installation
First thing, lets go over to Kafka Download page to download kafka into our machine:
# choose a directory to download kafka into. it could be really anywhere:
# /home, /var, /usr, /opt or even /tmp if you just wanna play with it.
cd /opt
wget http://apache.mivzakim.net/kafka/0.8.2.0/kafka_2.10-0.8.2.0.tgz
tar -zxvf kafka_2.10-0.8.2.0.tgz
rm kafka_2.10-0.8.2.0.tgz -y
cd kafka_2.10-0.8.2.0
Well.. and that’s preety it. you have Kafka CentOS installation on your machine. Now, lets play with it a little:
Start quick-and-dirty server
from Kafka QuickStart:
Kafka uses ZooKeeper so you need to first start a ZooKeeper server if you don’t already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.
so just run now at your console:
bin/zookeeper-server-start.sh config/zookeeper.properties
after, you’ll see the BEAUTIFUL output telling you everything is fine and zookeeper is running on 0.0.0.0:2181:
Now, we’re gonna be more dirtier and just for now, we’ll move the zookeeper server into background so we could start the kafka server. This can be done by pressing: CTRL+Z which outputs:
[1]+ Stopped bin/zookeeper-server-start.sh config/zookeeper.properties
Then run the command:
bg
> [1]+ bin/zookeeper-server-start.sh config/zookeeper.properties &# you can check that zookeeper is running at background by use the jobs command:
jobs
> [1]+ Running bin/zookeeper-server-start.sh config/zookeeper.properties &
Now start the Kafka server:
bin/kafka-server-start.sh config/server.properties
And look as the PRETTY lines are printing and loading your Kafka server instance.
FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
If you get this error, you need to add your hostname to /etc/hosts: 127.0.0.1 localhost myhostname
What’s now?
That’s it, you have Kafka CentOS installation! Go from STEP 3 in the quickstart to learn the basics of Kafka..
Good Luck!
Development Specialist, Artist and Activist
Personal Website
Thank you!