Confluent Kafka on local window | confluent local services start | confluent command not found

Опубликовано: 10 Октябрь 2024
на канале: SMART India
1,740
40

Confluent Kafka installation on window 10
Prerequisite:
1. install WSL(Window Subsystem for Linux2-download Ubuntu)
2. Install java on Linux distribution
use command1 : sudo apt update
use command2 : sudo apt install default-jdk
use command3 to check java installation :javac -version

3. download window terminal from microsoft store and set ubuntu as default terminal
by go to setting in terminal , open json file and set defaultprofile from
GUID of window subsystem.
Set starting Directory configuration by adding following command in Window
Subsystem .
"startingDirectory":\\\\wsl$\\Ubuntu-20.04\\home\\supercoder"

============================================================
Downloading and installation of Confluent Kafka :
Step1. (to down load confluent tar file)
command1: curl -O https://packages.confluent.io/archive/7.3/...

Step2. (to untar file)
command2:tar -zxvf confluent-7.3.2.tar.gz

Step3. (to edit path in bashrc file)
command3: nano .bashrc

Step4.
command4: export PATH=/home/supercoder/confluent-7.3.2/bin:$PATH

then press Ctr+S , then Ctr+X to save and come out from editor file

Step4. (setting two Environment variable)
1st confluent home: to refer confluent install directory
command5: export CONFLUENT_HOME=~/confluent-7.3.2

Step5. (Path : to refer bin directory under the confluent)
command6: export PATH=$CONFLUENT_HOME/bin:$PATH
============================================================
Step6. STARTING Confluent services
command1: confluent local services start

Step7. if started then open browser and type localhost:9021/

Step8. add new topic example test-topic

Step9. open new window terminal and start producer
command2: kafka-console-producer --topic test-topic --broker-list localhost:9092

Step10. open new window terminal and start consumer
command3: kafka-console-consumer --topic test-topic --bootstrap-server localhost:9092 --from-beginning

Step11. enter DATA in producer terminal like
{"Name": "John", "Age": 28, "Gender":"Male"} and press enter
============================================================
Step12. to stop and close producer and consumer terminal press Ctrl+c then close
============================================================
confluent local destroy ( to clean data and topic )
confluent local services stop (to stop confluent)
============================================================