1

This is my new experience with using keepalived,

I am trying to start docker container of keepalived but it is crashing the error log doesn't explain much:

*** Running /container/run/process/keepalived/run...
Waiting config file /usr/local/etc/keepalived/keepalived.confok
Sun Oct 24 07:59:02 2021: Starting Keepalived v2.0.20 (01/22,2020)
Sun Oct 24 07:59:02 2021: Running on Linux 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 (built for Linux 4.19.36)
Sun Oct 24 07:59:02 2021: Command line: '/usr/local/sbin/keepalived' '-f' '/usr/local/etc/keepalived/keepalived.conf'
Sun Oct 24 07:59:02 2021:               '--dont-fork' '--log-console' '--log-detail' '--dump-conf'
Sun Oct 24 07:59:02 2021: Opening file '/usr/local/etc/keepalived/keepalived.conf'.
Sun Oct 24 07:59:02 2021: Starting VRRP child process, pid=49
Sun Oct 24 07:59:02 2021: Registering Kernel netlink reflector
Sun Oct 24 07:59:02 2021: Registering Kernel netlink command channel
Sun Oct 24 07:59:02 2021: WARNING - default interface enp1s0 doesn't exist
Sun Oct 24 07:59:02 2021: Opening file '/usr/local/etc/keepalived/keepalived.conf'.
Sun Oct 24 07:59:02 2021: (Line 6) WARNING - interface enp1s0 for vrrp_instance VI_1 doesn't exist
Sun Oct 24 07:59:02 2021: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
Sun Oct 24 07:59:02 2021: Non-existent interface specified in configuration
Sun Oct 24 07:59:02 2021: Stopped - used 0.000000 user time, 0.005967 system time
Sun Oct 24 07:59:02 2021: Keepalived_vrrp exited with permanent error CONFIG. Terminating
Sun Oct 24 07:59:02 2021: Stopped Keepalived v2.0.20 (01/22,2020)
*** /container/run/process/keepalived/run exited with status 0
*** Running /container/run/process/keepalived/finish...
Unknown state
*** Killing all processes...

this is my keepalived docker compose file:

services:
  keepalived:
    cap_add:
    - NET_ADMIN
    network_mode: host
    environment:
      KEEPALIVED_INTERFACE: 'enp1s0'  #depends on hosts interface
      KEEPALIVED_UNICAST_PEERS: "#PYTHON2BASH:['192.168.1.10', '192.168.1.11']" #IP of others nodes
      KEEPALIVED_PRIORITY: '200' #change between nodes
      KEEPALIVED_VIRTUAL_IPS: 192.168.1.250
    image: osixia/keepalived:2.0.20
    deploy:
      restart_policy:
        condition: on-failure

Any help will be greatly appreciated.

2
  • Verify that enp1s0 is available to the container when it is running. Keepalived does not believe this interface is valid.
    – swysocki
    Oct 26 at 19:41
  • inside the container its eth0 not enp1s0 but I dont want to run in privileged mode
    – Chang Zhao
    Oct 26 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.