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 Zookeeper
cd /scratch/users/ofsaa/kafka/kafka/kafka_2.13-3.2.0bin/zookeeper-server-start.sh config/zookeeper.properties - Start Apache Kafka Broker
cd /scratch/users/ofsaa/kafka/kafka_2.13-3.2.0bin/kafka-server-start.sh /config/server.properties
keytool -keystore kafka.server.keystore.jks -alias localhost -keyalg RSA -validity 365 -genkey -storepass oracle123 -keypass oracle123 -ext SAN=DNS:ofss-mum-1035.snbomprshared1.gbucdsint02bom.oraclevcn.comopenssl req -new -x509 -keyout ca-key -out ca-cert -days 365keytool -keystore kafka.client.truststore.jks -alias CARoot -storepass oracle123 -keypass oracle123 -importcert -file ca-cert keytool -keystore kafka.server.truststore.jks -alias CARoot -storepass oracle123 -keypass oracle123 -importcert -file ca-certkeytool -keystore kafka.server.keystore.jks -alias localhost -storepass oracle123 -keypass oracle123 -certreq -file cert-fileopenssl x509 -req -CA ca-cert -CAkey ca-key -in cert-file -out cert-signed -days 365 -CAcreateserial -passin pass:oracle123keytool -keystore kafka.server.keystore.jks -alias CARoot -storepass oracle123 -keypass oracle123 -importcert -file ca-cert keytool -keystore kafka.server.keystore.jks -alias localhost -storepass oracle123 -keypass oracle123 -importcert -file cert-signed
keytool -exportcert -alias localhost -keystore kafka.server.keystore.jks -rfc -file certificate.pem -storepass oracle123keytool -v -importkeystore -srckeystore kafka.server.keystore.jks -srcalias localhost -keystore cert_and_key.p12 -storetype PKCS12 -storepass oracle123 -srcstorepass oracle123openssl pkcs12 -in cert_and_key.p12 -nodes -nocerts -out key.pem -passin pass:oracle123keytool -exportcert -alias CARoot -keystore kafka.server.keystore.jks -rfc -file CARoot.pem -storepass oracle123
security.protocol=SSLssl.truststore.location=/scratch/mmg8131/kafka/ssl/kafka.server.truststore.jksssl.truststore.password=oracle123ssl.keystore.location=/scratch/mmg8131/kafka/ssl/kafka.server.keystore.jksssl.keystore.password=oracle123ssl.key.password=oracle123