0

I have a problem with Keepalived.

If my application process goes down due to some reason, keepalived fail over the VIP to backup node. However, if the process fails again on backup node its not relocating to Master node. from /var/log/messages its clear that its registing the fail.

Below are my config files:

On Node1 ( Master)

vrrp_script chk { script "/root/test.sh" interval 2 # check every 2 seconds fall 1 rise 2 weight -60 }

vrrp_instance VRRP1 { state EQUAL priority 110 interface eth0 virtual_router_id 51 advert_int 1 authentication { auth_type PASS auth_pass 1111 }

notify_backup "/etc/keepalived/rtb.sh BACKUP"
notify_fault "/etc/keepalived/rtb.sh FAULT"

virtual_ipaddress {
    10.58.127.80/24
}

notify_master "/etc/keepalived/rtb.sh MASTER"

track_script {
chk
}
}

On Node2 (Backup)

vrrp_script chk { script "/root/test.sh" interval 2 # check every 2 seconds fall 1 rise 2 weight -50 }

vrrp_instance VRRP1 { state EQUAL priority 101 interface eth0 virtual_router_id 51 advert_int 1 authentication { auth_type PASS auth_pass 1111 }

notify_backup "/etc/keepalived/rtb.sh BACKUP"
notify_fault "/etc/keepalived/rtb.sh FAULT"

virtual_ipaddress {
    10.58.127.80/24
}

notify_master "/etc/keepalived/rtb.sh MASTER"

track_script {
chk
}
}

If I kill my application process on Node1, VIP is getting relocated to Node2. After a while, if I kill my application process again on Node2, it registers that there is failure but NOT relocating the IP.

Dec 11 11:29:50 rtb48 Keepalived_vrrp[25813]: VRRP_Script(chk) failed

No action post that.

Keepalived version : keepalived-1.2.13-5.el6_6.x86_64

Any clue?

1 Answer 1

0

Did you restart the process on Node #1 to make the check script pass?

Node #1 has a priority of 110 with a weight of 60 on the script.
Node #2 has a priority 0f 101 with a weight of 50 on the script.

So failure on #1 is 110 - 60 = 50. Failure on #2 is 101 - 50 = 51.
Node #2 in this case still has the higher priority and will be master.

Aside: you config looks odd, is it really in long lines like that? If so, shouldn't the comment in the middle of the line break it?

2
  • Hi, Thanks for the reply. Will check. With respect to your question "is it really in long lines like that? If so, shouldn't the comment in the middle of the line break it?" Its a formatting issue and in original file it looks Correct. So, should we try with prio : 110 , weight : 50 (on Node1) and prio: 101 , weight : 50 ( on Node2) ? Jan 4, 2018 at 12:10
  • Yes, I would recommend using the same weight for the check script on both nodes. Assuming it's checking identical conditions it makes sense to be given identical weighting.
    – virullius
    Jan 4, 2018 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .