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
- wget (yum install wget)
- tar (yum install tar)
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.
tar -zxvf kafka_2.10-0.8.2.0.tgz
rm kafka_2.10-0.8.2.0.tgz -y
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:
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:
+ Stopped bin/zookeeper-server-start.sh config/zookeeper.properties
Then run the command:
> + bin/zookeeper-server-start.sh config/zookeeper.properties &
# you can check that zookeeper is running at background by use the jobs command:
> + Running bin/zookeeper-server-start.sh config/zookeeper.properties &
Now start the Kafka server:
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
That’s it, you have Kafka CentOS installation! Go from STEP 3 in the quickstart to learn the basics of Kafka..