LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-11-2014, 01:31 AM   #1
trung1490
LQ Newbie
 
Registered: Jul 2014
Posts: 15

Rep: Reputation: Disabled
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

Last edited by trung1490; 07-11-2014 at 01:38 AM.
 
Old 11-10-2014, 04:05 AM   #2
yiuc88
LQ Newbie
 
Registered: Nov 2014
Posts: 1

Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to transfer the services from node 1 to node 2 ,if node 1 is directly turned off sankarg304 Linux - Server 1 12-12-2012 10:06 AM
Error in shell scripts of monitoring node down events jayakumar01 Linux - Server 2 01-22-2012 01:55 AM
Virtual disk/node port for serial buffer balaqemu Linux - Newbie 1 10-21-2011 11:07 AM
Back Track 4 Install into virtual PC --- How to? newbiz Linux - Newbie 3 08-09-2009 05:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration