Cluster_Discover

This sample demonstrates the use of function mco_cluster_discover() to determine the list of active nodes.

How to Run

To run this sample open three console windows and set the eXtremeDB installation root directory as the current working directory. Then within 5 seconds:

In one console window run:

 
    cluster_demo -n 300000 2 0
     

and in a second console window run:

 
    cluster_demo -n 300000 2 1
 

This starts the cluster for a significant amount of execution time (option “-n 300000” forces the two cluster nodes to perform 300,000 transactions each). Then within 10 seconds run:

 
    cluster_discover localhost:20000
 

Now sample cluster_discover will list the two cluster nodes created by cluster_demo.

But it is more instructive to run one instance in your development environment debugger, stepping through the code.

Related Topics Link IconRelated Topics