下载
https://mirrors.aliyun.com/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
wget https://mirrors.aliyun.com/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
解压
tar zxvf kafka_2.12-2.3.0.tgz -C/opt
启动
cd /opt/kafka_2.12-2.3.0/bin ./zookeeper-server-start.sh -daemon ../config/zookeeper.properties ./kafka-server-start.sh ../config/server.properties
创建topic
./kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
查看topic
./kafka-topics.sh --list --zookeeper localhost:2181
发送消息
/kafka-console-producer.sh --broker-list localhost:9092 --topic test
接收消息
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
来源:https://www.cnblogs.com/lzyuid/p/12403174.html