Additional file system synchronization

The replication process controlled by the eranger-server-replication.pl script keeps the PostgreSQL databases on primary and standby in sync. However, it does not synchronize files or directories elsewhere on the primary’s filesystems. The skoor-syncfs service takes care of additional synchronisation paths. It is delivered by the eranger-syncfs package and responsible for synchronizing files and directories from primary to standby and external collectors using rsync via ssh in the background. Therefore port 22 must be accessible from the primary and standby system to the external collectors and backwards, if required.

Configuration

Custom configuration files can be added to the following directory which also contains the standard SKOOR configurations:

/etc/opt/eranger/skoor-syncfs.d

Configuration files contain one file or directory per line, together with the options --exclude, --nodelete and a variable that describes the target system. Also, systems can be completely excluded from synchronization if required. If whole directories must be synchronized, a trailing / should be added to the directory path for readability. The skoor-syncfs service will synchronize files automatically on every change and specifically before doing a switch of the primary and standby functions. 

Wildcards are not supported in the configuration

Example:

/etc/opt/eranger/eranger-server.cfg {REPLICATION}/etc/opt/eranger/
/srv/eranger/html/ {REPLICATION}/srv/eranger/html/ --exclude tmp --exclude syslog
/usr/share/snmp/mibs/ {COLLECTOR}/usr/share/snmp/mibs/ --nodelete
/opt/eranger/tmp/test/ {SERVER}/opt/eranger/tmp/test/ --exclude sync1.txt
 
!ignore 192.168.23.10 192.168.23.20

Target system variables

Variable

Description

{REPLICATION}

If the local system is a replication primary, files or directories will be synced to the replication standby

{COLLECTOR}

If the local system is a standalone server or replication primary, files or directories will be synced to external collectors. All collectors except the local one will be synced if their last connection date is newer than two weeks

{SERVER}

If the local system is an external collector, files or directories will be synced to all SKOOR servers configured in the local eranger-collector.cfg file

If no target system variable is configured, files will be synchronized locally

External collectors

On the SKOOR server

To be able to synchronize files from a SKOOR server to external collectors, the SSH key login must be enabled. After setting up SSH key login, add the key fingerprint of the collectors to the known_hosts file of user root:

ssh -i /opt/eranger/reranger/.ssh/id_rsa reranger@<external collector address>

On external collectors

External collectors will try to synchronize EEM projects to the SKOOR server. SSH key login for the user reranger must be set up for this to work. If this is not required, the server can be set to ignored.

Ignore systems

If for instance an external collector should not be synced with the SKOOR server, it can be excluded from synchronization. Lines starting with the !ignore keyword can contain one or more IP addresses separated by a space character. All these systems will not be kept in sync.

Default configuration 

The default configuration will synchronize required SKOOR binaries and scripts, configuration files, graphics used for the SKOOR Dashboards as well as non-default SNMP MIBs.