# mco_cluster_stop

This function is called on all nodes to stop the cluster.

### For an overview see page Cluster Applications in C

### Prototype

        MCO_RET	mco_cluster_stop (	/*IN*/ mco_db_h db )

### Arguments

db | Connection to the database

### Description

> This function stops the cluster subsystem. This operation is distributed; all nodes must call `mco_cluster_stop()`. The function is blocked until all the nodes execute it. `mco_cluster_stop()` also stops the blocking function `mco_cluster_listen()` (which will return `MCO_S_OK` ).

### Return Codes

MCO_S_OK | All nodes executed `mco_cluster_stop()`. The cluster was stopped successfully
MCO_E_CLUSTER_NOT_INITIALIZED | The database was not created by `mco_cluster_db_open()`. Note: it may have been created by `mco_db_open_dev()`
MCO_E_CLUSTER_BUSY | Some other thread(s) has active write transaction(s)

### Files

Header file:
mcocluster.h
Source file:
mcocluster.c
Library:
libmcocluster.a