MySQL NDB Cluster API Developer Guide
This section provides information about MGM API functions used to obtain status information from NDB Cluster nodes.
This function is used to obtain the status of the nodes in an NDB Cluster.
The caller must free the pointer returned by this function.
struct ndb_mgm_cluster_state* ndb_mgm_get_status
(
NdbMgmHandle handle
)
This function takes a single parameter, a management
server handle
.
A pointer to an
ndb_mgm_cluster_state
data structure.
This function is similar to
ndb_mgm_get_status()
,
in that it is used to obtain the status of the nodes in
an NDB Cluster. However,
ndb_mgm_get_status2()
allows one to
specify the type or types of nodes
(ndb_mgm_node_type
) to
be checked.
The caller must free the pointer returned by this function.
struct ndb_mgm_cluster_state* ndb_mgm_get_status2 ( NdbMgmHandlehandle
, const enum ndb_mgm_node_typetypes[]
)
This function takes two parameters:
A management server
handle
A pointer to array of the node types to be checked.
These are
ndb_mgm_node_type
values. The array should be terminated by an element
of type
NDB_MGM_NODE_TYPE_UNKNOWN
.
A pointer to an
ndb_mgm_cluster_state
data structure.
This function is similar to
ndb_mgm_get_status2()
,
and is used to obtain the status of the nodes in an NDB
Cluster by specify the type or types of nodes
(ndb_mgm_node_type
) to
be checked. Unlike that function (as well as
ndb_mgm_get_status()
),
ndb_mgm_get_status3()
works when the
cluster uses IPv6 addressing.
The caller must free the pointer returned by this function.
struct ndb_mgm_cluster_state2 *ndb_mgm_get_status3 ( NdbMgmHandlehandle
, const enum ndb_mgm_node_typetypes[]
);
This function takes two parameters:
A management server
handle
A pointer to array of the node types to be checked.
These are
ndb_mgm_node_type
values. The array should be terminated by an element
of type
NDB_MGM_NODE_TYPE_UNKNOWN
.
A pointer to an
ndb_mgm_cluster_state2
data structure.
This function can be used to dump debugging information
to the cluster log. The NDB Cluster management client
DUMP
command is a
wrapper for this function.
ndb_mgm_dump_state()
, like the
DUMP
command, can
cause a running NDB Cluster to malfunction or even to
fail completely if it is used improperly. Be sure to
consult the relevant documentation before using this
function. For more information on the
DUMP
command, and for a listing of
current DUMP
codes and their effects,
see NDB Cluster Management Client DUMP Commands.
int ndb_mgm_dump_state ( NdbMgmHandlehandle
, intnodeId
, const int*arguments
, intnumberOfArguments
, struct ndb_mgm_reply*reply
)
This function takes the following pararemeters:
A management server handle
(NdbMgmHandle
)
The nodeId
of a cluster
data node.
An array of arguments
.
The first of these is the DUMP
code to be executed. Subsequent arguments can be
passed in this array if needed by or desired for the
corresponding
DUMP
command.
The numberOfArguments
to
be passed.
An ndb_mgm_reply
,
which contains a return code along with a response
or error message.
0
on success; otherwise, an error
code.
Example.
The following example has the same result as running
2 DUMP 1000
in the
management client:
// [...] #include <mgmapi_debug.h> // [...] struct ndb_mgm_reply reply; int args[1]; int stat, arg_count, node_id; args[0] = 1000; arg_count = 1; node_id = 2; stat = ndb_mgm_dump_state(h, node_id, args, arg_count, &reply);