先部署zk集群 https://www.cnblogs.com/luckygxf/p/15115078.html
三台linux centos jdk, kafka
192.168.180.10
192.168.180.11
192.168.180.12
解压kafka到/opt/software/kafka, 在/opt/software/kafka创建logs目录
编辑kafka配置文件/opt/software/kafka/kafka_2.12-2.7.0/config/server.properties
broker.id=0 listeners=PLAINTEXT://192.168.180.10:9092 log.dirs=/opt/software/kafka/logs zookeeper.connect=192.168.180.10:2181,192.168.180.11:2181,192.168.180.12:2181
启动kafka
sh kafka-server-start.sh ../config/server.properties &
创建topic test
sh kafka-topics.sh --create --bootstrap-server 192.168.180.10:9092 --replication-factor 3 --partitions 1 --topic test
查看topic
sh kafka-topics.sh --list --bootstrap-server 192.168.180.10:9092