[Kea-users] KEA instances with shared database

Emile Swarts emile at madetech.com
Sat Dec 12 09:55:15 UTC 2020


Hi,

Thanks for getting back to me. My assumptions about the in-memory state was
largely based on this conversation:
https://lists.isc.org/pipermail/kea-users/2017-December/001528.html

Also point 4 on this page states: (
https://kb.isc.org/docs/kea-performance-optimization)


*"Avoid shared lease backends. When multiple Kea servers share a single
lease backend (e.g. with a cluster of databases serving as the lease
backend with multiple Kea instances sharing the same pools of addresses for
allocation), they will run into contention for assigning addresses.
Multiple Kea instances will attempt to assign the next available address;
only the first one will succeed and the others will have to retry."*
The design I'm trying to achieve:

1. Multiple KEA instances (AWS ECS Fargate) sitting behind an AWS Network
Load Balancer, sharing a single mysql backend
2. Horizontal scaling of these instances up and down to accommodate load
3. All instances are provisioned with the same configuration file (pools,
subnets .etc)
4. Zero downtime deployments by removing instances and having the load
balancer redirect traffic to remaining instances

My concerns are mainly around race conditions and the iterator to find the
next available IP to hand out.
Does it sound like the above could be achieved?

Regards,
Emile

On Fri, Dec 11, 2020 at 7:11 PM Tomek Mrugalski <tomek at isc.org> wrote:

> On 11.12.2020 18:12, Emile Swarts wrote:
> > I've looked at implementing multiple KEA instances with a shared
> database.
> > I realise that this current setup will hand out overlapping IPs because
> > the leases are stored in memory not in the database.
> Where did you get this impression from? This is mostly incorrect. If you
> configure Kea to use a database to store leases, Kea will never cache
> anything in memory and will always do a DB lookup before assigning
> anything. The only way I can think of making Kea to keep the leases
> "stored in memory" would be using memfile as lease backend, but then Kea
> would never look up leases in a DB.
>
> > I'm in the process of adding KEA HA, but just wanted to confirm that
> > there is no way to force a lookup in the database to find the next
> > available IP before committing to this approach.
> Kea doesn't work the way you think it is. Kea always looks up the lease
> database and never keeps any memory cache of it.
>
> Tomek
> _______________________________________________
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>


-- 
Emile Swarts
Software Engineer

<https://www.madetech.com?utm_source=signaturesatori&utm_medium=email&utm_campaign=general_signature>

www.madetech.com
<https://www.madetech.com?utm_source=signaturesatori&utm_medium=email&utm_campaign=general_signature>

twitter.com/madetech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/kea-users/attachments/20201212/d2d164e5/attachment.htm>


More information about the Kea-users mailing list