I'm trying to get keepalived working between 2 debian jessie VMs.
I've defined the master machine to bind the VIP address to 172.128.28.6 as such:
global_defs {
lvs_id tom_lvs
}
vrrp_instace tom_lvs {
state MASTER
interface eth1
virtual_router_id 1
priority 100
authentication {
auth_type PASS
auth_pass 1234
}
advert_int 1
virtual_ipaddress {
172.28.128.6
}
virtual_server 172.28.128.6 3000 {
delay_loop 10
lb_algo wlc
lb_kind DR
protocol TCP
persistence_timeout 1800
sorry_server 172.28.128.3 3000
real_server 172.28.128.4 3000 {
weight 1
HTTP_GET {
url {
path /index.html
}
}
}
}
}
however, when I run ip addr
I am not seeing a second IP attached to eth3:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:f6:86:bf brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fef6:86bf/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:05:a5:a1 brd ff:ff:ff:ff:ff:ff
inet 172.28.128.4/24 brd 172.28.128.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe05:a5a1/64 scope link
valid_lft forever preferred_lft forever
I am obviously missing something here, but I've been at it for 2 days now and still didn't find it.
If at all relevant, the machines are running using vagrant and virtual-box, both defined to get their addresses from dhcp, and their IPs are 172.128.28.4 and 172.128.28.3 on the /24 subnet.
here is the output of grep Keepalived /var/log/messages
:
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Registering Kernel netlink reflector
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Registering Kernel netlink command channel
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Registering gratuitous ARP shared channel
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Opening file '/etc/keepalived/keepalived.conf'.
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Configuration is using : 58175 Bytes
Feb 13 11:39:51 jessie Keepalived_vrrp[1890]: Using LinkWatch kernel netlink reflector...
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Registering Kernel netlink reflector
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Registering Kernel netlink command channel
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Opening file '/etc/keepalived/keepalived.conf'.
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Configuration is using : 12031 Bytes
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Using LinkWatch kernel netlink reflector...
Feb 13 11:39:51 jessie Keepalived_healthcheckers[1889]: Activating healthchecker for service [172.28.128.4]:3000
If you copied / pasted your config file, I noticed a typo in your configuration. Other than this, all seems OK.
You need to fix the VRRP instance definition to read:
You missed the second
n
letter invrrp_instance
keyword. After fixing your config and restart keepalived, you should see log lines similar to these: