1

I've enabled lvs_sync_daemon_interface option however it looks like sync daemon is not working

Active node:

[MASTER:~]# ipvsadm -Lnc
IPVS connection entries
pro expire state       source             virtual            destination
TCP 00:37  SYN_RECV    192.168.1.20:55746 192.168.1.10:80    192.168.1.15:80

Passive node:

[BACKUP:~]# ipvsadm -Lnc
IPVS connection entries
pro expire state       source             virtual            destination

Config:

! Configuration File for keepalived

global_defs {
    lvs_id lb1 #lb2 on backup server
}

vrrp_sync_group VG1 {
        group {
            LB1
        }
}

vrrp_instance LB1 {
    state BACKUP #BACKUP on backup server
    interface eth0
    lvs_sync_daemon_interface eth0
    virtual_router_id 50
    priority 2 #1 on backup server
    nopreempt
    advert_int 1
    smtp_alert
        authentication {
            auth_type PASS
            auth_pass $PASSWORD
    }
        virtual_ipaddress {
            192.168.1.10
        }
}

virtual_server 192.168.1.10 80
    delay_loop 5
    lb_algo wlc
    lb_kind DR
    protocol TCP
    ha_suspend
    sorry_server 127.0.0.1

        real_server 192.168.1.15 80 {
            weight 1
            inhibit_on_failure
                HTTP_GET {
                    url {
                 path /
                 status_code 200
                    }
                    connect_timeout 5
                    nb_get_retry 3
                    delay_before_retry 1
                    connect_port 80
                fwmark 80
                }
        }

        real_server 192.168.1.16 80 {
            weight 1
            inhibit_on_failure
                HTTP_GET {
                    url {
                         path /
                         status_code 200
                        }
                    connect_timeout 5
                    nb_get_retry 3
                    delay_before_retry 1
                    connect_port 80
                fwmark 80
                }
        }
}

System: CentOS 6.5, Keepalived v1.2.7 (02/21,2013)

Update: Sat Jul 5 08:44:36 BST 2014:

[MASTER]# ps -elf | grep [i]pvs
1 S root     11207     2  0  80   0 -     0 sync_t 08:41 ?        00:00:00 [ipvs_syncmaster]

[BACKUP]# ps -elf | grep [i]pvs
1 S root      6231     2  0  80   0 -     0 sync_t 08:41 ?        00:00:00 [ipvs_syncbackup]
womble
  • 95,029
  • 29
  • 173
  • 228
HTF
  • 3,050
  • 14
  • 49
  • 78

1 Answers1

2

It has been a while since I've played with lvs and sync but I'd start troubleshooting without using keepalived for starters and just work with ipvs itself.

From the lvs documentation:

On the primary load balancer, run

primary_director:# ipvsadm --start-daemon=master --mcast-interface=eth0

On the backup load balancers, run

backup_director:# ipvsadm --start-daemon=backup --mcast-interface=eth0

To stop the daemon, run

director:# ipvsadm --stop-daemon

Note that the primary talks to the backup over multicast. You'll need to ensure this traffic can flow from primary to backup. Try allowing multicast via iptables filtering on the backup to test for starters.

Set that up and see if you get any output from your ipvsadm -Lnc command on the backup.

Also, note that there isn't any ipvs process per se. Think of ipvs as a kernel interface managed by the userspace program ipvsadm.

You should also check that both master and backup are configured with the same syncid. This is specified with the --syncid option to the ipvsadm commands above. If these are set differently then the backup will ignore anything it receives from the master.

dmourati
  • 24,720
  • 2
  • 40
  • 69