This example shows eXtremeDB High Availability in asynchronous mode. The master application creates and populates the database, then enters a loop creating and deleting objects as it waits for connection requests from replicas. Replica applications create duplicates of the master database, synchronize with
the master database, then receive commit data from the master and perform the replication in asynchronous mode.
( Note that the eXtremeDB library
mcoha
must be configured withMCO_CFG_HA_ASYNC_REPLICATION
in order to run this sample.)
See instructions here on how to build this and other samples on your development platform. Once built, the sample can be run from the
\target\bin
directory.In a console window run:
haasync_masterThen run one or several "replica" applications:
haasync_replicaIt is also possible to run replica applications in synchronous mode even if the master is running asynchronously. To do this the
MCO_HAMODE_FORCE_SYNC
flag must be set in the replica. This is demonstrated in haasync_rplsync:haasync_rplsyncBut it is more instructive to run one instance in your development environment debugger, stepping through the code.