Sync multiple Nextcloud remote servers (master-master)

Hi, I’d appreciate some ideas on how to keep 2 remote Nextcloud servers in sync to build up a poor man’s HighAvailability.

Mainly to sync Nexcloud files (2-way nearly-real-time sync), but calendar and contacts (thus the database) might step-in in the future.

Scenario:

  • A reserved domain name
  • A couple road users (they can be either at Workplace, at Home or at another remote location)
  • 2 remote servers (different hardware)

##Workplace

  • neth1: one NethServer (LDAP, Nextcloud, etc.)
  • shared folder for local users
  • same shared folder mounted in Nextcloud as external storage (to give access to cloud users without a VPN)

##Home

  • neth2: one NethServer (Nextcloud)

Some Use Cases:

  1. If Workplace (neth1) loses Internet access, remote users could use neth2
  2. If neth1 breaks, any user could connect to neth2

Which options are available?

  • A cluster? (might be overkill: hardware requirements, setup complexity)
  • syncing the servers? [lsyncd | csync2 | osync | csync | Syncthing …] + Nextcloud’s occ files:scan command
  • ¿?

First, I suggest reviving this discussion on the NextCloud forum, looks like they’re trying to achieve the same goal

The question is, what does that involve? Keep users in sync it’s easy with NethServer 7, then you should keep mariadb and nextcloud folders constantly in syn.
Given everything, I still have no clue which issues you will face and how NextCloud will react to this “sync”. Most likely you have to execute occ:scan command each time.

1 Like

Probably you already read these:

Clustering and replications are hard problems. :slight_smile:

As an alternative solution, you could also think to place all data inside a DRBD (using protocol A): https://www.drbd.org/en/doc/users-guide-84/s-drbd-proxy

I did read the articles, and the nethserver-ha docs. Will take a look at DRBD (tought I’m worried about performance, saying it from ignorance as I have no experience with it).
Thanks :wink:

You should! :smiley:

Another alternative: buy a SAN with geographical replication, but this is not for a “poor man’s HighAvailability” :stuck_out_tongue_winking_eye:

1 Like