Code Monkey home page Code Monkey logo

docker-haproxy's Introduction

HAProxy (with rsyslogd) and Keepalived in Docker

Quick start

# Start 5 web servers with 2 proxy servers
docker-compose up -d --scale web=5 --scale proxy=2
# show logs of the proxy container
docker-compose logs -f proxy
# Access the virtual IP specified in docker-compose.yml
curl -v 172.18.0.101
# Access Statistics Report
curl -v 172.18.0.101:8080

Testing

# Stop the proxy container in MASTER state
docker stop docker-haproxy_proxy_1
curl -v 172.18.0.101

# Then start it again
#   The priority in keepalived.conf is a random integer so that
#   the container might enter MASTER or BACKUP state which depends
#   on the priority is higher or lower than the priority in another
#   proxy container
docker start docker-haproxy_proxy_1
curl -v 172.18.0.101

Environment

$ cat /etc/redhat-release
CentOS Linux release 7.6.1810

$ docker --version
Docker version 1.13.1, build 7f2769b/1.13.1

$ docker-compose --version
docker-compose version 1.24.1, build 4667896b

$ docker images --format "{{.Repository}}:{{.Tag}}"
docker.io/nginx:1.17.3-alpine
docker.io/haproxy:2.0.7-alpine

Details

Reference

docker-haproxy's People

Contributors

taoxuau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.