Рет қаралды 2,356
In this video let's explore Kafka Log Cleanup Policies in-depth.
Prerequisite:
-------------------
Kafka Log Segments in-depth intuition
• Kafka Log Segments in-...
Setting up a single node Kafka Cluster on EC2
• Setting up a single n...
Code:
------------
wget dlcdn.apache.org/kafka/3.4.0/...
tar -xvf kafka_2.13-3.4.0.tgz
To install Java --
----------------------------------------
java -version
sudo yum install java-1.8.0-openjdk
java -version
cd kafka_2.13-3.4.0
Start Zoo-keeper:
-------------------------------
bin/zookeeper-server-start.sh config/zookeeper.properties
Start Kafka-server:
----------------------------------------
Duplicate the session & enter in a new console --
export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"
cd kafka_2.13-3.4.0
bin/kafka-server-start.sh config/server.properties
It is pointing to private server , change server.properties so that it can run in public IP
To do this , you can follow any of the 2 approaches shared belwo --
1)Do a vi config/server.properties in insert mode -- change ADVERTISED_LISTENERS to public ip of the EC2 instance
2)You can modify the file using Winscp also
To create Log Compacted Topic:
--------------------------------------
cd kafka_2.13-3.4.0
bin/kafka-topics.sh --create --topic demo_testing3 --bootstrap-server 54.90.61.129:9092 --replication-factor 1 --partitions 1 --config cleanup.policy=compact --config min.cleanable.dirty.ratio=0.001 --config segment.ms=5000
To Start the Producer:
-------------------------
bin/kafka-console-producer.sh --topic demo_testing3 --bootstrap-server 54.90.61.129:9092 --property parse.key=true --property key.separator=,
To Start the Consumer:
-------------------------
cd kafka_2.13-3.4.0
bin/kafka-console-consumer.sh --topic demo_testing3 --from-beginning --bootstrap-server 54.90.61.129:9092 --property print.key=true --property key.separator=,
Check this playlist for more Data Engineering related videos:
• Demystifying Data Engi...
Apache Kafka form scratch
• Apache Kafka for Pytho...
Snowflake Complete Course from scratch with End-to-End Project with in-depth explanation--
doc.clickup.com/37466271/d/h/...
🙏🙏🙏🙏🙏🙏🙏🙏
YOU JUST NEED TO DO
3 THINGS to support my channel
LIKE
SHARE
&
SUBSCRIBE
TO MY KZbin CHANNEL