基于zookeeper-3.4.9和kafka_2.12-2.2.0
ZK集群的搭建启动就不赘述了,很多中间件要用到,千篇一律
Kafka集群搭建:
1.点击上述链接下载kafka并解压,假设解压目录为/home/soft/kafka_2.12-2.2.0
2.配置/home/soft/kafka_2.12-2.2.0/config/server.properties,配置详解
3.启动ZK集群,然后启动Kafka各个节点,
cd /home/soft/kafka_2.12-2.2.0/bin
./kafka-server-start.sh -daemon ../config/server.properties
4.创建topic
./kafka-topics.sh --create --zookeeper 172.16.3.177:12181,172.16.3.178:12181,172.16.3.179:12181 --replication-factor 2 --partitions 3 --topic topic1
5.查看topic
./kafka-topics.sh --list --zookeeper 172.16.3.177:12181,172.16.3.178:12181,172.16.3.179:12181
6.查看topic状态
./kafka-topics.sh --describe --zookeeper 172.16.3.177:12181,172.16.3.178:12181,172.16.3.179:12181 --topic topic1