kafka相关
apt update
apt install default-jdk
#下载
wget https://downloads.apache.org/kafka/3.8.0/kafka_2.13-3.8.0.tgz
tar zxvf kafka_2.13-3.8.0.tgz
cd kafka_2.13-3.8.0
#启动zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
#启动kafka
bin/kafka-server-start.sh config/server.properties
#生产消息
bin/kafka-console-producer.sh --topic id-events --bootstrap-server 192.168.56.104:9092
#消费消息
bin/kafka-console-consumer.sh --topic id-events --from-beginning --bootstrap-server 192.168.56.104:9092
本文来自博客园,作者:河北大学-徐小波,转载请注明原文链接:https://www.cnblogs.com/xuxiaobo/p/18606792