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.

Table 1. System Characteristics

Code

dfsync

Mode of operation

Service

Backup mode

Active-Active

Types of sites

All of them

Layer

Configuration

Placement

Internal

Saving and restoring state on reboot

Yes

appendix

era_dfsync

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

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and numbers, must begin with a letter.

roletype

str

required

Role Type. Possible values: "dfsync".

iface

str

required

The alias of the server network interface on which the roles will interact internally with each other.

ext

json

empty

Additional role options. Contains a json object or list.

enabled

bool

empty

Role activity flag. When set to false, the role does not participate in validation and is not started.

is_cross_site

bool

false

An indication of placement on a node server that provides connectivity to other sites.

roleid

int

required

Role ID.
Unique for the entire system, regardless of the site or server. Cannot be changed.
Integer from 1 to 9999.

separate

bool

required

An indication that the role has been allocated to a separate node.

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.

Example node
{
  "name": "dfsync1",
  "iface": "eth0",
  "is_cross_site": false,

  "roleid": 11380,
  "roletype": "dfsync",
  "separate": true
}