Open definability opened 8 years ago
Using HAProxy Docker https://hub.docker.com/_/haproxy/ and Neo4J documentation for configuring HAProxy http://neo4j.com/docs/stable/ha-haproxy.html
created own config file
global
daemon
maxconn 256
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:80
default_backend s
backend s
server s1 s1:8080 maxconn 32
server s2 s2:8080 maxconn 32
Docker
FROM haproxy:1.6
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
should be built from the directory with config and can be check via following script, when servers s1
and s2
are up
docker run -it --rm --name haproxy-syntax-check --link s1:s1 --link s2:s2 gangtetris/haproxy:1.6 haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
After that you can execute it
docker run --rm --name haproxy --link s1:s1 --link s2:s2 gangtetris/haproxy:1.6
Need to enable heartbeat with corrections to config
backend s
option httpchk GET /ping
server s1 s1:8080 maxconn 32 check
server s2 s2:8080 maxconn 32 check
Keepalived https://www.digitalocean.com/community/tutorials/how-to-set-up-highly-available-haproxy-servers-with-keepalived-and-floating-ips-on-ubuntu-14-04 http://serverfault.com/questions/238605/is-it-possible-to-make-redundancy-on-haproxy-server https://andyleonard.com/2011/02/01/haproxy-and-keepalived-example-configuration/ https://www.howtoforge.com/setting-up-a-high-availability-load-balancer-with-haproxy-keepalived-on-debian-lenny-p2
We need frontend to not care aboud backend servers — it should send queries to one IP/hostname even when some web-servers failed.