With Pi-hole version 5, shouldn't the pihole-FTL.db be backed up as well?
EDIT:
Having read @DL6ER's comment above, trying to understand why pihole-FTL.db is not required. When gravity.db is transferred to the 2nd Pi, does pihole-FTL.db get auto-generated / auto-computed?
This is the long term database of queries for the device on which it is running. That database will continue running as-is on both instance of Pi-hole, recording the queries per the privacy setting on each device.
I mean it’s not hard, you have a router setup as the dns on the network, set it up so that it forwards all dns queries to pi 1 by default, but if pi 1 isn’t active then it sends it to pi 2
I too would like the ability to cluster 2 or more Pi-hole instances that doesn't require custom scripts that could inevitably break without me noticing. A clustering solution provided via the GUI would be such a great addition to the already great features of Pi-hole.
In addition to the syncing of adlists, whitelists etc the syncronisation of stats would be great also. I would likely plan to use a load balancer infront of the pi-holes so I personally wouldn't have the need for a cluster IP solution created/used by Pi-hole.
Maybe better to create your own thread here to discuss.
Maybe if you agree, have a mod split this topic ?
I noticed you do a one on one rsync of the gravity dbase file:
Wouldn't that potentially also rsync the dbase file that might still be in transition performing some UPDATE query or something else ?
Isnt it safer to dump the dbase instead on the "primary" and copy the dump over to the "secondaries" eg:
sqlite3 /etc/pihole/gravity.db ".backup main gravity.db.dump"
And restore/import on the secondary hosts if checksum check (md5 or whatever) has changed with:
sudo -u pihole sqlite3 /etc/pihole/gravity.db ".restore main gravity.db.dump"
Would need to stop pihole-FTL to prevent tables being locked while importing.
EDIT: wrong dbase
EDIT2: looks like I'm able to split these posts to a new thread if you like ?
I'd really like for this to be a built-in, official feature. I actually thought it already was - I've seen lots of folks talk about running two pi-holes and I saw the "Teleporter" tab in settings, so I just figured that was how you do it. Then I set up a second pi-hole today and realized "Teleporter" is just for manual backup and restore.
So, I figured I could still get a second pi-hole to be a backup DNS server, even if I have to manually "teleport" the settings and only one can run DHCP... but then I realized that there is no GUI configuration option to make my first pi-hole's DHCP server give out the second pi-hole's IP address as a second DNS server.
Given how many threads and custom scripts there are for this, I think it would make sense to make it an official feature of pi-hole.
I have been waiting years for this feature. I don't understand why this has not been implemented yet or really any work has been done. It was requested almost 6 years ago and has just shy of twice the votes of the next most voted feature request. Yet you still have to do a ton of jank in order to get it working.