docker run -d --name zookeeper -p 2181:2181 -t wurstmeister/zookeeper
运行zookeeper 出现以下错误提示时:docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:2181: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
依照以下步骤在CMD中解决:
net stop winnat
netsh int ipv4 add excludedportrange protocol=tcp startport=2181 numberofports=1
net start winnat
docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=192.168.1.117:2181 --env KAFKA_ADVERTISED_HOST_NAME=192.168.1.117 --env KAFKA_ADVERTISED_PORT=9092 wurstmeister/kafka