Git Product home page Git Product logo

vagrant-haproxy's Introduction

vagrant-haproxy

Vagrant VMs that demonstrate HAProxy's load-balancing/session-persistence

Requirements: Vagrant, Virtualbox

Within the directory you clone the repo, command vagrant to initialize the 3 virtual machines with: vagrant up --provision

After instantiating, you may open your favorite browser and verify that both webservers are running by visiting http://localhost:8080/haproxy?stats. From there you can see information on both servers. You can visit each server within your private network by traveling to 172.16.0.2 and 172.16.0.3

Visit http://localhost:8081 and you should land yourself on either webserver's home page. If you refresh, you should still visit the same webserver. This demonstrates our HAProxy's session-persistence through cookies.

SSH into the other webserver with vagrant ssh webserver1, and simulate an outtage by typing: sudo service apache2 stop. You can go back to HAProxy's stats page and verify that your particular server has stopped. Upon refreshing http://localhost:8081, you will find yourself on your other, untouched webserver. This demonstrates HAProxy's load-balancing.

To resume a webserver, type sudo service apache2 start. You can verify that both servers are up and running on the HAProxy stats page, but the client with cookies will now only visit the remaining server thanks to session-persistence.

Halt the VMs with vagrant halt.

Links to helpful articles/demos: http://blog.haproxy.com/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

vagrant-haproxy's People

Contributors

patrickstocklin avatar

Watchers

alex 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.