Primary and BackUp Local Server Config

hi @Dmitriy

I’d like to have a primary and failover backup local server config.
I was thinking of simply copying my xxxx@xxxx.com.Blynk,user files from one Blynk server to another and keeping them in sync if I make any changes over time.

Then in my sketch if I found one Blynk connection to be offline I would get the sketch to re-connect to other Blynk server and continue.

Personally I think this would work with no underlying issues (apart from history data being split).
Just wanted to confirm if you could you foresee any underlying issues with this setup ?

1 Like

I see a small issue… the syncing. The server file is constantly being updated every second… I suppose you could have a timed script to copy across from main server to backup, but synchronizing or failing over? That is a whole next level task :stuck_out_tongue:

Copy is fine. Also you may add DB to your local server and all data will be duplicated to DB also. And you can restore all from DB with “-restore” option when running jar file.

thanks for response - will give it a go :wink:

fair point - but i run a set of defaults and I can always write back to backup blynk server as long as I have a copy in my sketch local variables or SPIFFs of the key state variables that matter.

I just backup my entire Blynk folder (I use WinSCP)… then I can simply install Java and copy the folder onto another RPi for a fully operational cloned server.

Just use RSYNC. It should have no issues keeping two servers in sync. It’s actually made for this :slight_smile:

You could add a loadbalancer in front of the Pi’s (or on the Pi’s). The loadbalancer will regulate your connection to what server. I don’t see any problems. It can even sync your historical data. There shouldn’t be more than a few seconds latency for the data syncing using rsync.

It’s a very good idea though. I’m gonna try this too!

1 Like

I have the switch over working nicely – its actually a piece of cake.
I’d like to use rsync, but not as familiar with rsync as I’d like to be.