Kafka - pborissow/spring-boot-demo GitHub Wiki
Installation (Ubuntu)
There's no real installer. You can simply download the tar file like this:
wget https://dlcdn.apache.org/kafka/4.0.0/kafka_2.13-4.0.0.tgz
tar -xzf kafka_2.13-4.0.0.tgz
Create cluster:
cd kafka_2.13-4.0.0
KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"
bin/kafka-storage.sh format --standalone -t $KAFKA_CLUSTER_ID -c config/server.properties
Update config:
cd kafka_2.13-4.0.0
vi config/server.properties
listeners=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
advertised.listeners=PLAINTEXT://192.168.0.80:9092,CONTROLLER://192.168.0.80:9093
Update Ubuntu Firewall (optional)
sudo ufw status
sudo ufw allow from 192.168.0.0/16 to any port 9092
sudo ufw allow from 192.168.0.0/16 to any port 9093
Start server:
cd kafka_2.13-4.0.0
bin/kafka-server-start.sh config/server.properties
Create topic:
bin/kafka-topics.sh --create --topic akula-http-requests --bootstrap-server localhost:9092
List topics:
bin/kafka-topics.sh --list --bootstrap-server localhost:9092
Consume topic:
bin/kafka-console-consumer.sh --topic akula-http-requests --from-beginning --bootstrap-server localhost:9092