docker run -d \ --name zookeeper \ -p 2181:2181 \ -e ZOOKEEPER_CLIENT_PORT=2181 \ confluentinc/cp-zookeeper docker run -d \ --name kafka \ -p 9092:9092 \ -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.1.100:9092 \ -e KAFKA_ZOOKEEPER_CONNECT=192.168.1.100:2181 \ confluentinc/cp-kafka docker exec -it kafka kafka-topics --list --bootstrap-server 192.168.1.100:9092
kafka-topics --list --bootstrap-server 192.168.1.100:9092 kafka-topics --create --bootstrap-server 192.168.1.100:9092 --replication-factor 1 --partitions 1 --topic test_topic kafka-console-consumer --bootstrap-server 192.168.1.100:9092 --topic test_topic --from-beginning标签:--,备份,9092,kafka,1.100,192.168,docker From: https://www.cnblogs.com/xingchong/p/17641365.html