On Sat, Sep 04, 2021 at 03:34:59PM +0100, Ed W wrote:
> On 04/09/2021 12:07, Chris Green wrote:
> > On Sat, Sep 04, 2021 at 11:29:32AM +0100, Ed W wrote:
> >> On 04/09/2021 09:15, Chris Green wrote:
> >>
> >>> I was aiming to synchronise the lease file in /var between the two
> >>> systems as well as the configuration.
> >>>
> >> Did you see my suggestion to cross post the events to each machine using 
> >> a script? I replied in one 
> >> of your other threads re this situation? I think you could make a 
> >> simple/imperfect 
> cluster setup 
> >> like this fairly easily? (good enough for a small home lan)
> >>
> > Yes, but I'm not quite clear what you mean by "cross post the events"?
> > Do you mean something more than just synchronising the 
> > /var/lib/misc/dnsmasq.leases 
> > file between the two systems?
> 
> Hi, yes, dnsmasq emits a dbus event when a lease is created and has a dbus 
> method to add a lease to 
> it's db.
> 
> Both can be scripted (examples given), so you can effectively "do something" 
> every time a lease is
> handed out and poke the details of that lease into the other system *live*, 
> ie it goes directly into 
> its in memory db (which eventually will filter out to the on disk db)
> 
> This gives you your optimal solution in that both machines have an in sync 
> view of the lease table, 
> ie promoting the second machine will immediately know the state of all 
> the leases handed out by the 
> first
> 
> I speculate (without proof) that it might even work "well enough" to have 
> both machines online and
> fighting to hand out dhcp leases... It's definitely *wrong*, but on a small 
> network it might not
> break...
> 
I think I can probably just use syncthing to synchronise the lease
file across systems.  Since the normal case will be that only one
system is changing the file it's a simple sync requirement.

If/when a system fails sync is no longer doing anything.

Trying to run both DHCP servers seems just a bit risky! :-)

-- 
Chris Green

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to