Cluster_Nodes

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.

How to Run

In a console window run:

 
    cluster_nodes 2 0
     

Then in a second console window run:

 
    cluster_nodes 2 1
 

Now wait for the first instance to exit and then start it again:

 
    cluster_nodes 2 0
 

Note 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.

Related Topics Link IconRelated Topics