Docker容器

windows docker 安装kafka

本文主要是介绍windows docker 安装kafka,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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

这篇关于windows docker 安装kafka的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!