Replication allows applications running on two different Routing Engines or Multiservices PICs to copy their runtime data from a master to a backup by placing the data in the libjunos-sync subsystem. The data is always sent from the master to the backup.
The libjunos-sync library must be linked with your daemon and initialized before it can be used. Libjunos-sync is thread safe, so there could be multiple instances in one process. Running a daemon on the backup Routing Engine is automatic when the system mgd process sees
<mode-protocol-backup> in the package configuration file.
The library creates a TCP connection between two peers. If there are multiple instances within one process, there will be mutliple TCP connections between two PICs using different ports. Thus, each PIC can pass its own data without affecting others.
Libjunos-sync runs on the Juniper Private Routing Instance.
For more information on using replication, see the programming task, Synchronizing Runtime Data.
For sample code that performs data replication between Routing Engines, see the HelloPics sample application, in your development sandbox at:
sandbox/src/sbin/hellopics-data/hellopics-*. For sample code that performs replication between Multiservices PICs, see the IPTV Monitor sample application in your development sandbox at
The functions that applications call are in your backing sandbox at
sandbox/src/junos/lib/libjunos-sync/h/jnx/junos_sync.h. For additional information, see the SDK Library Reference documentation for libjunos-sync.