docker run -d --name zookeeper --publish 2181:2181 --volume /etc/localtime:/etc/localtime zookeeper:latest docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env KAFKA_ADVERTISED_HOST_NAME=kafka所在宿主机的IP --env KAFKA_ADVERTISED_PORT=9092 --volume /etc/localtime:/etc/localtime wurstmeister/kafka:latest docker exec -it ${CONTAINER ID} /bin/bash cd /opt/kafka bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic mykafka bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic mykafka --from-beginning ./kafka-topics.sh --zookeeper 39.105.144.248 --list ./kafka-topics.sh --zookeeper 39.105.144.248 --topic mytopic --describe
标签:--,zookeeper,9092,kafka,docker,安装,localtime From: https://www.cnblogs.com/yahe/p/17486426.html