Giter Club home page Giter Club logo

Comments (5)

BertrandGouny avatar BertrandGouny commented on August 15, 2024

Hello,
i noticed this several month ago too. I think this started far before 1.4.5.

This would be nice to open a proper issue on keepalived repo too.

from docker-keepalived.

saqib-ahmed avatar saqib-ahmed commented on August 15, 2024

@BertrandGouny
I did ask it in keepalived repo: acassen/keepalived#512
The collaborator there said that it is a docker related issue and not related to keepalived. This is the response I got:

Your configuration appears to be using the default advert interval of 1 second. This means that when keepalived starts up, any VRRP instances (except those configured with priority 255) will wait approximately 3.8 seconds before transitioning to master (3 * advert_int + advert_int * (255 - priority)/255) (the 255 might be 256, I can't remember). Since 1.89 transitions to master at 13:18:52.6, it must have been in backup mode since 13:18:48.8, but from the tcpdump output we can see that during that time 1.89 is rejecting the vrrp adverts with ICMP messages unreachable/adminstratively down. keepalived on 1.89 therefore isn't receiving the adverts from 1.141 which is why 1.89 transitions to master. You should be able to see from the logs the time when 1.89 reports becoming backup, which I think in this case will have been either at 13:18:48 or 13:18:47.

This problem relates somehow to your local setup, and possibly the way the containers are handling the networking. It is not a keepalived issue.

You can continue discussion over there.

from docker-keepalived.

BertrandGouny avatar BertrandGouny commented on August 15, 2024

Thanks,
sorry i read a bit too fast your first message.

Does this also occurs if the container is run --privileged ?

This may be related to a larger problem i'm also facing with keepalived 2.x, it can't find network interface in container :s this is also reported in 1.4.5 when keepalived start but vrrp managed to use the interface after a short period of time.

Not sure what is happening :/

from docker-keepalived.

Peter-YAN avatar Peter-YAN commented on August 15, 2024

keepalived 1.3.5 also has this problem.
after reboot system, the VIP is floating according to ip sequence.

**!server1, 192.168.1.222 config_**_

global_defs {
router_id LVS_RABBITMQ_PROD1
enable_script_security
}

vrrp_script chk_myscript {
script "/usr/bin/pgrep sshd" ! "</dev/tcp/127.0.0.1/5672"
interval 1
fall 2
rise 2
user root
}

vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 51
priority 66
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 123
}
unicast_src_ip 192.168.1.222
unicast_peer {
192.168.1.223
}

virtual_ipaddress {
   192.168.1.224/24
}

track_script {
   chk_myscript
}

}

**!server2, 192.168.1.223 config_**_

global_defs {
router_id LVS_RABBITMQ_PROD2
enable_script_security
}

vrrp_script chk_myscript {
script "/usr/bin/pgrep sshd" ! "</dev/tcp/127.0.0.1/5672"
interval 1
fall 2
rise 2
user root
}

vrrp_instance VI_1 {
state BACKUP
interface ens192
virtual_router_id 51
priority 66
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 123
}
unicast_src_ip 192.168.1.223
unicast_peer {
192.168.1.222
}

virtual_ipaddress {
   192.168.1.224/24 
}     
     
track_script {
   chk_myscript
}        

}

systemd config in both server

[Unit]
Description=LVS and VRRP High Availability Monitor
After=syslog.target network-online.target
After=rabbitmq-server.service
Requires=rabbitmq-server.service

reboot server 1:

log in server 1
Mar 2 08:16:43 FID Keepalived_vrrp[2765]: VRRP_Script(chk_myscript) succeeded
Mar 2 08:16:44 FID rabbitmq-server: completed with 4 plugins.
Mar 2 08:16:47 FID Keepalived_vrrp[2765]: VRRP_Instance(VI_1) Transition to MASTER STATE
Mar 2 08:16:47 FID Keepalived_vrrp[2765]: VRRP_Instance(VI_1) Received advert with higher priority 66, ours 66
Mar 2 08:16:47 FID Keepalived_vrrp[2765]: VRRP_Instance(VI_1) Entering BACKUP STATE
log in server 2
Mar 2 08:14:25 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) Transition to MASTER STATE
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) Entering MASTER STATE
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) setting protocol VIPs.
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs on ens192 for 192.168.1.224
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:26 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) Sending/queueing gratuitous ARPs on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224
Mar 2 08:14:31 FID Keepalived_vrrp[2778]: Sending gratuitous ARP on ens192 for 192.168.1.224

reboot server 2:

log in server 1
Mar 2 08:14:25 FID Keepalived_vrrp[2763]: VRRP_Instance(VI_1) Received advert with higher priority 66, ours 66
Mar 2 08:14:25 FID Keepalived_vrrp[2763]: VRRP_Instance(VI_1) Entering BACKUP STATE
Mar 2 08:14:25 FID Keepalived_vrrp[2763]: VRRP_Instance(VI_1) removing protocol VIPs.
log in server 2
Mar 2 08:16:47 FID Keepalived_vrrp[2778]: VRRP_Instance(VI_1) Received advert with lower priority 66, ours 66, forcing new election

from docker-keepalived.

Peter-YAN avatar Peter-YAN commented on August 15, 2024

i have to follow steps to prohibit the VIP floating.
After OS reboot.

  1. "systemctl disable keepalived" to disable keepalived auto start
  2. change prority in conf to a small number, eg. 65
  3. "systemctl start keepalived" to start keepalived after OS reboot.

from docker-keepalived.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.