Re: can unicast_peer be the same on all nodes?
Quentin Armitage <[email protected]> Wed, 13 Jun 2018 07:55:34 +0100
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Organization | The Armitage family |
| Message-ID | <[email protected]> |
--===============3264262341785550500==
Content-Type: multipart/alternative; boundary="=-581s2OWs13RmFE0V/vxl"
--=-581s2OWs13RmFE0V/vxl
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
On Tue, 2018-06-12 at 08:55 -0700, Jeffrey Lewis wrote:
> Hi Quentin,
> Thanks for your quick reply! A follow up question. If I wanted to
> create a single-node keepalived cluster (for testing or other non-
> production use), could I force keepalived to use UNICAST by putting
> the loopback address in unicast_peer? For example, a single-node
> cluster might do the following,
>
> unicast_peer {
> 127.0.1.2
> }
>
> I assume this would illicit the same unpredictable behavior, but
> figured I'd ask anyway. :)
>
> (Use Case: We sometimes want a single-node cluster but do *not* want
> keepalived sending multicast adverts.)
>
> Thanks,
> Jeffrey
>
Jeffrey,
There is a check in keepalived that a vrrp instance is not configured
to use a loopback interface, so it certainly won't work if you are
wanting to configure such an address on a loopback interface. There are
other complications with running more than one instance of keepalived
in a system such as they would by default want to use the same pid
file; this can be resolved by using the -i command line option.
What I do for testing keepalived in a single node is I create network
namespaces, add links to the namespaces that are connected between the
namespaces, and run different instances of keepalived in the
namespaces.
If this is of interest to you (or anyone else) I can provide copies of
the scripts I use and example configurations.
Quentin Armitage
>
>
> On Tue, Jun 12, 2018 at 1:32 AM, Quentin Armitage <[email protected]
> rg.uk> wrote:
> > On Mon, 2018-06-11 at 19:01 -0700, Jeffrey Lewis wrote:
> > > Hello,
> > > Sorry for the usage question, but the documentation is not clear
> > > on this point (at least not clear to me).
> > >
> > > Is it ok (in keepalived 1.2.19) for unicast_peer to contain the
> > > IP addresses of all hosts, including itself? For example, if
> > > NodeA has 10.1.2.101 and NodeB has 10.1.2.102, can I put the
> > > following into keepalived.conf on *both* nodes?
> > >
> > > unicast_peer {
> > > 10.1.2.101
> > > 10.1.2.102
> > > }
> > >
> > > Thanks,
> > > Jeffrey
> > >
> > >
> >
> > That would not be a safe thing to do. A node would be sending
> > adverts to itself, and I think the behaviour would at best be
> > unpredictable.
> >
> > It was for situations like this that conditional configuration was
> > introduced, so that the same configuration file could be used on
> > multiple systems, so for example one could configure:
> > unicast_peer {
> > @^nodeA 10.1.2.101 # All nodes except nodeA
> > @^nodeB 10.1.2.102
> > @^nodeC 10.1.2.103
> > }
> >
> > @nodeA unicast_src_ip 10.1.2.101 # Node nodeA only
> > @nodeB unicast_src_ip 10.1.2.102
> > @nodeC unicast_src_ip 10.1.2.103
> >
> > Unfortunately this feature was introduced in version 1.3.6.
> >
> > Quentin Armitage
--=-581s2OWs13RmFE0V/vxl
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><head></head><body bgcolor=3D"#ffffff" text=3D"#2e3436" link=3D"#2a76=
c6" vlink=3D"#2e3436"><div>On Tue, 2018-06-12 at 08:55 -0700, Jeffrey Lewis=
wrote:</div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex; border-l=
eft:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr">Hi Quentin,<div><b=
r></div><div>Thanks for your quick reply! A follow up question. =
If I wanted to create a single-node keepalived cluster (for testing or oth=
er non-production use), could I force keepalived to use UNICAST by putting =
the loopback address in unicast_peer? For example, a single-node clus=
ter might do the following,</div><div><br></div><div>unicast_peer {</div><d=
iv> 127.0.1.2</div><div>}</div><div><br></div><div>I assume this woul=
d illicit the same unpredictable <span style=3D"font-size:12.8px;background=
-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color=
:initial;float:none;display:inline">behavior, but figured I'd ask anyway. :=
)</span></div><div><br></div><div>(<span style=3D"font-size:small;backgroun=
d-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-colo=
r:initial;float:none;display:inline">Use Case: We sometimes want a si=
ngle-node cluster but do *not* want keepalived sending multicast adverts.)<=
/span></div><div><br></div><div>Thanks,<br>Jeffrey</div><div><br></div></di=
v></blockquote><div>Jeffrey,</div><div><br></div><div>There is a check in k=
eepalived that a vrrp instance is not configured to use a loopback interfac=
e, so it certainly won't work if you are wanting to configure such an addre=
ss on a loopback interface. There are other complications with running more=
than one instance of keepalived in a system such as they would by default =
want to use the same pid file; this can be resolved by using the -i command=
line option.</div><div><br></div><div>What I do for testing keepalived in =
a single node is I create network namespaces, add links to the namespaces t=
hat are connected between the namespaces, and run different instances of ke=
epalived in the namespaces.</div><div><br></div><div>If this is of interest=
to you (or anyone else) I can provide copies of the scripts I use and exam=
ple configurations.</div><div><br></div><div>Quentin Armitage</div><blockqu=
ote type=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2px #729fcf solid=
;padding-left:1ex"><div dir=3D"ltr"><div><br></div><div><br></div><div><br>=
</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tu=
e, Jun 12, 2018 at 1:32 AM, Quentin Armitage <span dir=3D"ltr"><<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected].=
uk</a>></span> wrote:<br><blockquote type=3D"cite" style=3D"margin:0 0 0=
.8ex; border-left:2px #729fcf solid;padding-left:1ex"><div bgcolor=3D"#fff=
fff" text=3D"#2e3436" link=3D"#2a76c6" vlink=3D"#2e3436"><div><div class=3D=
"h5"><div>On Mon, 2018-06-11 at 19:01 -0700, Jeffrey Lewis wrote:</div><blo=
ckquote type=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2px #729fcf s=
olid;padding-left:1ex"><div dir=3D"ltr">Hello,<div><br></div><div>Sorry for=
the usage question, but the documentation is not clear on this point (at l=
east not clear to me).</div><div><br></div><div>Is it ok (in keepalived 1.2=
.19) for unicast_peer to contain the IP addresses of all hosts, including i=
tself? For example, if NodeA has 10.1.2.101 and NodeB has 10.1.2.102,=
can I put the following into keepalived.conf on *both* nodes?</div><div><b=
r></div><div>unicast_peer {</div><div> 10.1.2.101</div><div> 10=
.1.2.102</div><div>}</div><div><br></div><div>Thanks,<br>Jeffrey</div><div>=
<br></div></div>
</blockquote></div></div><div>That would not be a safe thing to do. A node =
would be sending adverts to itself, and I think the behaviour would at best=
be unpredictable.</div><div><br></div><div>It was for situations like this=
that conditional configuration was introduced, so that the same configurat=
ion file could be used on multiple systems, so for example one could config=
ure:</div><div>unicast_peer {</div><div>@^nodeA 10.1.2.101 # All nodes =
except nodeA</div><div>@^nodeB 10.1.2.102</div><div>@^nodeC 10.1.2.103</div=
><div>}</div><div><div><br></div><div>@nodeA unicast_src_ip 10.1.2.101 =
# Node nodeA only</div><div>@nodeB unicast_src_ip 10.1.2.102</div><div>@nod=
eC unicast_src_ip 10.1.2.103</div><div><br></div><div>Unfortunately this fe=
ature was introduced in version 1.3.6.</div><span class=3D"HOEnZb"><font co=
lor=3D"#888888"><div><br></div><div>Quentin Armitage</div></font></span></d=
iv></div></blockquote></div><br></div>
</blockquote></body></html>
--=-581s2OWs13RmFE0V/vxl--
--===============3264262341785550500==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============3264262341785550500==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
--===============3264262341785550500==--