Domain Folder Synchronizator (dfsync)
Description
A service role that provides synchronization of :SYNC directory files between different servers on the system. Communication between sites provides without direct connection of the type full-mesh. Tracks file system changes for each directory according to directory mapping to domains, and provides propagation to all site servers serving the respective domains. The :SYNC/common directory is synchronized across all sites.
It is fundamentally non-redundant, covering the entire server network with instances. There is no need to use a microservice in a single-server configuration.
Receives notifications of file system changes using the package inotify-tools. Files are reconciled by date and size. Content hash sums are not applied for performance optimization purposes.
At startup, reads the directory structure and creates a cache, and then regularly monitors the synchronization status with other servers in the group. If necessary (mismatch of hexameters), each instance performs a one-way synchronization to its own side. The cache is stored on disk, among other things. When files are deleted, information about it is stored in the cache for 1 year.
Code |
|
Mode of operation |
|
Backup mode |
|
Types of sites |
|
Layer |
|
Placement |
|
Saving and restoring state on reboot |
|
appendix |
|
Limitations
-
Not present in the initial single-server configuration.
-
Must be present 1 time on each server.
-
In a configuration with more than 1 site, each site at least one instance must have the `is_cross_site` feature enabled to ensure data synchronization with other sites. If more than one trait is enabled, each pulls data from other sites independently, increasing the channel load.
Parameters
Configuration example
The configuration is managed in an application available to master domain administrators. The application hides the full content of the configuration, but it is nevertheless accessible via the API.
The configuration contains a section to describe all instances of all roles. Parameters are defined for each specific role instance.
{
"name": "dfsync1",
"iface": "eth0",
"is_cross_site": false,
"roleid": 11380,
"roletype": "dfsync",
"separate": true
}