MySQL 5.6.14 Source Code Document
|
Typedefs | |
typedef struct ndb_mgm_handle * | NdbMgmHandle |
Variables | |
int | ndb_mgm_node_state::node_id |
enum ndb_mgm_node_type | ndb_mgm_node_state::node_type |
enum ndb_mgm_node_status | ndb_mgm_node_state::node_status |
int | ndb_mgm_node_state::start_phase |
int | ndb_mgm_node_state::dynamic_id |
int | ndb_mgm_node_state::node_group |
int | ndb_mgm_node_state::version |
int | ndb_mgm_node_state::connect_count |
char | ndb_mgm_node_state::connect_address [sizeof("000.000.000.000")+1] |
int | ndb_mgm_node_state::mysql_version |
int | ndb_mgm_cluster_state::no_of_nodes |
struct ndb_mgm_node_state | ndb_mgm_cluster_state::node_states [1] |
int | ndb_mgm_reply::return_code |
char | ndb_mgm_reply::message [256] |
enum ndb_mgm_event_severity | ndb_mgm_severity::category |
unsigned int | ndb_mgm_severity::value |
enum ndb_mgm_event_category | ndb_mgm_loglevel::category |
unsigned int | ndb_mgm_loglevel::value |
Uint32 | ndb_mgm_param_info::m_id |
const char * | ndb_mgm_param_info::m_name |
int | ndb_mgm_events::no_of_events |
struct ndb_logevent | ndb_mgm_events::events [1] |
Functions: Error Handling | |
int | ndb_mgm_get_latest_error (const NdbMgmHandle handle) |
const char * | ndb_mgm_get_latest_error_msg (const NdbMgmHandle handle) |
const char * | ndb_mgm_get_latest_error_desc (const NdbMgmHandle handle) |
int | ndb_mgm_get_latest_error_line (const NdbMgmHandle handle) |
void | ndb_mgm_set_error_stream (NdbMgmHandle, FILE *) |
Functions: Create/Destroy Management Server Handles | |
NdbMgmHandle | ndb_mgm_create_handle () |
void | ndb_mgm_destroy_handle (NdbMgmHandle *handle) |
void | ndb_mgm_set_name (NdbMgmHandle handle, const char *name) |
int | ndb_mgm_set_ignore_sigpipe (NdbMgmHandle handle, int val) |
Functions: Connect/Disconnect Management Server | |
int | ndb_mgm_set_connectstring (NdbMgmHandle handle, const char *connect_string) |
int | ndb_mgm_number_of_mgmd_in_connect_string (NdbMgmHandle handle) |
int | ndb_mgm_set_configuration_nodeid (NdbMgmHandle handle, int nodeid) |
int | ndb_mgm_set_bindaddress (NdbMgmHandle, const char *arg) |
const char * | ndb_mgm_get_connectstring (NdbMgmHandle handle, char *buf, int buf_sz) |
int | ndb_mgm_set_connect_timeout (NdbMgmHandle handle, unsigned int seconds) |
int | ndb_mgm_set_timeout (NdbMgmHandle handle, unsigned int timeout_ms) |
int | ndb_mgm_connect (NdbMgmHandle handle, int no_retries, int retry_delay_in_seconds, int verbose) |
int | ndb_mgm_is_connected (NdbMgmHandle handle) |
int | ndb_mgm_disconnect (NdbMgmHandle handle) |
int | ndb_mgm_get_configuration_nodeid (NdbMgmHandle handle) |
int | ndb_mgm_get_connected_port (NdbMgmHandle handle) |
const char * | ndb_mgm_get_connected_host (NdbMgmHandle handle) |
const char * | ndb_mgm_get_connected_bind_address (NdbMgmHandle handle) |
int | ndb_mgm_get_version (NdbMgmHandle handle, int *major, int *minor, int *build, int len, char *str) |
Functions: Used to convert between different data formats | |
enum ndb_mgm_node_type | ndb_mgm_match_node_type (const char *type) |
const char * | ndb_mgm_get_node_type_string (enum ndb_mgm_node_type type) |
const char * | ndb_mgm_get_node_type_alias_string (enum ndb_mgm_node_type type, const char **str) |
enum ndb_mgm_node_status | ndb_mgm_match_node_status (const char *status) |
const char * | ndb_mgm_get_node_status_string (enum ndb_mgm_node_status status) |
const char * | ndb_mgm_get_event_severity_string (enum ndb_mgm_event_severity) |
enum ndb_mgm_event_category | ndb_mgm_match_event_category (const char *) |
const char * | ndb_mgm_get_event_category_string (enum ndb_mgm_event_category) |
Functions: Cluster status | |
struct ndb_mgm_cluster_state * | ndb_mgm_get_status (NdbMgmHandle handle) |
struct ndb_mgm_cluster_state * | ndb_mgm_get_status2 (NdbMgmHandle handle, const enum ndb_mgm_node_type types[]) |
int | ndb_mgm_dump_state (NdbMgmHandle handle, int nodeId, const int *args, int num_args, struct ndb_mgm_reply *reply) |
struct ndb_mgm_configuration * | ndb_mgm_get_configuration_from_node (NdbMgmHandle handle, int nodeid) |
Functions: Start/stop nodes | |
int | ndb_mgm_stop (NdbMgmHandle handle, int no_of_nodes, const int *node_list) |
int | ndb_mgm_stop2 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int abort) |
int | ndb_mgm_stop3 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int abort, int *disconnect) |
int | ndb_mgm_stop4 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int abort, int force, int *disconnect) |
int | ndb_mgm_restart (NdbMgmHandle handle, int no_of_nodes, const int *node_list) |
int | ndb_mgm_restart2 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int initial, int nostart, int abort) |
int | ndb_mgm_restart3 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int initial, int nostart, int abort, int *disconnect) |
int | ndb_mgm_restart4 (NdbMgmHandle handle, int no_of_nodes, const int *node_list, int initial, int nostart, int abort, int force, int *disconnect) |
int | ndb_mgm_start (NdbMgmHandle handle, int no_of_nodes, const int *node_list) |
Functions: Controlling Clusterlog output | |
int | ndb_mgm_set_clusterlog_severity_filter (NdbMgmHandle handle, enum ndb_mgm_event_severity severity, int enable, struct ndb_mgm_reply *reply) |
int | ndb_mgm_get_clusterlog_severity_filter (NdbMgmHandle handle, struct ndb_mgm_severity *severity, unsigned int severity_size) |
const unsigned int * | ndb_mgm_get_clusterlog_severity_filter_old (NdbMgmHandle handle) |
int | ndb_mgm_set_clusterlog_loglevel (NdbMgmHandle handle, int nodeId, enum ndb_mgm_event_category category, int level, struct ndb_mgm_reply *reply) |
int | ndb_mgm_get_clusterlog_loglevel (NdbMgmHandle handle, struct ndb_mgm_loglevel *loglevel, unsigned int loglevel_size) |
const unsigned int * | ndb_mgm_get_clusterlog_loglevel_old (NdbMgmHandle handle) |
Functions: Listening to log events | |
typedef struct ndb_logevent_handle * | NdbLogEventHandle |
int | ndb_mgm_listen_event (NdbMgmHandle handle, const int filter[]) |
int | ndb_mgm_set_loglevel_node (NdbMgmHandle handle, int nodeId, enum ndb_mgm_event_category category, int level, struct ndb_mgm_reply *reply) |
NdbLogEventHandle | ndb_mgm_create_logevent_handle (NdbMgmHandle, const int filter[]) |
void | ndb_mgm_destroy_logevent_handle (NdbLogEventHandle *) |
int | ndb_logevent_get_fd (const NdbLogEventHandle) |
int | ndb_logevent_get_next (const NdbLogEventHandle, struct ndb_logevent *dst, unsigned timeout_in_milliseconds) |
int | ndb_logevent_get_latest_error (const NdbLogEventHandle) |
const char * | ndb_logevent_get_latest_error_msg (const NdbLogEventHandle) |
Functions: Backup | |
int | ndb_mgm_start_backup (NdbMgmHandle handle, int wait_completed, unsigned int *backup_id, struct ndb_mgm_reply *reply) |
int | ndb_mgm_start_backup2 (NdbMgmHandle handle, int wait_completed, unsigned int *backup_id, struct ndb_mgm_reply *reply, unsigned int input_backupId) |
int | ndb_mgm_start_backup3 (NdbMgmHandle handle, int wait_completed, unsigned int *backup_id, struct ndb_mgm_reply *reply, unsigned int input_backupId, unsigned int backuppoint) |
int | ndb_mgm_abort_backup (NdbMgmHandle handle, unsigned int backup_id, struct ndb_mgm_reply *reply) |
Functions: Single User Mode | |
int | ndb_mgm_enter_single_user (NdbMgmHandle handle, unsigned int nodeId, struct ndb_mgm_reply *reply) |
int | ndb_mgm_exit_single_user (NdbMgmHandle handle, struct ndb_mgm_reply *reply) |
Configuration handling | |
enum | ndb_mgm_clusterlog_level { NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1, NDB_MGM_CLUSTERLOG_ON = 0, NDB_MGM_CLUSTERLOG_DEBUG = 1, NDB_MGM_CLUSTERLOG_INFO = 2, NDB_MGM_CLUSTERLOG_WARNING = 3, NDB_MGM_CLUSTERLOG_ERROR = 4, NDB_MGM_CLUSTERLOG_CRITICAL = 5, NDB_MGM_CLUSTERLOG_ALERT = 6, NDB_MGM_CLUSTERLOG_ALL = 7 } |
typedef struct ndb_mgm_configuration_iterator | ndb_mgm_configuration_iterator |
struct ndb_mgm_configuration * | ndb_mgm_get_configuration (NdbMgmHandle handle, unsigned version) |
void | ndb_mgm_destroy_configuration (struct ndb_mgm_configuration *) |
int | ndb_mgm_alloc_nodeid (NdbMgmHandle handle, unsigned version, int nodetype, int log_event) |
int | ndb_mgm_end_session (NdbMgmHandle handle) |
int | ndb_mgm_get_fd (NdbMgmHandle handle) |
Uint32 | ndb_mgm_get_mgmd_nodeid (NdbMgmHandle handle) |
ndb_mgm_configuration_iterator * | ndb_mgm_create_configuration_iterator (struct ndb_mgm_configuration *, unsigned type_of_section) |
void | ndb_mgm_destroy_iterator (ndb_mgm_configuration_iterator *) |
int | ndb_mgm_first (ndb_mgm_configuration_iterator *) |
int | ndb_mgm_next (ndb_mgm_configuration_iterator *) |
int | ndb_mgm_valid (const ndb_mgm_configuration_iterator *) |
int | ndb_mgm_find (ndb_mgm_configuration_iterator *, int param, unsigned value) |
int | ndb_mgm_get_int_parameter (const ndb_mgm_configuration_iterator *, int param, unsigned *value) |
int | ndb_mgm_get_int64_parameter (const ndb_mgm_configuration_iterator *, int param, Uint64 *value) |
int | ndb_mgm_get_string_parameter (const ndb_mgm_configuration_iterator *, int param, const char **value) |
int | ndb_mgm_purge_stale_sessions (NdbMgmHandle handle, char **) |
int | ndb_mgm_check_connection (NdbMgmHandle handle) |
int | ndb_mgm_report_event (NdbMgmHandle handle, Uint32 *data, Uint32 length) |
int | ndb_mgm_get_db_parameter_info (Uint32 paramId, struct ndb_mgm_param_info *info, size_t *size) |
int | ndb_mgm_create_nodegroup (NdbMgmHandle handle, int *nodes, int *ng, struct ndb_mgm_reply *mgmreply) |
int | ndb_mgm_drop_nodegroup (NdbMgmHandle handle, int ng, struct ndb_mgm_reply *mgmreply) |
struct ndb_mgm_events * | ndb_mgm_dump_events (NdbMgmHandle handle, enum Ndb_logevent_type type, int no_of_nodes, const int *node_list) |
The MySQL Cluster Management API (MGM API) is a C language API that is used for:
Each MGM API function needs a management server handle of type NdbMgmHandle. This handle is created by calling the function function ndb_mgm_create_handle() and freed by calling ndb_mgm_destroy_handle().
A function can return any of the following:
Error conditions can be identified by using the appropriate error-reporting functions ndb_mgm_get_latest_error() and ndb_mgm_error.
Here is an example using the MGM API (without error handling for brevity's sake).
The database nodes and management server(s) regularly and on specific occations report on various log events that occurs in the cluster. These log events are written to the cluster log. Optionally a mgmapi client may listen to these events by using the method ndb_mgm_listen_event(). Each log event belongs to a category, ndb_mgm_event_category, and has a severity, ndb_mgm_event_severity, associated with it. Each log event also has a level (0-15) associated with it.
Which log events that come out is controlled with ndb_mgm_listen_event(), ndb_mgm_set_clusterlog_loglevel(), and ndb_mgm_set_clusterlog_severity_filter().
Below is an example of how to listen to events related to backup.
The following steps are involved:
Sample code for listening to Backup related events. The availaable log events are listed in ndb_logevent.h
typedef struct ndb_mgm_configuration_iterator ndb_mgm_configuration_iterator |
typedef struct ndb_logevent_handle* NdbLogEventHandle |
typedef struct ndb_mgm_handle* NdbMgmHandle |
enum Ndb_logevent_type |
Available log events grouped by ndb_mgm_event_category
Definition at line 35 of file ndb_logevent.h.
Log event categories, used to set filter level on the log events using ndb_mgm_set_clusterlog_loglevel() and ndb_mgm_listen_event()
NDB_MGM_ILLEGAL_EVENT_CATEGORY |
Invalid log event category |
NDB_MGM_EVENT_CATEGORY_STARTUP |
Log events during all kinds of startups |
NDB_MGM_EVENT_CATEGORY_SHUTDOWN |
Log events during shutdown |
NDB_MGM_EVENT_CATEGORY_STATISTIC |
Statistics log events |
NDB_MGM_EVENT_CATEGORY_CHECKPOINT |
Log events related to checkpoints |
NDB_MGM_EVENT_CATEGORY_NODE_RESTART |
Log events during node restart |
NDB_MGM_EVENT_CATEGORY_CONNECTION |
Log events related to connections between cluster nodes |
NDB_MGM_EVENT_CATEGORY_BACKUP |
Backup related log events |
NDB_MGM_EVENT_CATEGORY_CONGESTION |
Congestion related log events |
NDB_MGM_EVENT_CATEGORY_DEBUG |
Loglevel debug |
NDB_MGM_EVENT_CATEGORY_INFO |
Uncategorized log events (severity info) |
NDB_MGM_EVENT_CATEGORY_ERROR |
Uncategorized log events (severity warning or higher) |
Definition at line 257 of file ndb_logevent.h.
Log event severities (used to filter the cluster log, ndb_mgm_set_clusterlog_severity_filter(), and filter listening to events ndb_mgm_listen_event())
NDB_MGM_EVENT_SEVERITY_ON |
Cluster log on |
NDB_MGM_EVENT_SEVERITY_DEBUG |
Used in NDB Cluster developement |
NDB_MGM_EVENT_SEVERITY_INFO |
Informational messages |
NDB_MGM_EVENT_SEVERITY_WARNING |
Conditions that are not error condition, but might require handling. |
NDB_MGM_EVENT_SEVERITY_ERROR |
Conditions that, while not fatal, should be corrected. |
NDB_MGM_EVENT_SEVERITY_CRITICAL |
Critical conditions, like device errors or out of resources |
NDB_MGM_EVENT_SEVERITY_ALERT |
A condition that should be corrected immediately, such as a corrupted system |
NDB_MGM_EVENT_SEVERITY_ALL |
All severities |
Definition at line 228 of file ndb_logevent.h.
enum ndb_mgm_info |
enum ndb_mgm_node_status |
Database node status
enum ndb_mgm_node_type |
Signal log modes (Used only in the development of NDB Cluster.)
int ndb_logevent_get_fd | ( | const NdbLogEventHandle | ) |
Retrieve filedescriptor from NdbLogEventHandle. May be used in e.g. an application select() statement.
Definition at line 104 of file ndb_logevent.cpp.
int ndb_logevent_get_latest_error | ( | const NdbLogEventHandle | ) |
Retrieve laterst error code
Definition at line 628 of file ndb_logevent.cpp.
const char* ndb_logevent_get_latest_error_msg | ( | const NdbLogEventHandle | ) |
Retrieve laterst error message
Definition at line 634 of file ndb_logevent.cpp.
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 |
Definition at line 478 of file ndb_logevent.cpp.
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. |
Definition at line 2443 of file mgmapi.cpp.
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().
The timeout value is for connect to each management server. Use ndb_mgm_number_of_mgmd_in_connect_string to work out the approximate maximum amount of time that could be spent in this function.
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. |
Connect to a management server
Do connect
Definition at line 664 of file mgmapi.cpp.
ndb_mgm_configuration_iterator* ndb_mgm_create_configuration_iterator | ( | ndb_mgm_configuration * | conf, |
unsigned | type_of_section | ||
) |
Published C interface
Definition at line 113 of file mgmapi_configuration.cpp.
NdbMgmHandle ndb_mgm_create_handle | ( | ) |
Create a handle to a management server.
Definition at line 233 of file mgmapi.cpp.
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. |
Definition at line 75 of file ndb_logevent.cpp.
void ndb_mgm_destroy_handle | ( | NdbMgmHandle * | handle | ) |
Destroy a management server handle.
handle | Management handle |
Destroy a handle
important! only disconnect if connected other code relies on this
Definition at line 352 of file mgmapi.cpp.
int ndb_mgm_disconnect | ( | NdbMgmHandle | handle | ) |
Disconnects from a management server
handle | Management handle. |
Disconnect from a mgm server
Definition at line 856 of file mgmapi.cpp.
|
read |
Get an array of ndb_logevent of a specified type, describing for example memoryusage or backupstatus for the whole cluster
handle | Management handle. |
type | Which ndb_logevent to request |
no_of_nodes | Number of database nodes to request info from 0: All database nodes in cluster n: Only the n node(s) specified in the array node_list |
node_list | List of node IDs of database nodes to request info from |
Definition at line 3513 of file mgmapi.cpp.
int ndb_mgm_dump_state | ( | NdbMgmHandle | handle, |
int | nodeId, | ||
const int * | args, | ||
int | num_args, | ||
struct ndb_mgm_reply * | reply | ||
) |
Dump state
handle | the NDB management handle. |
nodeId | the node id. |
args | integer array |
number | of args in int array |
reply | the reply message. |
Definition at line 2026 of file mgmapi.cpp.
int ndb_mgm_end_session | ( | NdbMgmHandle | handle | ) |
End Session
This function tells the mgm server to free all resources associated with this connection. It will also close it.
This differs from just disconnecting as we now synchronously clean up, so that a quickly restarting server that needs the same node id can get it when it restarts.
handle | NDB management handle |
Definition at line 3141 of file mgmapi.cpp.
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. |
Definition at line 1199 of file mgmapi.cpp.
int ndb_mgm_exit_single_user | ( | NdbMgmHandle | handle, |
struct ndb_mgm_reply * | reply | ||
) |
Exit Single user mode
handle | NDB management handle. |
reply | Reply message. |
Definition at line 1235 of file mgmapi.cpp.
int ndb_mgm_get_clusterlog_loglevel | ( | NdbMgmHandle | handle, |
struct ndb_mgm_loglevel * | loglevel, | ||
unsigned int | loglevel_size | ||
) |
get log category and levels
handle | NDB management handle. |
loglevel | A vector of twelve (MGM_LOGLEVELS) elements of struct ndb_mgm_loglevel, where each element contains loglevel of corresponding category |
loglevel_size | The size of the vector (MGM_LOGLEVELS) |
Definition at line 1770 of file mgmapi.cpp.
const unsigned int* ndb_mgm_get_clusterlog_loglevel_old | ( | NdbMgmHandle | handle | ) |
get log category and levels
handle | NDB management handle. |
Definition at line 1808 of file mgmapi.cpp.
int ndb_mgm_get_clusterlog_severity_filter | ( | NdbMgmHandle | handle, |
struct ndb_mgm_severity * | severity, | ||
unsigned int | severity_size | ||
) |
Get clusterlog severity filter
handle | NDB management handle |
loglevel | A vector of seven (NDB_MGM_EVENT_SEVERITY_ALL) elements of struct ndb_mgm_severity, where each element contains 1 if a severity indicator is enabled and 0 if not. A severity level is stored at position ndb_mgm_clusterlog_level; for example the "error" level is stored in position [NDB_MGM_EVENT_SEVERITY_ERROR]. The first element [NDB_MGM_EVENT_SEVERITY_ON] in the vector signals whether the cluster log is disabled or enabled. |
severity_size | The size of the vector (NDB_MGM_EVENT_SEVERITY_ALL) |
Definition at line 1615 of file mgmapi.cpp.
const unsigned int* ndb_mgm_get_clusterlog_severity_filter_old | ( | NdbMgmHandle | handle | ) |
Get clusterlog severity filter
handle | NDB management handle |
Definition at line 1647 of file mgmapi.cpp.
|
read |
Get configuration
handle | NDB management handle. |
version | Version of configuration, 0 means latest (Currently this is the only supported value for this parameter) |
|
read |
Get the current configuration from a node.
handle | the NDB management handle. |
nodeId | of the node for which the configuration is requested. |
Definition at line 2072 of file mgmapi.cpp.
int ndb_mgm_get_configuration_nodeid | ( | NdbMgmHandle | handle | ) |
Gets connection node ID
handle | Management handle |
Definition at line 2637 of file mgmapi.cpp.
const char* ndb_mgm_get_connected_bind_address | ( | NdbMgmHandle | handle | ) |
Gets connection bind address
handle | Management handle |
Definition at line 2669 of file mgmapi.cpp.
const char* ndb_mgm_get_connected_host | ( | NdbMgmHandle | handle | ) |
Gets connection host
handle | Management handle |
Definition at line 2654 of file mgmapi.cpp.
int ndb_mgm_get_connected_port | ( | NdbMgmHandle | handle | ) |
Gets connection port
handle | Management handle |
Definition at line 2645 of file mgmapi.cpp.
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. |
Definition at line 2663 of file mgmapi.cpp.
int ndb_mgm_get_db_parameter_info | ( | Uint32 | paramId, |
struct ndb_mgm_param_info * | info, | ||
size_t * | size | ||
) |
Retrieve information about parameter
info | : in - pointer to structure allocated by caller |
size | : in/out : pointer to int initialized to sizeof(ndb_mgm_param_info)...will be set to bytes set by function on return |
Definition at line 185 of file mgmapi_configuration.cpp.
int ndb_mgm_get_fd | ( | NdbMgmHandle | handle | ) |
ndb_mgm_get_fd
get the file descriptor of the handle. On Win32, returns SOCKET. INTERNAL ONLY. USE FOR TESTING. OTHER USES ARE NOT A GOOD IDEA.
handle | NDB management handle |
Only used for low level testing Never to be used by end user. Or anybody who doesn't know exactly what they're doing.
Definition at line 829 of file mgmapi.cpp.
int ndb_mgm_get_latest_error | ( | const NdbMgmHandle | h | ) |
Get the most recent error associated with the management server whose handle is used as the value of handle.
handle | Management handle |
Get latest error associated with a handle
Definition at line 395 of file mgmapi.cpp.
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. |
Definition at line 402 of file mgmapi.cpp.
int ndb_mgm_get_latest_error_line | ( | const NdbMgmHandle | handle | ) |
Get the most recent internal source code error line associated with a handle
handle | Management handle. |
Definition at line 408 of file mgmapi.cpp.
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. |
Definition at line 415 of file mgmapi.cpp.
Uint32 ndb_mgm_get_mgmd_nodeid | ( | NdbMgmHandle | handle | ) |
Get the node id of the mgm server we're connected to
Definition at line 3081 of file mgmapi.cpp.
const char* ndb_mgm_get_node_status_string | ( | enum ndb_mgm_node_status | status | ) |
Converts an ID to a string
status | NDB node status. |
Definition at line 962 of file mgmapi.cpp.
const char* ndb_mgm_get_node_type_alias_string | ( | enum ndb_mgm_node_type | type, |
const char ** | str | ||
) |
Converts an ndb_mgm_node_type to a alias string
type | Node type. |
Definition at line 911 of file mgmapi.cpp.
const char* ndb_mgm_get_node_type_string | ( | enum ndb_mgm_node_type | type | ) |
Converts an ndb_mgm_node_type to a string
type | Node type. |
Definition at line 901 of file mgmapi.cpp.
|
read |
Gets status of the nodes in an NDB Cluster
handle | Management handle. |
Definition at line 1025 of file mgmapi.cpp.
|
read |
Gets status of the nodes of specified types in an NDB Cluster
handle | Management handle. |
types | Pointer to array of interesting node types. Array should be terminated by NDB_MGM_NODE_TYPE_UNKNOWN. |
Check for duplicates
Definition at line 1032 of file mgmapi.cpp.
int ndb_mgm_get_version | ( | NdbMgmHandle | handle, |
int * | major, | ||
int * | minor, | ||
int * | build, | ||
int | len, | ||
char * | str | ||
) |
Get the version of the mgm server we're talking to.
handle | Management handle |
major | Returns the major version number for NDB |
minor | Returns the minor version number for NDB |
build | Returns the build version number for NDB |
len | Specifies the max size of the buffer available to return version string in |
str | Pointer to buffer where to return the version string which is in the form "mysql-X.X.X ndb-Y.Y.Y-status" |
Definition at line 3160 of file mgmapi.cpp.
int ndb_mgm_is_connected | ( | NdbMgmHandle | handle | ) |
Return true if connected.
handle | Management handle |
Returns true if connected
Definition at line 591 of file mgmapi.cpp.
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. |
Definition at line 2012 of file mgmapi.cpp.
enum ndb_mgm_node_status ndb_mgm_match_node_status | ( | const char * | status | ) |
Converts a string to a ndb_mgm_node_status value
status | NDB node status string. |
Definition at line 948 of file mgmapi.cpp.
enum ndb_mgm_node_type ndb_mgm_match_node_type | ( | const char * | type | ) |
Converts a string to an ndb_mgm_node_type value
type | Node type as string. |
Definition at line 885 of file mgmapi.cpp.
int ndb_mgm_number_of_mgmd_in_connect_string | ( | NdbMgmHandle | handle | ) |
Returns the number of management servers in the connect string (as set by ndb_mgm_set_connectstring()). This can be used to help work out how long the maximum amount of time that ndb_mgm_connect can take.
handle | Management handle |
Definition at line 624 of file mgmapi.cpp.
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 |
Definition at line 1422 of file mgmapi.cpp.
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 |
Definition at line 1429 of file mgmapi.cpp.
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) |
Definition at line 1440 of file mgmapi.cpp.
int ndb_mgm_restart4 | ( | NdbMgmHandle | handle, |
int | no_of_nodes, | ||
const int * | node_list, | ||
int | initial, | ||
int | nostart, | ||
int | abort, | ||
int | force, | ||
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 |
force | Force restart of nodes even if it means the whole cluster will be restarted |
disconnect | Returns true if mgmapi client must disconnect from server to apply the requested operation. (e.g. restart the management server) |
Definition at line 1449 of file mgmapi.cpp.
int ndb_mgm_set_bindaddress | ( | NdbMgmHandle | , |
const char * | arg | ||
) |
Set local bindaddress
arg | - Srting of form "host[:port]" |
Definition at line 303 of file mgmapi.cpp.
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. |
Definition at line 1845 of file mgmapi.cpp.
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. |
Definition at line 1679 of file mgmapi.cpp.
int ndb_mgm_set_connect_timeout | ( | NdbMgmHandle | handle, |
unsigned int | seconds | ||
) |
DEPRECATED: use ndb_mgm_set_timeout instead.
handle | NdbMgmHandle |
seconds | number of seconds |
Definition at line 608 of file mgmapi.cpp.
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, |
Definition at line 279 of file mgmapi.cpp.
void ndb_mgm_set_error_stream | ( | NdbMgmHandle | , |
FILE * | |||
) |
Set error stream
Definition at line 381 of file mgmapi.cpp.
int ndb_mgm_set_ignore_sigpipe | ( | NdbMgmHandle | handle, |
int | val | ||
) |
Set 'ignore_sigpipe' behaviour
The mgmapi will by default install a signal handler that ignores all SIGPIPE signals that might occur when writing to an already closed or reset socket. An application that wish to use its own handler for SIGPIPE should call this function after 'ndb_mgm_create_handle' and before 'ndb_mgm_connect'(where the signal handler is installed)
handle | Management handle |
val | Value 0 - Don't ignore SIGPIPE 1 - Ignore SIGPIPE(default) |
Definition at line 335 of file mgmapi.cpp.
int ndb_mgm_set_loglevel_node | ( | NdbMgmHandle | handle, |
int | nodeId, | ||
enum ndb_mgm_event_category | category, | ||
int | level, | ||
struct ndb_mgm_reply * | reply | ||
) |
Set log category and levels for the Node
handle | NDB management handle. |
nodeId | Node ID. |
category | Event category. |
level | Log level (0-15). |
reply | Reply message. |
Definition at line 1886 of file mgmapi.cpp.
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 |
Definition at line 271 of file mgmapi.cpp.
int ndb_mgm_set_timeout | ( | NdbMgmHandle | handle, |
unsigned int | timeout_ms | ||
) |
Sets the number of milliseconds for timeout of network operations Default is 60 seconds. Only increments of 1000 ms are supported. No function is gaurenteed to return in a fraction of a second.
handle | NdbMgmHandle |
timeout_ms | number of milliseconds |
Definition at line 614 of file mgmapi.cpp.
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 |
Definition at line 2304 of file mgmapi.cpp.
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. |
Definition at line 2434 of file mgmapi.cpp.
int ndb_mgm_start_backup2 | ( | NdbMgmHandle | handle, |
int | wait_completed, | ||
unsigned int * | backup_id, | ||
struct ndb_mgm_reply * | reply, | ||
unsigned int | input_backupId | ||
) |
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. |
input_backupId | run as backupId and set next backup id to input_backupId+1. |
Definition at line 2424 of file mgmapi.cpp.
int ndb_mgm_start_backup3 | ( | NdbMgmHandle | handle, |
int | wait_completed, | ||
unsigned int * | backup_id, | ||
struct ndb_mgm_reply * | reply, | ||
unsigned int | input_backupId, | ||
unsigned int | backuppoint | ||
) |
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. |
input_backupId | run as backupId and set next backup id to input_backupId+1. |
backuppoint | Backup happen at start time(1) or complete time(0). |
Definition at line 2367 of file mgmapi.cpp.
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 |
Definition at line 1265 of file mgmapi.cpp.
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 |
Definition at line 1272 of file mgmapi.cpp.
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) |
Definition at line 1281 of file mgmapi.cpp.
int ndb_mgm_stop4 | ( | NdbMgmHandle | handle, |
int | no_of_nodes, | ||
const int * | node_list, | ||
int | abort, | ||
int | force, | ||
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 |
force | Force stop of nodes even if it means the whole cluster will be shutdown |
disconnect | Returns true if you need to disconnect to apply the stop command (e.g. stopping the mgm server that handle is connected to) |
All nodes should be stopped (all or just db)
A list of database nodes should be stopped
Definition at line 1290 of file mgmapi.cpp.
char ndb_mgm_node_state::connect_address[sizeof("000.000.000.000")+1] |
int ndb_mgm_node_state::connect_count |
int ndb_mgm_node_state::dynamic_id |
struct ndb_logevent ndb_mgm_events::events[1] |
int ndb_mgm_events::no_of_events |
int ndb_mgm_cluster_state::no_of_nodes |
int ndb_mgm_node_state::node_group |
struct ndb_mgm_node_state ndb_mgm_cluster_state::node_states[1] |
enum ndb_mgm_node_status ndb_mgm_node_state::node_status |
enum ndb_mgm_node_type ndb_mgm_node_state::node_type |
int ndb_mgm_reply::return_code |
int ndb_mgm_node_state::start_phase |