Docker安装
docker run -d --name zookeeper -p 2181:2181 -v /etc/localtime:/etc/localtime wurstmeister/zookeeper
运行
docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=<yours_ip_addr>:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://<yours_ip_addr>:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -t wurstmeister/kafka
//案例
docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=192.168.10.1:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.10.1:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -t wurstmeister/kafka
zookeeper查看工具
ZooInspector下载
offsetexplorer-kafka查看器
解压
进入目录ZooInspector\build,运行zookeeper-dev-ZooInspector.jar
java -jar zookeeper-dev-ZooInspector.jar //执行成功后,会弹出java ui client