« Back to Product

Documentation

Replication

With the paid extension Mirroring, a system can be operated as mirror (slave) of another system (master). The replication is configured in the core instance "Replication" or in the file "replication.json" and is read when IP-Symcon starts. Changes to the configuration therefore only take effect after a restart of the service.

If the replication is active, the slave loads the configuration from the master on startup. During operation, it synchronizes the changes of the master every 5 seconds. Changes made directly on the slave are overwritten in the process.

Mode Constant Name Description
0 REPLICATION_MODE_PARALLEL Parallel The slave is fully operational and all its connections are active.
1 REPLICATION_MODE_STANDBY Standby The I/O instances of the slave do not establish connections and remain in the status Standby (106, IS_STANDBY). Events and timers of instances are not executed. The slave only becomes active on failover.

Failover

In the mode Standby, the slave can take over the tasks of the master by being promoted to master with IPS_PromoteToReplicationMaster. In doing so, the synchronization is paused, all instances in the status Standby are activated and events as well as timers are executed again. If the automatic failover is active (parameter "FailoverActive"), this happens automatically as soon as the synchronization with the master has failed as many times in a row as specified in the parameter "FailoverCount" (default: 20). If the configuration cannot be loaded from the master on startup even after several attempts, the slave starts as master as well. With IPS_DemoteToReplicationSlave, the slave is demoted again and the synchronization is resumed.

Sync Remote

With the module Sync Remote, the object tree of a remote Symcon system is mirrored beneath the Sync Remote instance. Each mirrored object gets its own local ID, including the root object (ID 0) of the remote system. For each Sync Remote instance, Symcon stores the mapping between the ID on the remote system (RemoteID) and the local ID. The ID of the local Sync Remote instance serves as ServerID. The mapping is stored in the settings and removed when the local object is deleted. In a replication, a slave takes over the mappings of the master.

Switching mirrored variables (SetValue, RequestAction), module functions as well as modifying IPS_ functions (e.g. IPS_Set*, IPS_Delete*, IPS_RunScript, IPS_ApplyChanges) whose first parameter is a mirrored object are forwarded using the mapping to the remote system on which the object resides. Reading functions (IPS_Get*, IPSIs*, IPS\Exists, IPS_HasChildren, IPS_HasPermission) and the functions for converting the IDs act locally on the mirrored object. Exceptions are IPS_GetConfigurationForm, IPS_GetMediaContent, IPS_GetScriptContent and IPS_GetFlowScriptStatistic, which are forwarded. The debug functions are not available for mirrored instances and report an error.

With IPS_GetRemoteObject, IPS_FindObjectID, IPS_FindRemoteID and IPS_FindServerID, object IDs can be mapped between the local system and the remote systems. If no mapping exists, the Find functions return 1.

IPS_DemoteToReplicationSlavedemotes a slave promoted to master again
IPS_FindObjectIDreturns the local ID for an ID of the remote system
IPS_FindRemoteIDreturns the ID of the remote system for a local ID
IPS_FindServerIDreturns the Sync Remote instance of a mirrored object
IPS_GetRemoteObjectreturns the ID of a mirrored object on the remote system
IPS_GetReplicationFailoverTimereturns the point in time of the last failover
IPS_GetReplicationModereturns the mode of the replication
IPS_GetReplicationSyncTimereturns the point in time of the last successful synchronization
IPS_IsReplicationActivechecks whether the replication is active
IPS_IsReplicationFailoverActivechecks whether the slave has taken over the tasks of the master
IPS_PromoteToReplicationMasterpromotes the slave to master
Any questions?