Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Add load balancer container #2

Closed
nazar-pc opened this issue Jul 9, 2015 · 4 comments
Closed

Add load balancer container #2

nazar-pc opened this issue Jul 9, 2015 · 4 comments

Comments

@nazar-pc
Copy link
Owner

nazar-pc commented Jul 9, 2015

Should be linked to nginx instance (all of them if scaled) and balance load across them.
Additional directory for load balancer config (HAProxy or Nginx) should be added.

Currently impossible to add scaled nginx instances, needs docker/compose#1676 to be implemented.

Also additional container similar to #1 should be created to update config to all available linked nginx instances not only on balancer creation, but just automatically.

@nazar-pc
Copy link
Owner Author

Initial version implemented in bf07374 using Consul for DNS and HAproxy for transparent proxying arbitrary TCP connections.
Not documented yet, sample config to play with scaling:

consul:
  image: nazarpc/webserver:consul
  environment:
    CONSUL_SERVICE: consul
    SERVICES: nginx-haproxy:nginx
nginx-haproxy:
  image: nazarpc/webserver:haproxy
  environment:
    SERVICE_NAME: nginx
    SERVICE_PORTS: 80
  ports:
    - 1234:80
nginx:
  image: nginx

Relies on Docker 1.9+ networking feature and Docker Compose 1.5+ with --x-networking (it is not currently possible to make zero-configuration setup otherwise).

DNS awareness should be added into all other provided containers to nicely resolve to target services by service name alone.

@nazar-pc
Copy link
Owner Author

DNS awareness added to Nginx and PHP-FPM images in 278ec15

Working on zero-configuration MariaDB Gallera cluster scaling...

@nazar-pc
Copy link
Owner Author

Zero-configuration automatic MariaDB Galera server cluster in Master-Master replication mode introduced in 461351e.
Instead of single MariaDB instance you'll now get Galera cluster from 1 MariaDB node (which easily scales afterward to any number of nodes using xtrabackup-v2 without any additional configuration and downtime).
Existing MariaDB instances will be automatically upgraded to cluster on upgrade.
Support for Consul's DNS added to MariaDB image.
Example to play with:

data:
  image: nazarpc/webserver:data
mariadb:
  image: nazarpc/webserver:mariadb
  environment:
    SERVICE_NAME: mariadb
  volumes_from:
    - data
phpmyadmin:
  image: nazarpc/phpmyadmin
  environment:
    MYSQL_PORT_3306_TCP_ADDR: data_mariadb_1
  ports:
    - 127.0.0.1:1234:80
phpmyadmin2:
  image: nazarpc/phpmyadmin
  environment:
    MYSQL_PORT_3306_TCP_ADDR: data_mariadb_2
  ports:
    - 127.0.0.1:1235:80

Documentation is still missing.

@nazar-pc
Copy link
Owner Author

Advanced documentation with examples added in b98b4ae.

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