This sample demonstrates synchronization if one of the nodes in a cluster fails. To see how the synchronization works it is necessary for the first run of
cluster_nodes
on node 0 to exit after a few seconds, then when the sample is started again on node 0 and node 1, the instance on node 0 will synchronize 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 is to avoid the
MCO_E_CLUSTER_NOQUORUM
error when the node 0 is disconnected.But it is more instructive to run one instance in your development environment debugger, stepping through the code.