-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker 不支持 Redis集群节点的IP #65
Comments
请把Docker文档更新成host网络模式,感谢 |
hey @orangeagain i tried the following commands
or
and for connection
But none worked how did you manage to solve? PS. I want to access the cluster from outside the virtual machine but the docker compose provided here has HARDCODED IP ADDRESS which is useful if accessing from inside the network but not from outside. So, can you please help! |
I am stuck at this problem too. |
我理解你的需求是:想在多个物理机器上部署docker镜像,然后通过meet构成集群? 据docker官方文档描述:--net=host 会存在安全方面问题,所以不会在官方文档中推荐使用。 |
在同一物理机上部署多个节点意义不大,bind参数使用了,没用.期待新版本的教程. |
你们这个部署不会是一台台部署吧,总要有一个管理的外层工具,可以一键部署的吧,我们用的swarm集群,管理主机,使用compose文件内部使用的也是host模式是没什么问题的 |
是想在多个物理机上部署话,这边建议是使用二进制包方式。 |
+1,节点握手时返回的是容器内地址,导致主从复制失败(unknown node) |
根据文档部署Docker节点: http://tendis.cn/#/Tendisplus/%E8%BF%90%E7%BB%B4/new_cluster_compose
docker run -itd -p 51002:51002 --env CLUSTER=yes --env REDIS_PASSWORD=tendisplustest tencentdbforkv/tendisplus
产生问题:
1.多物理节点Docker之间无法互相通信.
2.客户端访问节点得到的重定向地址也是Docker内部地址,导致重定向失败.
原因:
这种端口映射的方式会只会获得Docker容器本机内网IP.
可能的解决办法:
Docker部署使用 --net=host 模式共享物理机IP, 解决Docker节点间的互相通信问题, 同时解决了和客户端通信的问题.
参考:
https://www.geek-book.com/src/docs/redis/redis/redis.io/topics/cluster-tutorial.html
当前,Redis Cluster不支持NATted环境以及在重新映射IP地址或TCP端口的常规环境中。 Docker使用一种称为端口映射的技术:与该程序认为正在使用的端口相比,在Docker容器内运行的程序可能会使用不同的端口公开。为了在同一服务器上同时使用同一端口运行多个容器,这很有用。 为了使Docker与Redis Cluster兼容,您需要使用Docker 的主机联网模式。请检查Docker文档中的--net=host选项以获取更多信息。
The text was updated successfully, but these errors were encountered: