This sample demonstrates synchronization when one of the nodes in a cluster fails. To see how the synchronization works, the first run of
cluster_nodeson node 0 must exit after a few seconds. When the sample is started again on node 0 and node 1, the instance on node 0 synchronizes the database content with node 1.
In a console window run:
cluster_nodes 2 0Then in a second console window run:
cluster_nodes 2 1Now wait for the first instance to exit and then start it again:
cluster_nodes 2 0Note that the instance on node 1 has rank=1 while node 0 has rank=0. This avoids the
MCO_E_CLUSTER_NOQUORUMerror when node 0 is disconnected.It is more instructive to run one instance in your development environment debugger, stepping through the code.