typedef struct ndb_logevent_handle* NdbLogEventHandle |
The NdbLogEventHandle
typedef struct ndb_mgm_handle* NdbMgmHandle |
The NdbMgmHandle.
enum Ndb_logevent_type |
Available log events grouped by ndb_mgm_event_category
enum ndb_mgm_error |
Error codes
Log event categories, used to set filter level on the log events using ndb_mgm_set_clusterlog_loglevel() and ndb_mgm_listen_event()
Log event severities (used to filter the cluster log, ndb_mgm_set_clusterlog_severity_filter(), and filter listening to events ndb_mgm_listen_event())
enum ndb_mgm_node_status |
Database node status
enum ndb_mgm_node_type |
NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102 |
Non retriable error
NDB_MGM_ALLOCID_ERROR = 1101 |
Generic error, retry may succeed
NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002 |
Unable to abort backup
NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011 |
Could not connect to socker
NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001 |
Unable to enter single user mode
NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002 |
Unable to exit single user mode
NDB_MGM_COULD_NOT_START_BACKUP = 3001 |
Unable to start backup
NDB_MGM_ILLEGAL_CONNECT_STRING = 1001 |
Supplied connectstring is illegal
NDB_MGM_ILLEGAL_NODE_STATUS = 1008 |
Illegal node status
NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007 |
Illegal number of nodes
NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005 |
Supplied NdbMgmHandle is illegal
NDB_MGM_ILLEGAL_SERVER_REPLY = 1006 |
Illegal reply from server
NDB_MGM_NODE_STATUS_NO_CONTACT = 1 |
No contact with node
NDB_MGM_NODE_STATUS_NOT_STARTED = 2 |
Has not run starting protocol
NDB_MGM_NODE_STATUS_RESTARTING = 6 |
Is restarting
NDB_MGM_NODE_STATUS_RESUME = 8 |
Resume mode
NDB_MGM_NODE_STATUS_SHUTTING_DOWN = 5 |
Is shutting down
NDB_MGM_NODE_STATUS_SINGLEUSER = 7 |
Maintenance mode
NDB_MGM_NODE_STATUS_STARTED = 4 |
Running
NDB_MGM_NODE_STATUS_STARTING = 3 |
Is running starting protocol
NDB_MGM_NODE_TYPE_API |
An application (NdbApi) node
NDB_MGM_NODE_TYPE_MGM |
A management server node
NDB_MGM_NODE_TYPE_NDB |
A database node
NDB_MGM_OUT_OF_MEMORY = 1009 |
Memory allocation error
NDB_MGM_RESTART_FAILED = 2003 |
Restart failed
NDB_MGM_SERVER_NOT_CONNECTED = 1010 |
Management server not connected
NDB_MGM_START_FAILED = 2001 |
Start failed
NDB_MGM_STOP_FAILED = 2002 |
Stop failed
NDB_MGM_USAGE_ERROR = 5001 |
Usage error
int ndb_logevent_get_fd | ( | const | NdbLogEventHandle | ) |
Retrieve filedescriptor from NdbLogEventHandle. May be used in e.g. an application select() statement.
int ndb_logevent_get_latest_error | ( | const | NdbLogEventHandle | ) |
Retrieve laterst error code
const char* ndb_logevent_get_latest_error_msg | ( | const | NdbLogEventHandle | ) |
Retrieve laterst error message
int ndb_logevent_get_next | ( | const | NdbLogEventHandle, | |
struct ndb_logevent * | dst, | |||
unsigned | timeout_in_milliseconds | |||
) |
Attempt to retrieve next log event and will fill in the supplied struct dst
dst | Pointer to struct to fill in event information | |
timeout_in_milliseconds | Timeout for waiting for event |
int ndb_mgm_abort_backup | ( | NdbMgmHandle | handle, | |
unsigned int | backup_id, | |||
struct ndb_mgm_reply * | reply | |||
) |
Abort backup
handle | NDB management handle. | |
backup_id | Backup ID. | |
reply | Reply message. |
int ndb_mgm_connect | ( | NdbMgmHandle | handle, | |
int | no_retries, | |||
int | retry_delay_in_seconds, | |||
int | verbose | |||
) |
Connects to a management server. Connectstring is set by ndb_mgm_set_connectstring().
handle | Management handle. | |
no_retries | Number of retries to connect (0 means connect once). | |
retry_delay_in_seconds | How long to wait until retry is performed. | |
verbose | Make printout regarding connect retries. |
NdbMgmHandle ndb_mgm_create_handle | ( | ) |
Create a handle to a management server.
NdbLogEventHandle ndb_mgm_create_logevent_handle | ( | NdbMgmHandle | , | |
const int | filter[] | |||
) |
Listen to log events.
handle | NDB management handle. | |
filter | pairs of { level, ndb_mgm_event_category } that will be pushed to fd, level=0 ends list. |
void ndb_mgm_destroy_handle | ( | NdbMgmHandle * | handle | ) |
Destroy a management server handle.
handle | Management handle |
int ndb_mgm_disconnect | ( | NdbMgmHandle | handle | ) |
Disconnects from a management server
handle | Management handle. |
int ndb_mgm_enter_single_user | ( | NdbMgmHandle | handle, | |
unsigned int | nodeId, | |||
struct ndb_mgm_reply * | reply | |||
) |
Enter Single user mode
handle | NDB management handle. | |
nodeId | Node ID of the single user node | |
reply | Reply message. |
int ndb_mgm_exit_single_user | ( | NdbMgmHandle | handle, | |
struct ndb_mgm_reply * | reply | |||
) |
Exit Single user mode
handle | NDB management handle. | |
reply | Reply message. |
const unsigned int* ndb_mgm_get_clusterlog_severity_filter | ( | NdbMgmHandle | handle | ) |
Get clusterlog severity filter
handle | NDB management handle |
int ndb_mgm_get_configuration_nodeid | ( | NdbMgmHandle | handle | ) |
Gets connection node ID
handle | Management handle |
const char * ndb_mgm_get_connected_host | ( | NdbMgmHandle | handle | ) |
Gets connection host
handle | Management handle |
int ndb_mgm_get_connected_port | ( | NdbMgmHandle | handle | ) |
Gets connection port
handle | Management handle |
const char * ndb_mgm_get_connectstring | ( | NdbMgmHandle | handle, | |
char * | buf, | |||
int | buf_sz | |||
) |
Gets the connectstring used for a connection
handle | Management handle | |
buf | Buffer to hold result | |
buf_sz | Size of buffer. |
int ndb_mgm_get_latest_error | ( | const NdbMgmHandle | handle | ) |
Get the most recent error associated with the management server whose handle is used as the value of handle.
handle | Management handle |
const char* ndb_mgm_get_latest_error_desc | ( | const NdbMgmHandle | handle | ) |
Get the most recent error description associated with a handle
The error description gives some additional information regarding the error message.
handle | Management handle. |
const char* ndb_mgm_get_latest_error_msg | ( | const NdbMgmHandle | handle | ) |
Get the most recent general error message associated with a handle
handle | Management handle. |
struct ndb_mgm_cluster_state* ndb_mgm_get_status | ( | NdbMgmHandle | handle | ) |
Gets status of the nodes in an NDB Cluster
handle | Management handle. |
int ndb_mgm_is_connected | ( | NdbMgmHandle | handle | ) |
Return true if connected.
handle | Management handle |
int ndb_mgm_listen_event | ( | NdbMgmHandle | handle, | |
const int | filter[] | |||
) |
Listen to log events. They are read from the return file descriptor and the format is textual, and the same as in the cluster log.
handle | NDB management handle. | |
filter | pairs of { level, ndb_mgm_event_category } that will be pushed to fd, level=0 ends list. |
int ndb_mgm_restart | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list | |||
) |
Restart database nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to restart 0: All database nodes in cluster n: Restart the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be restarted |
int ndb_mgm_restart2 | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list, | |||
int | initial, | |||
int | nostart, | |||
int | abort | |||
) |
Restart database nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to be restarted: 0: Restart all database nodes in the cluster n: Restart the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be restarted | |
initial | Remove filesystem from restarting node(s) | |
nostart | Don't actually start node(s) but leave them waiting for start command | |
abort | Don't perform graceful restart, but rather restart immediately |
int ndb_mgm_restart3 | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list, | |||
int | initial, | |||
int | nostart, | |||
int | abort, | |||
int * | disconnect | |||
) |
Restart nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to be restarted: 0: Restart all database nodes in the cluster n: Restart the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be restarted | |
initial | Remove filesystem from restarting node(s) | |
nostart | Don't actually start node(s) but leave them waiting for start command | |
abort | Don't perform graceful restart, but rather restart immediately | |
disconnect | Returns true if mgmapi client must disconnect from server to apply the requested operation. (e.g. restart the management server) |
int ndb_mgm_set_clusterlog_loglevel | ( | NdbMgmHandle | handle, | |
int | nodeId, | |||
enum ndb_mgm_event_category | category, | |||
int | level, | |||
struct ndb_mgm_reply * | reply | |||
) |
Set log category and levels for the cluster log
handle | NDB management handle. | |
nodeId | Node ID. | |
category | Event category. | |
level | Log level (0-15). | |
reply | Reply message. |
int ndb_mgm_set_clusterlog_severity_filter | ( | NdbMgmHandle | handle, | |
enum ndb_mgm_event_severity | severity, | |||
int | enable, | |||
struct ndb_mgm_reply * | reply | |||
) |
Filter cluster log severities
handle | NDB management handle. | |
severity | A cluster log severity to filter. | |
enable | set 1=enable o 0=disable | |
reply | Reply message. |
int ndb_mgm_set_connectstring | ( | NdbMgmHandle | handle, | |
const char * | connect_string | |||
) |
Sets the connectstring for a management server
handle | Management handle | |
connect_string | Connect string to the management server, |
<connectstring> := [<nodeid-specification>,]<host-specification>[,<host-specification>] <nodeid-specification> := nodeid=<id> <host-specification> := <host>[:<port>] <id> is an integer greater than 0 identifying a node in config.ini <port> is an integer referring to a regular unix port <host> is a string containing a valid network host address
void ndb_mgm_set_error_stream | ( | NdbMgmHandle | , | |
FILE * | ||||
) |
Set error stream
void ndb_mgm_set_name | ( | NdbMgmHandle | handle, | |
const char * | name | |||
) |
Set a name of the handle. Name is reported in cluster log.
handle | Management handle | |
name | Name |
int ndb_mgm_start | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list | |||
) |
Start database nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to be started 0: Start all database nodes in the cluster n: Start the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be started |
int ndb_mgm_start_backup | ( | NdbMgmHandle | handle, | |
int | wait_completed, | |||
unsigned int * | backup_id, | |||
struct ndb_mgm_reply * | reply | |||
) |
Start backup
handle | NDB management handle. | |
wait_completed | 0: Don't wait for confirmation 1: Wait for backup to be started 2: Wait for backup to be completed | |
backup_id | Backup ID is returned from function. | |
reply | Reply message. |
int ndb_mgm_stop | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list | |||
) |
Stops database nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to be stopped 0: All database nodes in cluster n: Stop the n node(s) specified in the array node_list | |
node_list | List of node IDs for database nodes to be stopped |
int ndb_mgm_stop2 | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list, | |||
int | abort | |||
) |
Stops database nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to stop 0: All database nodes in cluster n: Stop the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be stopped | |
abort | Don't perform graceful stop, but rather stop immediately |
int ndb_mgm_stop3 | ( | NdbMgmHandle | handle, | |
int | no_of_nodes, | |||
const int * | node_list, | |||
int | abort, | |||
int * | disconnect | |||
) |
Stops cluster nodes
handle | Management handle. | |
no_of_nodes | Number of database nodes to stop -1: All database and management nodes 0: All database nodes in cluster n: Stop the n node(s) specified in the array node_list | |
node_list | List of node IDs of database nodes to be stopped | |
abort | Don't perform graceful stop, but rather stop immediately | |
disconnect | Returns true if you need to disconnect to apply the stop command (e.g. stopping the mgm server that handle is connected to) |
char ndb_mgm_node_state::connect_address[] [inherited] |
IP address of node when it connected to the management server.
int ndb_mgm_node_state::connect_count [inherited] |
Number of times node has connected or disconnected to the management server
int ndb_mgm_node_state::dynamic_id [inherited] |
ID for heartbeats and master take-over (only valid for DB nodes)
char ndb_mgm_reply::message[256] [inherited] |
Error or reply message.
int ndb_mgm_node_state::node_group [inherited] |
Node group of node (only valid for DB nodes)
struct ndb_mgm_node_state ndb_mgm_cluster_state::node_states[] [inherited] |
An array with node_states
enum ndb_mgm_node_status ndb_mgm_node_state::node_status [inherited] |
State of node
enum ndb_mgm_node_type ndb_mgm_node_state::node_type [inherited] |
Type of NDB Cluster node
int ndb_mgm_node_state::start_phase [inherited] |
Start phase.
int ndb_mgm_node_state::version [inherited] |
Internal version number