Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

TCP load balancing doesn't work in Docker Swarm Mode #228

Open
puncha opened this issue Sep 20, 2017 · 0 comments
Open

TCP load balancing doesn't work in Docker Swarm Mode #228

puncha opened this issue Sep 20, 2017 · 0 comments

Comments

@puncha
Copy link

puncha commented Sep 20, 2017

This is my stack.yml:

version: '3'

networks:
  default:
    driver: overlay

services:
  lb:
    image: dockercloud/haproxy:1.6.7
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - 1936:1936
      - 8080:8080

  app1:
    image: dockercloud/hello-world
    networks:
      - default
    environment:
      - TCP_PORTS=8080

  app2:
    image: dockercloud/hello-world
    networks:
      - default
    environment:
      - TCP_PORTS=8080

Once I create the stack, the HAProxy configuration doesn't have the backend section: (by executing docker logs $(docker ps | grep lb_lb | awk '{print($1)}'))

INFO:haproxy:dockercloud/haproxy 1.6.7 is running outside Docker Cloud
INFO:haproxy:Haproxy is running in SwarmMode, loading HAProxy definition through docker api
INFO:haproxy:dockercloud/haproxy PID: 7
INFO:haproxy:=> Add task: Initial start - Swarm Mode
INFO:haproxy:=> Executing task: Initial start - Swarm Mode
INFO:haproxy:==========BEGIN==========
INFO:haproxy:Linked service: lb_app1, lb_app2, lb_buildbot-master-1, lb_buildbot-master-2
INFO:haproxy:Linked container: lb_app1.1.qll1ax6u8p6rqehp3gza75ztk, lb_app2.1.eqvv46j81fd8nbt16u4k4m2ul, lb_buildbot-master-1.1.sc1o1d7u4iqxoonnjljc1p04l, lb_buildbot-master-2.1.vou7kwrhcbmsgrwx81ot89m0b
INFO:haproxy:HAProxy configuration:
global
  log 127.0.0.1 local0
  log 127.0.0.1 local1 notice
  log-send-hostname
  maxconn 4096
  pidfile /var/run/haproxy.pid
  user haproxy
  group haproxy
  daemon
  stats socket /var/run/haproxy.stats level admin
  ssl-default-bind-options no-sslv3
  ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:DHE-DSS-AES128-SHA:DES-CBC3-SHA
defaults
  balance roundrobin
  log global
  mode http
  option redispatch
  option httplog
  option dontlognull
  option forwardfor
  timeout connect 5000
  timeout client 50000
  timeout server 50000
listen stats
  bind :1936
  mode http
  stats enable
  timeout connect 10s
  timeout client 1m
  timeout server 1m
  stats hide-version
  stats realm Haproxy\ Statistics
  stats uri /
  stats auth stats:stats
listen port_8080
  bind :8080
  mode tcp
INFO:haproxy:Launching HAProxy
INFO:haproxy:HAProxy has been launched(PID: 10)
INFO:haproxy:===========END===========
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant