5.16 Kafka Installation
Windows
https://shaaslam.medium.com/installing-apache-zookeeper-on-windows-45eda303e835#.fgofwm6n6
Method 1(Using separate zookeeper)
- Download Apache Zookeeper bin files from https://www.apache.org/dyn/closer.lua/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
- Untar apache-zookeeper-3.7.1-bin.tar.gz tar -zxvf apache-zookeeper-3.7.1-bin.tar.gz
- In conf folder, rename zoo-sample.cfg to zoo.cfg
- Make a folder named data in /scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin
- Change the value of dataDir in zoo.cfg to dataDir=/scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin/data
- Open a terminal and set the below values:
                           export ZOOKEEPER_HOME=/scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-binexport PATH=/scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin/bin:$PATH
- Start the zookeeper server:cd /scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin/bin ./zkServer.sh start
- ./zkServer.sh start
- ./zkServer.sh start-foreground
- ./zkServer.sh stop
- ./zkServer.sh status
Apache Kafka
- Download Apache Kafka bin files
                           wget https://downloads.apache.org/kafka/3.3.1/kafka_2.13-3.2.0.tgz
- Untar kafka_2.13-3.2.0.tgztar -zxvf kafka_2.13-3.2.0.tgz
- Make a folder "logs"in the directory/scratch/users/ofsaa/kafka/kafka_2.13-3.2.0/.
- Go to config folder in Apache Kafka and edit
                            server.propertiesusing any text editor. Change value oflogs.dirtolog.dirs=/scratch/users/ofsaa/kafka/kafka_2.13-3.2.0/logs in server.properties
- Go to configfolder in Apache Kafka and editzookeeper.propertiesusing any text editor. Change value ofdataDir dataDir=/scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin/data
- Start Apache Kafka broker
                           cd /scratch/users/ofsaa/kafka/kafka_2.13-3.2.0/bin/./kafka-server-start.sh ../config/server.properties
Method 2(Using zookeeper shipped with Apache Kafka)
- Download Apache Kafka bin files
                           wget https://downloads.apache.org/kafka/3.3.1/kafka_2.13-3.2.0.tgz
- Untar kafka_2.13-3.2.0.tgztar -zxvf kafka_2.13-3.2.0.tgz
- Go to config folder in Apache Kafka and edit
                            zookeeper.propertiesusing any text editor. Change value ofdataDirtodataDir=/scratch/users/ofsaa/zookeeper/apache-zookeeper-3.7.1-bin/dataor any folder where the snapshot of zookeeper metadata can be stored.
- Make a folder "logs"in the directory/scratch/users/ofsaa/kafka/kafka_2.13-3.2.0/.
- Go to configfolder in Apache Kafka and editserver.propertiesusing any text editor. Change value oflogs.dirtolog.dirs=/scratch/users/ofsaa/kafka/kafka_2.13-3.2.0/logsinserver.properties.
- Start Apache Zookeepercd /scratch/users/ofsaa/kafka/kafka/kafka_2.13-3.2.0bin/zookeeper-server-start.sh config/zookeeper.properties
- Start Apache Kafka Brokercd /scratch/users/ofsaa/kafka/kafka_2.13-3.2.0bin/kafka-server-start.sh /config/server.properties