Body: <p>This is my new experience with using keepalived,</p>
  <p>I am trying to start docker container of keepalived but it is crashing the error log doesn't explain much:</p>
  <pre><code>*** 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...
  </code></pre>
  <p>this is my keepalived docker compose file:</p>
  <pre><code>services:
    keepalived:
      cap_add:
      - NET_ADMIN
      network_mode: host
      environment:
        KEEPALIVED_INTERFACE: 'enp1s0'  #depends on hosts interface
        KEEPALIVED_UNICAST_PEERS: &quot;#PYTHON2BASH:['192.168.1.10', '192.168.1.11']&quot; #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
  </code></pre>
  <p>Any help will be greatly appreciated.</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-10-26T19:41:16.093Z
Comments: Verify that enp1s0 is available to the container when it is running.  Keepalived does not believe this interface is valid.
Comments: swysocki
Comments: CC BY-SA 4.0
Comments: 2021-10-26T21:00:57.873Z
Comments: inside the container its eth0 not enp1s0 but I dont want to run in privileged mode
Comments: Chang Zhao
Tags: <docker><high-availability>
Title: Keepalived docker container crashing
UserDisplayName: Chang Zhao
ThreadText: # Keepalived docker container crashing
  
  (Asked by: username_0 on 2021-10-24)
  
  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.
  
  **Tags:** docker, high-availability
  
  > **Comments:**
  > **username_1**: Verify that enp1s0 is available to the container when it is running.  Keepalived does not believe this interface is valid.  
  > **username_0**: inside the container its eth0 not enp1s0 but I dont want to run in privileged mode  
  
  ---
  
  ## 0 answers
  
  