linux_wiki:load_balancing_haproxy_and_keepalived

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:load_balancing_haproxy_and_keepalived [2018/04/09 00:19]
billdozor [HA-Proxy]
linux_wiki:load_balancing_haproxy_and_keepalived [2019/05/25 23:50] (current)
Line 173: Line 173:
 OPTIONS="-f /etc/haproxy/config.d/http.cfg"</code> OPTIONS="-f /etc/haproxy/config.d/http.cfg"</code>
     * Multiple config files example:<code bash>OPTIONS="-f /etc/haproxy/config.d/http.cfg -f /etc/haproxy/config.d/otherfrontend.cfg"</code>     * Multiple config files example:<code bash>OPTIONS="-f /etc/haproxy/config.d/http.cfg -f /etc/haproxy/config.d/otherfrontend.cfg"</code>
 +
 +==== Additional Config Examples ====
 +
 +**Session Persistence**
 +  * Cookies: Application layer persistence (app needs to support cookies)<code bash>    #-- Balancing --#
 +    balance  leastconn
 +    # Use Cookie for Session Persistence
 +    cookie SERVERID insert indirect nocache
 +    # fullconn: does nothing since we are not using minconn (just makes the dashboard less confusing)
 +    fullconn 1000
 +    server  web01 10.1.2.50:80 check cookie web01 maxconn 500
 +    server  web02 10.1.2.51:80 check cookie web02 maxconn 500</code>
 +  * Source IP: Affinity based on source IP hash (app doesn't need to know about it)<code bash>    #-- Balancing --#
 +    balance  source
 +    # fullconn: does nothing since we are not using minconn (just makes the dashboard less confusing)
 +    fullconn 1000
 +    server  web01 10.1.2.50:80 check maxconn 500
 +    server  web02 10.1.2.51:80 check maxconn 500</code>
  
 ---- ----
  • linux_wiki/load_balancing_haproxy_and_keepalived.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)