My Setup is as follows:
I have two Samba Servers configured with DRBD, Corosync and Pacemaker.
Both these servers are in HA which means when SambaServer1
goes down, data is replicated on SambaServer2
.
My requirement here is that when SambaServer1
goes down following should happen:
- Client should automatically point to
SambaServer2
. - Mount point should not get affected.
Solution I used:
Mount client machine with HAProxy IP.
When SambaServer1
goes down, client starts talking to SambaServer2
.
Problem faced:
The HAProxy server intermittently changes the mount point access to down server SambaServer1. Hence the mount point becomes inaccessible. Client Machine un-mounts.
Please suggest me correct HAProxy configuration in the case of failover.
Following is my /etc/haproxy/haproxy.cfg file
global
log <<ipaddress>> local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option dontlognull
option http-server-close
option forwardfor except <<ip/cidr>>
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 10s
timeout server 10s
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen smbtest
bind :445
mode tcp
default_backend smbserver
backend smbserver
mode tcp
balance roundrobin
server SambaServer1 <>:445 check
server SambaServer2 <>:445 check
I have tried with different balance algorithms also like leastconn, source.