docker搭建zk集群和kafka集群

docker run --name zookeeper1 --restart always -d -p 2181:2184 -p 2891:2891 -p 3891:3891 -p 8091:8091 zookeeper:clusterv3
docker run --name zookeeper2 --restart always -d -p 2182:2184 -p 2892:2892 -p 3892:3892 -p 8092:8091 zookeeper:clusterv3
docker run --name zookeeper3 --restart always -d -p 2183:2184 -p 2893:2893 -p 3893:3893 -p 8093:8091 zookeeper:clusterv3

docker run --name kafka1 --restart always -d -p 9092:9092 --env KAFKA_ZOOKEEPER_CONNECT=zkip1:2181,zkip2:2182,zkip3:2183/kafka --env KAFKA_ADVERTISED_PORT=9092 --env KAFKA_ADVERTISED_HOST_NAME=服务器ip --env KAFKA_HEAP_OPTS="-Xmx256M -Xms128M" --volume /etc/localtime:/etc/localtime wurstmeister/kafka

 

你可能感兴趣的:(服务器配置)