-
Notifications
You must be signed in to change notification settings - Fork 2k
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 环境下,FastDFS Tracker 必须使用 Host 网络 #224
Comments
我也遇见一样的问题,请问您是这么解决的 谢谢 |
使用服务名称访问即可
配置里的例子
docker-compose 配置
|
kubernetes nfs(提供持久化) fastdfs
k8s 里部署在fastdfs
fastdfs-tracker-nfs-pv
fastdfs-tracker-nfs-pvc
fastdfs-tracker-service
fastdfs-tracker-satefulset
fastdfs 导入 k8s 使用作为一个服务使用, 使用 Endpoints资源
|
我试过自己创建网络的方式,但是只要不是 host 模式,容器内 ip 始终是 172 开头的。最终都将是同一个问题:宿主机不能访问 172 的节点。 |
容器内获取到的是本机docker0的网段,跨机docker集群需要overlay网络来使各机的docker0网段连通。而host参数使用本机网络和路由,从而可以使用宿主机的网络连通。 |
当storage和tracker在不同宿主机时,storage通过外网ip链接tracker,此时文件上传返回storage外网地址,无需使用host模式也可使用。 |
制作了 FastDFS 镜像,里面包含 Tracker 和 Storage 以及 Nginx。启动 FastDFS 容器后,将其注册到和业务系统相同的网络上,业务系统无法使用 容器名称或容器 IP 连上 Tracker。只有将 FastDFS 容器设置为使用宿主机网络,然后让业务系统使用宿主机 IP 才能连上 Tracker。我参考了多个 dockerhub 上高 stars 的镜像,都是要求容器使用宿主机网络,请问这是为什么?
The text was updated successfully, but these errors were encountered: