Configuring Failover #

Shared User/Session Database #

MySql 5.6+ required
  • Configured in [INSTALL_HOME]/conf/
    • Edit
    • Uncomment
    • Optional, add
  • The specified user must have table creation permissions on the specified database.

The edgeAuth database (or whatever you name your auth database in the config) must be created in mySQL prior to starting the server.

For additional details and instructions on installing a clustered edgeSuite system, see Cluster Installation.

HAProxy config

  • Get latest stable version:
  • Example haproxy.cfg is provided below.  Locally running 2 instances of edgeCore, one on port 8081, one on port 8082:
      maxconn 4096
      pidfile /tmp/
      log local2  debug
      log global
      mode http
      timeout connect 30000
      timeout client 300000
      timeout server 300000
      maxconn 2000
      option redispatch
      retries 3
      option httplog
      option forwardfor
      option httpchk HEAD / HTTP/1.0
    frontend app
      bind *:8080
      mode http
      default_backend servers
    backend servers
      option httplog
      balance roundrobin
      cookie SERVERID insert indirect httponly nocache
      server srv1 localhost:8081 check cookie s1
      server srv2 localhost:8082 check cookie s2
      stats enable
      stats uri /admin?stats
      stats auth admin:admin
  • This configuration is for full round-robin distribution of sessions, although failover vs load-balancing is up to the configuration of the load-balancer.  There are no differences for edgeCore configuration.

UBUNTU HAProxy Config #

sudo add-apt-repository ppa:vbernat/haproxy-1.7
sudo apt-get update
sudo apt-get install haproxy
sudo cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.orig

Place the following at the END of the default config at /etc/haproxy/haproxy.cfg:

frontend http_front
    bind *:8080
    stats uri /haproxy?stats
    default_backend edgesuite
backend edgesuite
    balance roundrobin
    cookie SERVERID insert indirect httponly nocache
    server srv1 localhost:8081 check cookie s1
    server srv2 localhost:8082 check cookie s2

Start and check the status of the HAProxy service:

service haproxy restart
service haproxy status

Point your browser to http://localhost:8080/haproxy?stats to see if it is working.