Use this command to verify the Java environment
java -version
Use this link for downloading the latest version of ZooKeeper.
tar -zxf zookeeper-3.4.14.tar.gz
cd zookeeper-3.4.14
Create a directory for storing the snapshot
mkdir data
Create zoo.cfg under the conf directory:
nano conf/zoo.cfg
Set the content of zoo.cfg:
tickTime = 2000
dataDir = /Users/wuyichen/zookeeper-3.4.14/data (Change this path for your case, see Step 2.3)
clientPort = 2181
initLimit = 5
syncLimit = 2
sh bin/zkServer.sh start
After executing this command, you should see the following message:
ZooKeeper JMX enabled by default
Using config: /Users/wuyichen/zookeeper-3.4.14/bin/../conf/zoo.cfg
-n Starting zookeeper ...
STARTED
- Start ZooKeeper client:
sh bin/zkCli.sh
- Stop ZooKeeper server:
sh bin/zkServer.sh stop
- Check ZooKeeper server status:
sh bin/zkServer.sh status
Use this command to verify the Java environment
java -version
ZooKeeper is the prerequisite for Kafka, you need to install it before running Kafka.
Use this link for downloading the latest version of Kafka. Use the binary downloads like "kafka_a.b-x.y.z.tgz".
tar -zxf kafka_2.11-2.2.0.tar.gz
cd kafka_2.11-2.2.0
sh bin/kafka-server-start.sh config/server.properties
NOTE: Please make sure the ZooKeeper server is running also.