Day 53: Switch-over mechanism implementation on Load balancer
The below is the newly implemented code for switch-over and synchronization between controllers:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /var/run/haproxy.stat mode 600 level admin
stats timeout 2m
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
# An alternative list with additional directives can be obtained from
# https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend sdn_network
bind 10.0.0.5:6633
mode tcp
option tcplog
timeout client 1m
acl switch_1 src 20.0.0.30/24
acl switch_2 src 20.0.0.40/24
acl switch_3 src 20.0.0.50/24
use_backend controller_1 if switch_1
use_backend controller_2 if switch_2
use_backend master if switch_3
default_backend master
backend controller_1
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.30:6633 check
server c2 10.0.0.50:6633 check
server c3 10.0.0.40:6633 check backup
backend controller_2
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.40:6633 check
server c2 10.0.0.50:6633 check
server c3 10.0.0.30:6633 check backup
backend master
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.50:6633 check
server c2 10.0.0.40:6633 check
server c3 10.0.0.30:6633 check backup
Refer to previous and next articles here.
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /var/run/haproxy.stat mode 600 level admin
stats timeout 2m
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
# An alternative list with additional directives can be obtained from
# https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend sdn_network
bind 10.0.0.5:6633
mode tcp
option tcplog
timeout client 1m
acl switch_1 src 20.0.0.30/24
acl switch_2 src 20.0.0.40/24
acl switch_3 src 20.0.0.50/24
use_backend controller_1 if switch_1
use_backend controller_2 if switch_2
use_backend master if switch_3
default_backend master
backend controller_1
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.30:6633 check
server c2 10.0.0.50:6633 check
server c3 10.0.0.40:6633 check backup
backend controller_2
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.40:6633 check
server c2 10.0.0.50:6633 check
server c3 10.0.0.30:6633 check backup
backend master
mode tcp
option tcplog
option log-health-checks
option redispatch
log global
balance source
timeout connect 10s
timeout server 1m
server c1 10.0.0.50:6633 check
server c2 10.0.0.40:6633 check
server c3 10.0.0.30:6633 check backup
Refer to previous and next articles here.
Author: Shravanya
Co-author: Swati
Comments
Post a Comment