Setup Kafka & Broker - Initial Setup of Kafka with Topic, Broker, Replication,...

Setup Kafka & Broker - Initial Setup of Kafka with Topic, Broker, Replication, Partitions using Commands
parent 7a73ad0e
OMD-Notification-Kafka-Configuration-Details:
—————————————--------------------------------
1. Kafka Installation Process on Mac OS:
a) Downlaod:
1) https://kafka.apache.org/downloads
2) Scala 2.12  - kafka_2.12-2.4.1.tgz 
b) Configuration:
1) Extract to Desired Location.
(My Local Location: /Users/preddy/Documents/Kafka-Tutorial/Kafka_Learning_udemy/kafka_2.12-2.4.1/bin)
2) Use following commands to set the Class path to bash.profile file.
-> cat ~/.bash_profile to check the existed class path settings
-> nano ~/.bash_profile to update the class path settings
-> Set the class path as:
export PATH ="$PATH:/Users/preddy/Documents/Kafka-Tutorial/Kafka_Learning_udemy/kafka_2.12-2.4.1/bin"
-> Save and Exit
3) Check the Kafka installation by running the command :
-> Kafka-Topics
4) Create a folder “data >> zookeeper” in Kafka root directory.
5) Create a folder “data>>Kafka” in Kafka root directory.
6) Update “dataDir” value in zookeeper.properties with data>>zookeeper directory path.
(Ex. dataDir=/Users/preddy/Documents/Kafka-Tutorial/Kafka_Learning_udemy/kafka_2.12-2.4.1/data/zookeeper) to check the data
7) Update “log.dir” in server.properties with data>>Kafka directory path.
(Ex. log.dirs=/Users/preddy/Documents/Kafka-Tutorial/Kafka_Learning_udemy/kafka_2.12-2.4.1/data/kafka)
2. CLI Commands To Create Topic, Run Broker, Zookeeper:
a) Start Zookeeper :
—> zookeeper-server-start config/zookeeper.properties (from root folder)
—> binding to port 0.0.0.0/0.0.0.0:2181 (This is the confirmation for zookeeper start and 2181 is the default port for zookeeper)
b) Start Kafka Server ( i.e. Broker) :
—> Kafka-server-start config/server.properties (from root folder)
—> [KafkaServer id=0] started (kafka.server.KafkaServer) (This is the confirmation for Kafka server started successfully)
c) Create Topic with Replicas and Partitions :
--> kafka-topics --bootstrap-server localhost:9092 --topic TOPIC_OMD_ORDER_DATA --create --partitions 3 --replication-factor 1
—> To Check the details of Topic and Partitions :
kafka-topics --bootstrap-server localhost:9092 --topic TOPIC_OMD_ORDER_DATA --describe
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment