0

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:

  1. Client should automatically point to SambaServer2.
  2. 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.

GregL
  • 9,370
  • 2
  • 25
  • 36
Neetika
  • 71
  • 2
  • 5
  • What is the haproxy version? `haproxy -v`. How do you know it is sending connections to the "down" server? Do you have log entries? – Michael - sqlbot Sep 14 '15 at 20:40
  • Additionally `server SambaServer1 ...:445 check on-marked-down shutdown-sessions` is probably a more correct conf, since it should force-close any existing sessions if server1 fails its health checks. I suspect lingering connections instead of new ones are at issue here. – Michael - sqlbot Sep 14 '15 at 20:42
  • HAproxy version is : HA-Proxy version 1.5.4 2014/09/02 Copyright 2000-2014 Willy Tarreau – Neetika Sep 15 '15 at 06:03
  • New observations: Even if both the servers are up and running with all the services running fine. The mount point becomes in-accessible after sometime. For example: If I use balance roundrobin algorithm, the mount-point becomes in-accessible after around 3 minutes. If balance leastconn algorithm is used, the mount-point becomes in-accessible after around 10 minutes. Tried with check on-marked-down shutdown-sessions option also. Nothings working. – Neetika Sep 15 '15 at 06:08
  • The mount point becomes in-accessible after sometime while mounting with HAproxy ipaddress on client machine even if both the servers are up and running with all the services. It will be helpfull if you provide the exact configiration we need to use for the file server (samba server). – Neetika Sep 15 '15 at 10:01

0 Answers0