Domain Folder Synchronizator (dfsync)
Description
A service role that synchronizes files in the :SYNC directory between different system servers. It provides communication between sites without a direct full-mesh connection. It monitors file system changes for each directory according to the binding of directories to domains and propagates them to all servers of the sites serving the corresponding domains. The :SYNC/common directory is synchronized on all sites.
Fundamentally not made redundant; its instances cover the entire server network. There is no need to use the microservice in a single-server configuration.
Receives file system change notifications using the inotify-tools package. Files are compared by date and size. Content hash sums are not used to optimize performance.
On startup, it reads the directory structure and creates a cache, then regularly monitors synchronization state with other servers in the group. If necessary (checksum mismatch), each instance performs one-way synchronization in its own direction. The cache is also stored on disk. When files are deleted, information about this is retained in the cache for 1 year.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Limitations
-
Not present in the initial single-server configuration.
-
Must be present once on each server.
-
In a configuration with more than 1 site, at least one instance on each site must have the `is_cross_site` flag enabled to ensure data synchronization with other sites. If more than one instance has the flag enabled, each pulls data from other sites independently, increasing channel load.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
required |
Name. May consist of Latin letters and digits and must start with a letter. |
|
|
required |
Role type. Possible values: |
|
|
empty |
Additional role options. Contains a JSON object or list. |
|
|
empty |
Role activity flag. When set to false, the role does not participate in validation and is not started. |
|
|
empty |
Limit on the number of CPU logical cores used. Default: 0 - unlimited. |
|
|
empty |
Default logging level set specifically for the role instance (microservice type). More |
|
|
|
Flag allowing parameter differences in roles of the same group. Default: false - not allowed. |
|
|
|
Flag indicating placement on a hub server that provides communication with other sites. |
|
|
required |
Role identifier. |
|
|
required |
Flag indicating whether the role is allocated to a separate node. |
Configuration example
Configuration management is performed in an application available to master domain administrators. The application hides the full configuration content, but it is still available through the API.
The configuration contains a section describing all instances of all roles. Parameters are defined for each specific role instance.
{
"name": "dfsync1",
"is_cross_site": false,
"roleid": 11380,
"roletype": "dfsync",
"separate": true
}