touch
V2EX  ›  问与答

docker swarm 部署问题

  •  
  •   touch · Oct 19, 2018 · 2153 views
    This topic created in 2769 days ago, the information mentioned may be changed or developed.

    swarm 部署了 3 个 node。创建了 2 个 service nginx 运行在 192.168.0.105 ,192.168.0.107 上面,如何设置访问 192.168.0.106 能跳转到其他 2 台上。publish 映射的端口是 8081

    5 replies    2018-10-19 17:58:52 +08:00
    mason961125
        1
    mason961125  
       Oct 19, 2018
    你既然用了 Swarm,如果用的是 Ingress 网络的话,任何一个节点的流量都会被负载均衡分配到三个节点
    touch
        2
    touch  
    OP
       Oct 19, 2018
    @mason961125 我创建 service 命令 docker service create --replicas 2 --name mynginx --publish 8081:80 nginx
    集群对外暴露应该默认就是 ingress 网络吧
    mason961125
        3
    mason961125  
       Oct 19, 2018
    @touch #2 是的,默认就是 Ingress。
    touch
        4
    touch  
    OP
       Oct 19, 2018
    @mason961125 但是流量没有负载均衡过去。访问 106 机器没法打开页面.是不是我 create service 的时候还需要加什么参数
    touch
        5
    touch  
    OP
       Oct 19, 2018
    找到问题了。是防火墙的原因
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5214 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 07:53 · PVG 15:53 · LAX 00:53 · JFK 03:53
    ♥ Do have faith in what you're doing.