$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install openjdk-11-jdk
$ java -version
$ javac -version
$ sudo vi /etc/hosts
{your public_ip} my-kafka
$ wget https://archive.apache.org/dist/kafka/2.5.0/kafka_2.12-2.5.0.tgz
$ tar xvf kafka_2.12-2.5.0.tgz
$ rm kafka_2.12-2.5.0.tgz
$ vi ~/.bashrc
export KAFKA_HEAP_OPTS="-Xmx400m -Xms400m"
$ source ~/.bashrc
$ echo $KAFKA_HEAP_OPTS
$ vi config/zookeeper.properties
$ vi config/server.properties
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://my-kafka:9092
$ bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
$ jps -vm
$ bin/kafka-server-start.sh -daemon config/server.properties
$ jps -m
$ tail -f logs/server.log
$ bin/kafka-topic.sh --create --bootstarp-server my-kafka:9092 --topic {topic_name}
$ bin/kafka-topics.sh --create --bootstrap-server my-kafka:9092 --partitions 3 --replication-factor 1 --config retention.ms=172800000 --topic {topic_name_2}
$ bin/kafka-topics.sh --bootstrap-server my-kafka:9092 --list
$ bin/kafka-topics.sh --bootstrap-server my-kafka:9092 --describe --topic {topic_name_2}
$ bin/kafka-topics.sh --bootstrap-server my-kafka:9092 --topic {topic_name} --alter --partitions 4
$ bin/kafka-topics.sh --bootstrap-server my-kafka:9092 --topic {topic_name} --describe
$ bin/kafka-configs.sh --bootstrap-server my-kafka:9092 --entity-type topics --entity-name {topic_name} --alter --add-config retention.ms=86400000
$ bin/kafka-configs.sh --bootstrap-server my-kafka:9092 --entity-type topics --entity-name {topic_name} --describe \
$ bin/kafka-console-producer.sh --bootstrap-server my-kafka:9092 --topic {topic_name}
$ bin/kafka-console-producer.sh --bootstrap-server my-kafka:9092 --topic {topic_name} --property "parse.key=true" --property "key.separator=:"
$ bin/kafka-console-consumer.sh --bootstrap-server my-kafka:9092 --topic {topic_name} --from-beginning
$ bin/kafka-console-consumer.sh --bootstrap-server my-kafka:9092 --topic {topic_name} --property print.key=true --property key.separator="-" --group hello-group --from-beginning
$ bin/kafka-consumer-groups.sh --bootstrap-server my-kafka:9092 --list hello-group
$ bin/kafka-consumer-groups.sh --bootstrap-server my-kafka:9092 --group hello-group --describe
$ bin/kafka-verifiable-producer.sh --bootstrap-server my-kafka:9092 --max-message 10 --topic verify-test
$ bin/kafka-verifiable-consumer.sh --bootstrap-server my-kafka:9092 --topic verify-test --group-id test-group
$ vi delete-topic.json
{"partitions":[{"topic": "test", "partition": 0, "offset": 50}], "version":1}
$ bin/kafka-delete-records.sh --bootstrap-server my-kafka:9092 --offset-json-file delete-topic.json