Re: can unicast_peer be the same on all nodes?

Jeffrey Lewis <[email protected]> Tue, 12 Jun 2018 08:55:30 -0700
Newsgroups gmane.linux.keepalived.devel
Message-ID <CANZj5iL=V9=F2bEM1RaCpt9kBHGLEqMYoM+wrSEDVgN+MRV5rQ@mail.gmail.com>
--===============8786557229512260059==
Content-Type: multipart/alternative; boundary="00000000000055d879056e73e51c"

--00000000000055d879056e73e51c
Content-Type: text/plain; charset="UTF-8"

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






On Tue, Jun 12, 2018 at 1:32 AM, Quentin Armitage <[email protected]>
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
>

--00000000000055d879056e73e51c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Quentin,<div><br></div><div>Thanks for your quick reply=
!=C2=A0 A follow up question.=C2=A0 If I wanted to create a single-node kee=
palived cluster (for testing or other non-production use), could I force ke=
epalived to use UNICAST by putting the loopback address in unicast_peer?=C2=
=A0 For example, a single-node cluster might do the following,</div><div><b=
r></div><div>unicast_peer {</div><div>=C2=A0 127.0.1.2</div><div>}</div><di=
v><br></div><div>I assume this would illicit the same unpredictable <span s=
tyle=3D"font-size:12.8px;background-color:rgb(255,255,255);text-decoration-=
style:initial;text-decoration-color:initial;float:none;display:inline">beha=
vior, but figured I&#39;d ask anyway. :)</span></div><div><br></div><div>(<=
span style=3D"font-size:small;background-color:rgb(255,255,255);text-decora=
tion-style:initial;text-decoration-color:initial;float:none;display:inline"=
>Use Case:=C2=A0 We sometimes want a single-node cluster but do *not* want =
keepalived sending multicast adverts.)</span></div><div><br></div><div>Than=
ks,<br>Jeffrey</div><div><br></div><div><br></div><div><br></div><div><br><=
/div><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Tue, Jun 12, 2018 at 1:32 AM, Quentin Armitage <span dir=3D"ltr=
">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">quentin@=
armitage.org.uk</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v bgcolor=3D"#ffffff" 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><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex;border-le=
ft:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr">Hello,<div><br></di=
v><div>Sorry for the usage question, but the documentation is not clear on =
this point (at least not clear to me).</div><div><br></div><div>Is it ok (i=
n keepalived 1.2.19) for unicast_peer to contain the IP addresses of all ho=
sts, including itself?=C2=A0 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* nod=
es?</div><div><br></div><div>unicast_peer {</div><div>=C2=A0 10.1.2.101</di=
v><div>=C2=A0 10.1.2.102</div><div>}</div><div><br></div><div>Thanks,<br>Je=
ffrey</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>

--00000000000055d879056e73e51c--


--===============8786557229512260059==
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
--===============8786557229512260059==
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

--===============8786557229512260059==--