Search code examples
linuxreplicationlsyncd

Understanding csync2 & lsyncd Syncing Mechanism


So I have two Servers configured for file replication. Imagine one being "Server1" and the other one is "Server2". I Configured lcyncd and csync2 on both nodes and sync work perfectly.

I was wondering what happens at Server2 when I add new files to Server1's syncing folder. If I create a new file in Server1, lsyncd in Server1 detect the change and trigger csync2 to sync that file to Server2. At the same time, lsyncd in Server2 detects that new file it will also start to sync that file to Server1 ryt? or something else?


Solution

  • Well, http://oss.linbit.com/csync2/paper.pdf, from my understanding, lsyncd pretty much runs a fs watch on the dirs, and pushes any changes, when a after it pushes to it's peers, csync uses the conflict resolution algorithms (younger or older, bigger or smaller, left or right host, etc).