LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Keepalived: virtual IP appear in both node trouble and track scripts seem not working (https://www.linuxquestions.org/questions/linux-server-73/keepalived-virtual-ip-appear-in-both-node-trouble-and-track-scripts-seem-not-working-4175510755/)

trung1490 07-11-2014 01:31 AM

Keepalived: virtual IP appear in both node trouble and track scripts seem not working
 
Hi everyone

I have 2 servers Redhat 5.7. Both of them are installed Keepalived 1.2.1 just for fail over

My issue is: when i start keepalived, both node have the vitual IP, even they saw VRRP instance and VRRP priority of each other. And the VRRP scripts seem not work.

My purpose for the track scripts is: if 1 port service down, keepalived will assign the vitual ip for the other node

Here is my keepalived configuration is Master:
global_defs {
notification_email {
root
}
notification_email_from root
! smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id 12
}

vrrp_script chk_1 {
script "</dev/tcp/127.0.0.1/8384"
interval 1
weight -110
}

vrrp_script chk_2 {
script "</dev/tcp/127.0.0.1/161"
interval 1
weight -110
}

vrrp_instance VI_1 {
state MASTER
interface bond1
virtual_router_id 50
priority 120
advert_int 1

track_interface {
bond1 weight -150
}

track_script {
chk_1
}

authentication {
auth_type PASS
auth_pass 121
}

virtual_ipaddress {
10.211.4.105/192
}
}

vrrp_instance VI_2 {
state MASTER
interface bond0
virtual_router_id 59
priority 120
advert_int 1

track_interface {
bond0 weight -150
}

track_script {
chk_2
}

authentication {
auth_type PASS
auth_pass 122
}

virtual_ipaddress {
192.168.6.23/24
}
}

And the configuration in node 2:

global_defs {
notification_email {
root
}
notification_email_from root
! smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id 12
}

vrrp_script chk_1 {
script "</dev/tcp/127.0.0.1/8384"
interval 1
weight -110
}

vrrp_script chk_2 {
script "</dev/tcp/127.0.0.1/161"
interval 1
weight -110
}

vrrp_instance VI_1 {
state SLAVE
interface bond1
virtual_router_id 50
priority 90
advert_int 1

track_interface {
bond1 weight -50
}

track_script {
chk_1
}

authentication {
auth_type PASS
auth_pass 121
}

virtual_ipaddress {
10.211.4.105/192
}
}

vrrp_instance VI_2 {
state SLAVE
interface bond0
virtual_router_id 59
priority 90
advert_int 1

track_interface {
bond0 weight -50
}

track_script {
chk_2
}

authentication {
auth_type PASS
auth_pass 122
}

virtual_ipaddress {
192.168.6.23/24
}
}


==========================
tcpdump -v -i eth0 host 224.0.0.18

05:10:48.871069 IP (tos 0x0, ttl 255, id 431, offset 0, flags [none], proto: VRRP (112), length: 40) 192.168.6.22 > 224.0.0.18: VRRPv2, Advertisement, vrid 59, prio 1, authtype simple, intvl 1s, length 20, addrs: 192.168.6.23 auth "122^@^@"
05:10:48.871313 IP (tos 0x0, ttl 255, id 1721, offset 0, flags [none], proto: VRRP (112), length: 40) 192.168.6.21 > 224.0.0.18: VRRPv2, Advertisement, vrid 59, prio 10, authtype simple, intvl 1s, length 20, addrs: 192.168.6.23 auth "122^@^@"

My IP:
Node Master: bond1: 10.211.4.66/26
bond0: 192.168.6.21/24
Node Slave: bond1: 10.211.4.67/26
bond0: 192.168.5.22/24

My log during restart service:


Feb 15 05:03:34 localhost Keepalived_vrrp: Terminating VRRP child process on signal
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP_Instance(VI_1) removing protocol VIPs.
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP_Instance(VI_2) removing protocol VIPs.
Feb 15 05:03:34 localhost Keepalived: Starting Keepalived v1.2.1 (05/07,2012)
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Netlink reflector reports IP 10.211.4.67 added
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Netlink reflector reports IP 10.211.4.67 added
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Registering Kernel netlink reflector
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Registering Kernel netlink command channel
Feb 15 05:03:34 localhost Keepalived: Starting Healthcheck child process, pid=21403
Feb 15 05:03:34 localhost Keepalived_vrrp: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Opening file '/etc/keepalived/keepalived.conf'.
Feb 15 05:03:34 localhost Keepalived_vrrp: Netlink reflector reports IP 10.211.4.67 added
Feb 15 05:03:34 localhost Keepalived_vrrp: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:34 localhost Keepalived_vrrp: Netlink reflector reports IP 10.211.4.67 added
Feb 15 05:03:34 localhost Keepalived_vrrp: Registering Kernel netlink reflector
Feb 15 05:03:34 localhost Keepalived_vrrp: Registering Kernel netlink command channel
Feb 15 05:03:34 localhost Keepalived_vrrp: Registering gratutious ARP shared channel
Feb 15 05:03:34 localhost Keepalived: Starting VRRP child process, pid=21405
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Configuration is using : 7643 Bytes
Feb 15 05:03:34 localhost Keepalived_healthcheckers: Using LinkWatch kernel netlink reflector...
Feb 15 05:03:34 localhost Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
Feb 15 05:03:34 localhost Keepalived_vrrp: Configuration is using : 73771 Bytes
Feb 15 05:03:34 localhost Keepalived_vrrp: Using LinkWatch kernel netlink reflector...
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Entering BACKUP STATE
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP_Instance(VI_2) Entering BACKUP STATE
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP sockpool: [ifindex(7), proto(112), fd(11,12)]
Feb 15 05:03:34 localhost Keepalived_vrrp: VRRP sockpool: [ifindex(6), proto(112), fd(13,14)]
Feb 15 05:03:38 localhost Keepalived_vrrp: VRRP_Instance(VI_2) Transition to MASTER STATE
Feb 15 05:03:38 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_2) Entering MASTER STATE
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_2) setting protocol VIPs.
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_2) Sending gratuitous ARPs on bond0 for 192.168.6.23
Feb 15 05:03:39 localhost Keepalived_healthcheckers: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.
Feb 15 05:03:39 localhost Keepalived_vrrp: Netlink: error: Invalid argument, type=(20), seq=1392415416, pid=0
Feb 15 05:03:39 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on bond1 for 10.211.4.105
Feb 15 05:03:39 localhost Keepalived_vrrp: Netlink reflector reports IP 192.168.6.22 added
Feb 15 05:03:44 localhost Keepalived_vrrp: VRRP_Instance(VI_2) Sending gratuitous ARPs on bond0 for 192.168.6.23
Feb 15 05:03:44 localhost Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on bond1 for 10.211.4.105



So, can you give me some advice about this ?

best regards,

TrungNQ

yiuc88 11-10-2014 04:05 AM

Hi Trung and All

I have same problem, both machines took the VIP on the keepalived. I saw this thread treat solved but I can't find any solution.

Would you let me know the answer?

Regards,
Andy


All times are GMT -5. The time now is 02:00 PM.