Three node syncthing with two masters


I want to sync my files between three servers. I want two servers to be masters (any changes on any of them will change files on all servers) and one server to be slave (masters just overwrite any changes there).

Is it possible?

1 Like

Currently IMHO not, see also:

As @jedie says, this isn’t currently supported. A master repository is protected against all external changes, so changes from the “other master” won’t be allowed.

But I think there is a relatively simple solution. Suppose you want changes to be synced two-way between A and B, but you want C to accept all changes and not propagate any (so A and B would both be masters, and C would be what other software calls read-only nodes).

Suppose the things you want synced live in directory ~/D1 (at least in machine A).

In A add two folders (I mean, “Folders” in the sense of the user interface of ST, not in the “directory of a filesystem” sense)

  • A-one-way-C
  • A-two-way-B

both of them use as Folder Path ~/D1, but in A-one-way-C, “Folder master” is checked.

Now, in both B and C accept the creation of the new folder, use ~/D1 (or whatever) in your filesystem, and you are done.

I just tried it, and it works fine. The key idea is that syncthing has no trouble using the same directory in different “Folders”, so you can share it in different ways (as “Master” and as non master).

This is not as simple as checking boxes for “read only”, etc, but it seems to work and is just fine (at least for small numbers of interconnected nodes).

P.S. You might also think about adding, in B, a B-one-way-C but this to me is confusing and when playing with it, it can lead to trouble. This makes sense: if you have just

A-one-way-C A-two-way-B

it is unambiguous how changes can and cannot propagate. If you add B-one-way-C then it ain’t.

That’s both neat and a bit scary :slight_smile:

Scary? Oh, oh. That means I can expect trouble using this?

Yeah, multiple sync basically needs to be added to the stack of TODO stuff as a reqested feature. There are some work-arounnds… ie you might be able to patch the source code to get it to work…

If we get this working,Syncthing can be an augmentation to or replacement for services like Dropbox…

Another problem I noticed personally is that when I sync’d three servers with one master, it did not increase the speed of an upload over two servers considerably. At least for me, the two servers don’t seem to be doing the bittorrent (“grab the rarest chunk first”) method. But I haven’t reviewed that part of the code yet.

The better long term feature is to put this into the next release of the protocol

Syncthing only shares pieces to other devices if it has the complete file - see #950 Also each device needs to share with all other devices as Syncthing does not exchange everything with everyone (like BTSync)

Yeah you’re right. This is definitely something I want to fix first thing, or at least make it an option.

That’s really important to me because I want simultanous backup and distributed network filesystem in the same program.

I need this “read only” node too

Create a feature request now

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.