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

posted @ 2024-12-14 15:26  河北大学-徐小波  阅读(2)  评论(0编辑  收藏  举报