<div dir="ltr"><div dir="auto">All great info to know and other than this stats weirdness everything is working fine. The only detail I didn’t share was that the servers are handing out non-overlapping IPs. I'd be happy to provide my configuration experience for Galera. I'll work on writing it up and share when it's done. I will also open a bug for this issue.</div><div dir="auto"><br></div><div>Thanks for the help. </div><br><div class="gmail_quote"><div>On Wed, Dec 13, 2017 at 7:13 AM Tomek Mrugalski <<a href="mailto:tomasz@isc.org" target="_blank">tomasz@isc.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">W dniu 12.12.2017 o 15:48, Munroe Sollog pisze:<br>
> Let me know if this should be a bug, but I have noticed some weird stats<br>
> when running two kea-1.3 DHCP servers from the same mysql database<br>
> (using Galera).<br>
><br>
> I have included a screen grab of the stats.<br>
><br>
> Between noon and 2pm yesterday we when I migrated rogi from the memfile<br>
> to the mysql database. I migrated all of the existing leases from the<br>
> CSV to mysql and started rogi.<br>
><br>
> Igor from around 2:30pm until about 7:45am the next day it steadily<br>
> declines all the way to -436 leases. How can it possibly have<br>
> *negative* leases?<br>
Rasmus is right. Running more than one Kea server using the same<br>
database is not officially supported.<br>
<br>
Here's what is likely to happen: each Kea instance allocates leases to<br>
clients. For each allocation, the statistic is increased. The statistic<br>
is observed on each instance. It is likely to be incorrect as there is<br>
another instance that also allocates leases.<br>
<br>
Now, unless you took extra steps to disable lease expiration on one<br>
instance and keep it running on another, there are two instances<br>
periodically looking for leases that are expired. Depending on how many<br>
leases are expired during exact moment when the expiration triggers, one<br>
server may get more expired leases to process than the other. Only that<br>
server will decrease the statistic.<br>
<br>
Finally, I don't know how you set this up, but I presume that the server<br>
that allocated a lease will send its own server-id and thus the release<br>
messages will be processed only by that server. So this shouldn't<br>
contribute to the confusion, unless you did some clever things with<br>
server-id.<br>
<br>
You may perceive it as a bug. It's a valid point of view. But I see it<br>
as Kea being run in a configuration that is not officially supported.<br>
There's nothing wrong with it. We're happy it provides service and<br>
generally works. It's just there are quirks like this.<br>
<br>
We do have recountLeaseStats4 and recountLeaseStats6 method, but it is<br>
only used internally. I suppose we could expose it as a command that you<br>
could call. Kea instance would then consult the database and recalculate<br>
the values.<br>
<br>
As Rasmus mentioned, we do plan to improve the situation significantly<br>
in 1.4. We want to provide a high availability solution, but also<br>
improve many aspects of running multiple Kea servers at the same time.<br>
<br>
I don't have any specific solution for you right now, just some things<br>
to consider. Kea doesn't have any notion (at least not yet) of a server<br>
instance owning a lease. You could try generating the statistic by<br>
pooling both servers and adding the values together. Consider it an<br>
experiment. It may or may not work. I'd love to hear about the results.<br>
<br>
I'd like to ask you a favour. Can you describe how you did set up Galera<br>
for MySQL on kea wiki? There are installation instructions here:<br>
<a href="http://kea.isc.org/wiki/Install" rel="noreferrer" target="_blank">http://kea.isc.org/wiki/<wbr>Install</a> I was thinking about something similar,<br>
but with detailed instructions how to set up Galera cluster. This would<br>
be useful for two reasons. First, other users could set it up in similar<br>
fashion. Second, one of ISC engineers will get to look at this problem<br>
one day. It will be very helpful to have an instruction to replicate<br>
your environment.<br>
<br>
Finally, can you submit a bug for this? It would great if this bug<br>
report had a link to the installation instruction.<br>
<br>
Hope that helps,<br>
Tomek<br>
______________________________<wbr>_________________<br>
Kea-users mailing list<br>
<a href="mailto:Kea-users@lists.isc.org" target="_blank">Kea-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/kea-users<br></a><br>
</blockquote></div></div>