lolpepijn wrote:Cool let's build a high availabilty domoticz clusterCopyCatz wrote: Hmm when my conrad antenna comes in I probably will be able to control pepijn's devices hehe
Reading stories about failing SD cards and all other things that could go wrong on a Raspberry PI, I'd like to ask: ..Any progress on the cluster?
It's not like that I really need it, but it would be really awesome to have it: two Raspberries, both running Domoticz, complete with RF tranceivers and all. One active, one hot-spare. And I could imagine that with such a feature, Domoticz could be deployed at sites that really need high up-times.
Config and script file directories can be replicated by scripts, the database might be synced by scripts but that might not be necessary, since both Domoticz instances will receive the same RF signals. So (partial) sync is only needed when one has been offline for a while, and, of course, initial sync, to duplicate the first and active into the hot-spare. (insider knowledge of the database is needed)
In normal operation, both Domoticz instances will have their own IP address. When the active fails, the hot-spare will need to activate itself, using the IP-address of the failed one, and possibly shutdown the OS of the failed one, if only Domoticz crashes. Even this can be scripted. The hot-spare will need to monitor the active. Can also be scripted.
If GPIO is in use... well, most inputs can be connected to both Domoticz RPIs, outputs need some buffering electronics parts. Can also be done.
And probably there will be some considerations when writing LUA code for running on clustered Domoticz systems: needs to be well documented.
There are two issues, that need some Domoticz-tinkering, for this:
- The hot-spare Domoticz instance should not transmit any RF signals: two simultaneous RF sends will jam eachother. This needs to be implemented in Domoticz itself. Could be a system switch or something like that.
- The active Domoticz needs to forward incoming network commands, like certain JSON API commands and maybe IP device state info, to the hot-spare. Probably this is already possible via de remote shared port for remote Domoticz clients. I didn't investigate that, yet.
I could imagine all needed scripting bundled in a single add-on package that comes with a custom html page that adds the controls, cluster settings and status info. The best solution would be that it's a feature of Domoticz itself.