本文主要记录通过docker搭建Kafka集群版
docker run --name=pro-kafka01 -d --restart=always --net=host -v /etc/localtime:/etc/localtime -v /etc/hosts:/etc/hosts -v /data/kafka:/kafka -e KAFKA_BROKER_ID=1 -e KAFKA_ZOOKEEPER_CONNECT=10.128.0.111:2181,10.128.0.112:2181,10.128.0.113:2181 -e KAFKA_ADVERTISED_HOST_NAME=10.128.0.141 -e KAFKA_ADVERTISED_PORT=9092 -e KAFKA_HEAP_OPTS="-Xmx6G -Xms6G" wurstmeister/kafka:2.12-2.4.1
docker run --name=pro-kafka02 -d --restart=always --net=host -v /etc/localtime:/etc/localtime -v /etc/hosts:/etc/hosts -v /data/kafka:/kafka -e KAFKA_BROKER_ID=2 -e KAFKA_ZOOKEEPER_CONNECT=10.128.0.111:2181,10.128.0.112:2181,10.128.0.113:2181 -e KAFKA_ADVERTISED_HOST_NAME=10.128.0.142 -e KAFKA_ADVERTISED_PORT=9092 -e KAFKA_HEAP_OPTS="-Xmx6G -Xms6G" wurstmeister/kafka:2.12-2.4.1
docker run --name=pro-kafka03 -d --restart=always --net=host -v /etc/localtime:/etc/localtime -v /etc/hosts:/etc/hosts -v /data/kafka:/kafka -e KAFKA_BROKER_ID=3 -e KAFKA_ZOOKEEPER_CONNECT=10.128.0.111:2181,10.128.0.112:2181,10.128.0.113:2181 -e KAFKA_ADVERTISED_HOST_NAME=10.128.0.143 -e KAFKA_ADVERTISED_PORT=9092 -e KAFKA_HEAP_OPTS="-Xmx6G -Xms6G" wurstmeister/kafka:2.12-2.4.1