Replicating storage efficiently
You could use lsyncd
to have a constant syncing of files between systems. lsyncd
installs inotify watches on directories that are synced. Whenever files change in the directories, it will transfer changes to remote server using rsync
.
On the block level, the synchronization can be done using Starwind that makes a mirrored disk on both ends. It can run over iSCSI LUNs, making active-active storage. No additional hardware required. https://www.starwindsoftware.com/blog/storage-ha-on-the-cheap-fixing-synology-diskstation-flaky-performance-with-starwind-free-part-3-failover-duration
On the file level, lsyncd and rsync do a mirror synchronizing files between servers. These tools might require tweaking the configuration files in order to ensure the file locking mechanism works as expected and no split-brain would occur. https://linoxide.com/tools/setup-lsyncd-sync-directories/