sh create-certs.sh
If the client is using Python, we need to convert .jks certificates to .pem:
# Convert kafka certificates
# Extract the client certificates
keytool -exportcert -alias CARoot -keystore kafka.broker.keystore.jks \
-rfc -file certificate.pem
# Extract the clients key
keytool -v -importkeystore -srckeystore kafka.broker.keystore.jks \
-srcalias CARoot -destkeystore cert_and_key.p12 -deststoretype PKCS12
openssl pkcs12 -in cert_and_key.p12 -nocerts -nodes -out key.pem
# Extract CARoot certificate
keytool -exportcert -alias CARoot -keystore kafka.broker.keystore.jks -rfc \
-file CARoot.pem
# Do the same thing to zookeeper certificates
keytool -exportcert -alias CARoot -keystore kafka.zookeeper.keystore.jks \
-rfc -file certificate.pem
keytool -v -importkeystore -srckeystore kafka.zookeeper.keystore.jks \
-srcalias CARoot -destkeystore cert_and_key.p12 -deststoretype PKCS12
openssl pkcs12 -in cert_and_key.p12 -nocerts -nodes -out key.pem
keytool -exportcert -alias CARoot -keystore kafka.zookeeper.keystore.jks -rfc \
-file CARoot.pem
Edit the configuration file to fit your own purpose
- "ZOO_IP_ADDRESS": Zookeeper IP Address
- "zookeeper.yml": Zookeeper Configuration File
sh start-zookeeper.sh
- "ZOO_IP_ADDRESS": Zookeeper IP Address
- "BROKER_IP_ADDRESS": Broker's IP Address
- "broker.yml": Kafka Broker Configuration File
sh start-broker.sh