Re: [Keepalived-devel] Start keepalived without IP on interface?
Status: Beta
Brought to you by:
acassen
|
From: Paul G. <gi...@tc...> - 2018-06-29 14:18:56
|
Thanks Quentin, I'll download and try that. Seems promising.
Another question, is it possible to run multiple instances of the keepalive
daemon on the same host? I tried setting a pidfile for it and the command
seemed to take (no errors), however the second instance didn't start and
there were no logs printed.
paul@paul:/etc$ keepalived -f /etc/keepalived2.conf --dont-fork
--log-console -p /var/run/test.pid
paul@paul:/etc$
paul@paul:/etc$ ps ax | grep keep
18248 pts/39 Z 0:00 [keepalived] <defunct>
21726 ? Ss 0:00 /usr/sbin/keepalived -f /etc/keepalived.conf
21727 ? S 0:00 /usr/sbin/keepalived -f /etc/keepalived.conf
21728 ? S 0:00 /usr/sbin/keepalived -f /etc/keepalived.conf
--
Paul
On 29 June 2018 at 12:10, Quentin Armitage <qu...@ar...> wrote:
> Can you try keepalived v2.0.5. The version 2.0.x series supports "dynamic"
> interfaces, in other words using an interface that doesn't exist when
> keepalived starts, but is subsequently created. You might need to add the
> keyword "dynamic_interfaces" in the global_defs section of your
> configuration.
>
> To be honest, I'm not sure if it will work, since I have never thought
> about this situation. If it doesn't work, then I think keepalived should be
> modified so that the vrrp instance is in fault state until the underlying
> interface has an address.
>
> Quentin Armitage
>
> On Fri, 2018-06-29 at 11:02 +0100, Paul Gildea wrote:
>
> I'm new to keepalived. I want to use keepalived on an interface that will
> get an IP at some point but will not have one initially, can I set this up
> somehow in the config? If I try to start it now keepalived errors out as
> keepalived doesn't know what source IP address to use when sending VRRP
> packets. If this is not possible I presume I could set up a dummy IP and
> remove it after keepalived starts or script keepalived to start after the
> interface gets a valid IP, just wondering is it possible to start without
> said IP and I just can't find out how to do it.
>
> Conf:
>
> ! Configuration File for keepalived
>
> vrrp_instance VI_1 {
> state MASTER
> interface eth0
> virtual_router_id 51
> priority 150
> advert_int 1
> authentication {
> auth_type PASS
> auth_pass pwd
> }
> virtual_ipaddress {
> 192.168.0.13
> }
> notify /etc/state_change.py
> }
>
> Log:
>
> keepalived -f /etc/keepalived.conf --log-console --dont-fork
> Thu Jun 28 11:25:53 2018: Starting Keepalived v1.4.4 (05/08,2018)
>
> Thu Jun 28 11:25:53 2018: Running on Linux 4.7.8 #9 SMP Wed Jun 27
> 17:25:18 IST
> 2018 (built for Linux 4.7.8)
>
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: Starting Healthcheck child process,
> pid=18886
> Thu Jun 28 11:25:53 2018: Starting VRRP child process, pid=18887
>
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: Registering Kernel netlink reflector
>
> Thu Jun 28 11:25:53 2018: Registering Kernel netlink command channel
>
> Thu Jun 28 11:25:53 2018: Registering gratuitous ARP shared channel
>
> Thu Jun 28 11:25:53 2018: Opening file '/etc/keepalived.conf'.
>
> Thu Jun 28 11:25:53 2018: WARNING - default user 'keepalived_script'
> for script
> execution does not exist - please create.
>
> Thu Jun 28 11:25:53 2018: (VI_1): Cannot find an IP address to use for
> interface
> eth0
>
> Thu Jun 28 11:25:54 2018: Stopped
>
> Thu Jun 28 11:25:54 2018: Keepalived_vrrp exited with permanent error
> CONFIG. Te
> rminating
>
> Thu Jun 28 11:25:54 2018: Stopping
>
> Thu Jun 28 11:25:54 2018: Stopped
>
> Thanks,
>
> --
> Paul
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
> _______________________________________________
> Keepalived-devel mailing lis...@li...://lists.sourceforge.net/lists/listinfo/keepalived-devel
>
>
|