2004-04-14 10:53:21 +02:00
|
|
|
/* Copyright (C) 2003 MySQL AB
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2006-12-23 20:17:15 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
#ifndef MGMAPI_H
|
|
|
|
#define MGMAPI_H
|
|
|
|
|
2006-11-30 13:30:59 +01:00
|
|
|
#include "mgmapi_config_parameters.h"
|
|
|
|
#include "ndb_logevent.h"
|
|
|
|
|
|
|
|
#define MGM_LOGLEVELS CFG_MAX_LOGLEVEL - CFG_MIN_LOGLEVEL + 1
|
2007-02-14 15:47:34 +11:00
|
|
|
#define NDB_MGM_MAX_LOGLEVEL 15
|
2006-11-30 13:30:59 +01:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* @mainpage MySQL Cluster Management API
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* The MySQL Cluster Management API (MGM API) is a C language API
|
|
|
|
* that is used for:
|
|
|
|
* - Starting and stopping database nodes (ndbd processes)
|
|
|
|
* - Starting and stopping Cluster backups
|
|
|
|
* - Controlling the NDB Cluster log
|
|
|
|
* - Performing other administrative tasks
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-09 23:02:06 +01:00
|
|
|
* @section secMgmApiGeneral General Concepts
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2004-12-28 02:40:25 +10:00
|
|
|
* Each MGM API function needs a management server handle
|
2005-01-08 18:25:41 +01:00
|
|
|
* of type @ref NdbMgmHandle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* This handle is created by calling the function
|
2005-01-08 18:25:41 +01:00
|
|
|
* function ndb_mgm_create_handle() and freed by calling
|
|
|
|
* ndb_mgm_destroy_handle().
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* A function can return any of the following:
|
|
|
|
* -# An integer value, with
|
|
|
|
* a value of <b>-1</b> indicating an error.
|
|
|
|
* -# A non-constant pointer value. A <var>NULL</var> value indicates an error;
|
2005-01-08 18:25:41 +01:00
|
|
|
* otherwise, the return value must be freed
|
2005-01-10 02:39:36 +10:00
|
|
|
* by the programmer
|
|
|
|
* -# A constant pointer value, with a <var>NULL</var> value indicating an error.
|
|
|
|
* The returned value should <em>not</em> be freed.
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2004-12-28 02:40:25 +10:00
|
|
|
* Error conditions can be identified by using the appropriate
|
2005-01-08 18:25:41 +01:00
|
|
|
* error-reporting functions ndb_mgm_get_latest_error() and
|
|
|
|
* @ref ndb_mgm_error.
|
2005-01-09 14:31:54 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* Here is an example using the MGM API (without error handling for brevity's sake).
|
2005-01-09 14:31:54 +01:00
|
|
|
* @code
|
|
|
|
* NdbMgmHandle handle= ndb_mgm_create_handle();
|
|
|
|
* ndb_mgm_connect(handle,0,0,0);
|
|
|
|
* struct ndb_mgm_cluster_state *state= ndb_mgm_get_status(handle);
|
|
|
|
* for(int i=0; i < state->no_of_nodes; i++)
|
|
|
|
* {
|
2005-01-10 01:25:20 +01:00
|
|
|
* struct ndb_mgm_node_state *node_state= &state->node_states[i];
|
|
|
|
* printf("node with ID=%d ", node_state->node_id);
|
|
|
|
* if(node_state->version != 0)
|
2005-01-09 14:31:54 +01:00
|
|
|
* printf("connected\n");
|
|
|
|
* else
|
|
|
|
* printf("not connected\n");
|
|
|
|
* }
|
|
|
|
* free((void*)state);
|
|
|
|
* ndb_mgm_destroy_handle(&handle);
|
|
|
|
* @endcode
|
2005-01-09 23:02:06 +01:00
|
|
|
*
|
|
|
|
* @section secLogEvents Log Events
|
|
|
|
*
|
|
|
|
* 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, @ref ndb_mgm_event_category, and
|
|
|
|
* has a severity, @ref 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.
|
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
|
|
|
|
* int fd = ndb_mgm_listen_event(handle, filter);
|
|
|
|
* @endcode
|
2005-01-19 08:14:52 +01:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* @section secSLogEvents Structured Log Events
|
|
|
|
*
|
|
|
|
* The following steps are involved:
|
|
|
|
* - Create a NdbEventLogHandle using ndb_mgm_create_logevent_handle()
|
|
|
|
* - Wait and store log events using ndb_logevent_get_next()
|
|
|
|
* - The log event data is available in the struct ndb_logevent. The
|
|
|
|
* data which is specific to a particular event is stored in a union
|
|
|
|
* between structs so use ndb_logevent::type to decide which struct
|
|
|
|
* is valid.
|
|
|
|
*
|
|
|
|
* Sample code for listening to Backup related events. The availaable log
|
|
|
|
* events are listed in @ref ndb_logevent.h
|
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
|
|
|
|
* NdbEventLogHandle le_handle= ndb_mgm_create_logevent_handle(handle, filter);
|
|
|
|
* struct ndb_logevent le;
|
|
|
|
* int r= ndb_logevent_get_next(le_handle,&le,0);
|
|
|
|
* if (r < 0) error
|
|
|
|
* else if (r == 0) no event
|
|
|
|
*
|
|
|
|
* switch (le.type)
|
|
|
|
* {
|
|
|
|
* case NDB_LE_BackupStarted:
|
|
|
|
* ... le.BackupStarted.starting_node;
|
|
|
|
* ... le.BackupStarted.backup_id;
|
|
|
|
* break;
|
|
|
|
* case NDB_LE_BackupFailedToStart:
|
|
|
|
* ... le.BackupFailedToStart.error;
|
|
|
|
* break;
|
|
|
|
* case NDB_LE_BackupCompleted:
|
|
|
|
* ... le.BackupCompleted.stop_gci;
|
|
|
|
* break;
|
|
|
|
* case NDB_LE_BackupAborted:
|
|
|
|
* ... le.BackupStarted.backup_id;
|
|
|
|
* break;
|
|
|
|
* default:
|
|
|
|
* break;
|
|
|
|
* }
|
|
|
|
* @endcode
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @page ndb_logevent.h ndb_logevent.h
|
|
|
|
* @include ndb_logevent.h
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/** @addtogroup MGM_C_API
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2005-07-23 12:06:02 +02:00
|
|
|
#include <stdio.h>
|
2004-11-10 00:39:12 +01:00
|
|
|
#include <ndb_types.h>
|
2005-01-19 08:14:52 +01:00
|
|
|
#include "ndb_logevent.h"
|
2004-06-23 23:53:48 +00:00
|
|
|
#include "mgmapi_config_parameters.h"
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The NdbMgmHandle.
|
|
|
|
*/
|
|
|
|
typedef struct ndb_mgm_handle * NdbMgmHandle;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* NDB Cluster node types
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_node_type {
|
2005-01-08 18:25:41 +01:00
|
|
|
NDB_MGM_NODE_TYPE_UNKNOWN = -1 /** Node type not known*/
|
2005-01-10 01:25:20 +01:00
|
|
|
,NDB_MGM_NODE_TYPE_API /** An application (NdbApi) node */
|
2005-01-08 18:25:41 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
= NODE_TYPE_API
|
|
|
|
#endif
|
2005-01-10 01:25:20 +01:00
|
|
|
,NDB_MGM_NODE_TYPE_NDB /** A database node */
|
2005-01-08 18:25:41 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
= NODE_TYPE_DB
|
|
|
|
#endif
|
2005-01-10 01:25:20 +01:00
|
|
|
,NDB_MGM_NODE_TYPE_MGM /** A management server node */
|
2005-01-08 18:25:41 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
= NODE_TYPE_MGM
|
|
|
|
#endif
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
,NDB_MGM_NODE_TYPE_MIN = 0 /** Min valid value*/
|
|
|
|
,NDB_MGM_NODE_TYPE_MAX = 3 /** Max valid value*/
|
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Database node status
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_node_status {
|
2005-01-08 18:25:41 +01:00
|
|
|
/** Node status not known*/
|
|
|
|
NDB_MGM_NODE_STATUS_UNKNOWN = 0,
|
|
|
|
/** No contact with node*/
|
|
|
|
NDB_MGM_NODE_STATUS_NO_CONTACT = 1,
|
|
|
|
/** Has not run starting protocol*/
|
|
|
|
NDB_MGM_NODE_STATUS_NOT_STARTED = 2,
|
|
|
|
/** Is running starting protocol*/
|
|
|
|
NDB_MGM_NODE_STATUS_STARTING = 3,
|
|
|
|
/** Running*/
|
|
|
|
NDB_MGM_NODE_STATUS_STARTED = 4,
|
|
|
|
/** Is shutting down*/
|
|
|
|
NDB_MGM_NODE_STATUS_SHUTTING_DOWN = 5,
|
|
|
|
/** Is restarting*/
|
|
|
|
NDB_MGM_NODE_STATUS_RESTARTING = 6,
|
|
|
|
/** Maintenance mode*/
|
|
|
|
NDB_MGM_NODE_STATUS_SINGLEUSER = 7,
|
|
|
|
/** Resume mode*/
|
|
|
|
NDB_MGM_NODE_STATUS_RESUME = 8,
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
/** Min valid value*/
|
|
|
|
NDB_MGM_NODE_STATUS_MIN = 0,
|
|
|
|
/** Max valid value*/
|
|
|
|
NDB_MGM_NODE_STATUS_MAX = 8
|
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Error codes
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_error {
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Not an error */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_NO_ERROR = 0,
|
|
|
|
|
|
|
|
/* Request for service errors */
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Supplied connectstring is illegal */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_ILLEGAL_CONNECT_STRING = 1001,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Supplied NdbMgmHandle is illegal */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_ILLEGAL_SERVER_HANDLE = 1005,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Illegal reply from server */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_ILLEGAL_SERVER_REPLY = 1006,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Illegal number of nodes */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_ILLEGAL_NUMBER_OF_NODES = 1007,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Illegal node status */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_ILLEGAL_NODE_STATUS = 1008,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Memory allocation error */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_OUT_OF_MEMORY = 1009,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Management server not connected */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_SERVER_NOT_CONNECTED = 1010,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Could not connect to socker */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET = 1011,
|
2006-09-13 10:09:23 +02:00
|
|
|
/** Could not bind local address */
|
|
|
|
NDB_MGM_BIND_ADDRESS = 1012,
|
|
|
|
|
2006-04-26 16:57:45 +02:00
|
|
|
/* Alloc node id failures */
|
|
|
|
/** Generic error, retry may succeed */
|
|
|
|
NDB_MGM_ALLOCID_ERROR = 1101,
|
|
|
|
/** Non retriable error */
|
|
|
|
NDB_MGM_ALLOCID_CONFIG_MISMATCH = 1102,
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/* Service errors - Start/Stop Node or System */
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Start failed */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_START_FAILED = 2001,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Stop failed */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_STOP_FAILED = 2002,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Restart failed */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_RESTART_FAILED = 2003,
|
|
|
|
|
|
|
|
/* Service errors - Backup */
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Unable to start backup */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_COULD_NOT_START_BACKUP = 3001,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Unable to abort backup */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_COULD_NOT_ABORT_BACKUP = 3002,
|
|
|
|
|
|
|
|
/* Service errors - Single User Mode */
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Unable to enter single user mode */
|
2004-04-14 10:53:21 +02:00
|
|
|
NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Unable to exit single user mode */
|
2004-10-10 17:38:14 +02:00
|
|
|
NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
|
|
|
|
|
|
|
|
/* Usage errors */
|
2005-01-09 10:47:47 +01:00
|
|
|
/** Usage error */
|
2004-10-10 17:38:14 +02:00
|
|
|
NDB_MGM_USAGE_ERROR = 5001
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
2005-01-08 18:25:41 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
2004-04-14 10:53:21 +02:00
|
|
|
struct Ndb_Mgm_Error_Msg {
|
|
|
|
enum ndb_mgm_error code;
|
2004-12-28 02:40:25 +10:00
|
|
|
const char * msg;
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
const struct Ndb_Mgm_Error_Msg ndb_mgm_error_msgs[] = {
|
|
|
|
{ NDB_MGM_NO_ERROR, "No error" },
|
|
|
|
|
2005-01-08 18:25:41 +01:00
|
|
|
/* Request for service errors */
|
2004-04-14 10:53:21 +02:00
|
|
|
{ NDB_MGM_ILLEGAL_CONNECT_STRING, "Illegal connect string" },
|
|
|
|
{ NDB_MGM_ILLEGAL_SERVER_HANDLE, "Illegal server handle" },
|
|
|
|
{ NDB_MGM_ILLEGAL_SERVER_REPLY, "Illegal reply from server" },
|
|
|
|
{ NDB_MGM_ILLEGAL_NUMBER_OF_NODES, "Illegal number of nodes" },
|
|
|
|
{ NDB_MGM_ILLEGAL_NODE_STATUS, "Illegal node status" },
|
|
|
|
{ NDB_MGM_OUT_OF_MEMORY, "Out of memory" },
|
|
|
|
{ NDB_MGM_SERVER_NOT_CONNECTED, "Management server not connected" },
|
|
|
|
{ NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, "Could not connect to socket" },
|
|
|
|
|
|
|
|
/* Service errors - Start/Stop Node or System */
|
|
|
|
{ NDB_MGM_START_FAILED, "Start failed" },
|
|
|
|
{ NDB_MGM_STOP_FAILED, "Stop failed" },
|
|
|
|
{ NDB_MGM_RESTART_FAILED, "Restart failed" },
|
|
|
|
|
|
|
|
/* Service errors - Backup */
|
|
|
|
{ NDB_MGM_COULD_NOT_START_BACKUP, "Could not start backup" },
|
|
|
|
{ NDB_MGM_COULD_NOT_ABORT_BACKUP, "Could not abort backup" },
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/* Service errors - Single User Mode */
|
2004-12-28 02:40:25 +10:00
|
|
|
{ NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE,
|
2004-04-14 10:53:21 +02:00
|
|
|
"Could not enter single user mode" },
|
2004-12-28 02:40:25 +10:00
|
|
|
{ NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE,
|
2004-10-10 17:38:14 +02:00
|
|
|
"Could not exit single user mode" },
|
|
|
|
|
|
|
|
/* Usage errors */
|
|
|
|
{ NDB_MGM_USAGE_ERROR,
|
|
|
|
"Usage error" }
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
2004-12-28 02:40:25 +10:00
|
|
|
const int ndb_mgm_noOfErrorMsgs =
|
2004-04-14 10:53:21 +02:00
|
|
|
sizeof(ndb_mgm_error_msgs)/sizeof(struct Ndb_Mgm_Error_Msg);
|
2005-01-08 18:25:41 +01:00
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
/**
|
2005-01-10 01:25:20 +01:00
|
|
|
* Status of a node in the cluster.
|
2005-01-08 18:25:41 +01:00
|
|
|
*
|
|
|
|
* Sub-structure in enum ndb_mgm_cluster_state
|
2005-01-10 01:25:20 +01:00
|
|
|
* returned by ndb_mgm_get_status().
|
2005-01-09 14:31:54 +01:00
|
|
|
*
|
2005-01-10 01:25:20 +01:00
|
|
|
* @note <var>node_status</var>, <var>start_phase</var>,
|
|
|
|
* <var>dynamic_id</var>
|
|
|
|
* and <var>node_group</var> are relevant only for database nodes,
|
|
|
|
* i.e. <var>node_type</var> == @ref NDB_MGM_NODE_TYPE_NDB.
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
struct ndb_mgm_node_state {
|
2005-01-10 02:39:36 +10:00
|
|
|
/** NDB Cluster node ID*/
|
2005-01-08 18:25:41 +01:00
|
|
|
int node_id;
|
|
|
|
/** Type of NDB Cluster node*/
|
|
|
|
enum ndb_mgm_node_type node_type;
|
|
|
|
/** State of node*/
|
|
|
|
enum ndb_mgm_node_status node_status;
|
|
|
|
/** Start phase.
|
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note Start phase is only valid if the <var>node_type</var> is
|
|
|
|
* NDB_MGM_NODE_TYPE_NDB and the <var>node_status</var> is
|
2005-01-08 18:25:41 +01:00
|
|
|
* NDB_MGM_NODE_STATUS_STARTING
|
|
|
|
*/
|
|
|
|
int start_phase;
|
2005-01-10 02:39:36 +10:00
|
|
|
/** ID for heartbeats and master take-over (only valid for DB nodes)
|
2005-01-08 18:25:41 +01:00
|
|
|
*/
|
|
|
|
int dynamic_id;
|
|
|
|
/** Node group of node (only valid for DB nodes)*/
|
|
|
|
int node_group;
|
|
|
|
/** Internal version number*/
|
|
|
|
int version;
|
|
|
|
/** Number of times node has connected or disconnected to the
|
|
|
|
* management server
|
|
|
|
*/
|
|
|
|
int connect_count;
|
2005-01-10 02:39:36 +10:00
|
|
|
/** IP address of node when it connected to the management server.
|
|
|
|
* @note This value will be empty if the management server has restarted
|
|
|
|
* since the node last connected.
|
2005-01-08 18:25:41 +01:00
|
|
|
*/
|
|
|
|
char connect_address[
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
sizeof("000.000.000.000")+1
|
|
|
|
#endif
|
|
|
|
];
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* State of all nodes in the cluster; returned from
|
2005-01-08 18:25:41 +01:00
|
|
|
* ndb_mgm_get_status()
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
struct ndb_mgm_cluster_state {
|
2005-01-10 02:39:36 +10:00
|
|
|
/** Number of entries in the node_states array */
|
2005-01-08 18:25:41 +01:00
|
|
|
int no_of_nodes;
|
|
|
|
/** An array with node_states*/
|
|
|
|
struct ndb_mgm_node_state node_states[
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
|
|
|
1
|
|
|
|
#endif
|
|
|
|
];
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Default reply from the server (reserved for future use)
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
struct ndb_mgm_reply {
|
2005-01-08 18:25:41 +01:00
|
|
|
/** 0 if successful, otherwise error code. */
|
|
|
|
int return_code;
|
|
|
|
/** Error or reply message.*/
|
|
|
|
char message[256];
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
2005-01-08 18:25:41 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
|
|
|
* Default information types
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_info {
|
2005-01-08 18:25:41 +01:00
|
|
|
/** ?*/
|
|
|
|
NDB_MGM_INFO_CLUSTER,
|
|
|
|
/** Cluster log*/
|
|
|
|
NDB_MGM_INFO_CLUSTERLOG
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal log modes
|
|
|
|
* (Used only in the development of NDB Cluster.)
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_signal_log_mode {
|
2005-01-08 18:25:41 +01:00
|
|
|
/** Log receiving signals */
|
|
|
|
NDB_MGM_SIGNAL_LOG_MODE_IN,
|
|
|
|
/** Log sending signals*/
|
|
|
|
NDB_MGM_SIGNAL_LOG_MODE_OUT,
|
|
|
|
/** Log both sending/receiving*/
|
|
|
|
NDB_MGM_SIGNAL_LOG_MODE_INOUT,
|
|
|
|
/** Log off*/
|
|
|
|
NDB_MGM_SIGNAL_LOG_MODE_OFF
|
2004-04-14 10:53:21 +02:00
|
|
|
};
|
2005-01-08 18:25:41 +01:00
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
/***************************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2004-04-14 10:53:21 +02:00
|
|
|
* @name Functions: Error Handling
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Get the most recent error associated with the management server whose handle
|
|
|
|
* is used as the value of <var>handle</var>.
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
* @return Latest error code
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_latest_error(const NdbMgmHandle handle);
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Get the most recent general error message associated with a handle
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @return Latest error message
|
|
|
|
*/
|
|
|
|
const char * ndb_mgm_get_latest_error_msg(const NdbMgmHandle handle);
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Get the most recent error description associated with a handle
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* The error description gives some additional information regarding
|
2004-04-14 10:53:21 +02:00
|
|
|
* the error message.
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @return Latest error description
|
|
|
|
*/
|
|
|
|
const char * ndb_mgm_get_latest_error_desc(const NdbMgmHandle handle);
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Get the most recent internal source code error line associated with a handle
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @return Latest internal source code line of latest error
|
2004-12-28 02:40:25 +10:00
|
|
|
* @deprecated
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
int ndb_mgm_get_latest_error_line(const NdbMgmHandle handle);
|
|
|
|
#endif
|
|
|
|
|
2005-07-23 12:06:02 +02:00
|
|
|
/**
|
|
|
|
* Set error stream
|
|
|
|
*/
|
|
|
|
void ndb_mgm_set_error_stream(NdbMgmHandle, FILE *);
|
|
|
|
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2004-04-14 10:53:21 +02:00
|
|
|
* @name Functions: Create/Destroy Management Server Handles
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Create a handle to a management server.
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
changed mysqladmin.c to mysqladmin.cc
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
client/Makefile.am:
changed mysqladmin.c to mysqladmin.cc
client/mysqladmin.cc:
changed mysqladmin.c to mysqladmin.cc
configure.in:
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
ndb/include/mgmapi/mgmapi.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/mgmcommon/ConfigRetriever.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/ndbapi/ndb_cluster_connection.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/vm/Configuration.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays
ndb/src/kernel/vm/Configuration.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/mgmapi.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/CommandInterpreter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvr.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
ndb/src/mgmsrv/MgmtSrvr.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/ndbapi/ndb_cluster_connection.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/tools/waiter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
2004-11-18 18:38:38 +00:00
|
|
|
* @return A management handle<br>
|
2005-01-10 02:39:36 +10:00
|
|
|
* or <var>NULL</var> if no management handle could be created.
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
NdbMgmHandle ndb_mgm_create_handle();
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Destroy a management server handle.
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
*/
|
|
|
|
void ndb_mgm_destroy_handle(NdbMgmHandle * handle);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2006-02-13 12:58:12 +01:00
|
|
|
/**
|
|
|
|
* Set a name of the handle. Name is reported in cluster log.
|
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
* @param name Name
|
|
|
|
*/
|
|
|
|
void ndb_mgm_set_name(NdbMgmHandle handle, const char *name);
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2004-04-14 10:53:21 +02:00
|
|
|
* @name Functions: Connect/Disconnect Management Server
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Sets the connectstring for a management server
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
2004-12-28 02:40:25 +10:00
|
|
|
* @param connect_string Connect string to the management server,
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @return -1 on error.
|
2005-01-09 00:45:05 +01:00
|
|
|
*
|
|
|
|
* @code
|
|
|
|
* <connectstring> := [<nodeid-specification>,]<host-specification>[,<host-specification>]
|
|
|
|
* <nodeid-specification> := nodeid=<id>
|
|
|
|
* <host-specification> := <host>[:<port>]
|
2005-01-09 23:19:07 +01:00
|
|
|
* <id> is an integer greater than 0 identifying a node in config.ini
|
2005-01-09 00:45:05 +01:00
|
|
|
* <port> is an integer referring to a regular unix port
|
2005-01-10 02:39:36 +10:00
|
|
|
* <host> is a string containing a valid network host address
|
2005-01-09 00:45:05 +01:00
|
|
|
* @endcode
|
2004-12-23 11:21:01 +01:00
|
|
|
*/
|
|
|
|
int ndb_mgm_set_connectstring(NdbMgmHandle handle,
|
|
|
|
const char *connect_string);
|
|
|
|
|
2005-02-16 20:46:34 +01:00
|
|
|
int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid);
|
changed mysqladmin.c to mysqladmin.cc
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
client/Makefile.am:
changed mysqladmin.c to mysqladmin.cc
client/mysqladmin.cc:
changed mysqladmin.c to mysqladmin.cc
configure.in:
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
ndb/include/mgmapi/mgmapi.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/mgmcommon/ConfigRetriever.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/ndbapi/ndb_cluster_connection.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/vm/Configuration.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays
ndb/src/kernel/vm/Configuration.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/mgmapi.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/CommandInterpreter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvr.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
ndb/src/mgmsrv/MgmtSrvr.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/ndbapi/ndb_cluster_connection.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/tools/waiter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
2004-11-18 18:38:38 +00:00
|
|
|
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);
|
2004-11-30 17:47:47 +00:00
|
|
|
const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
|
changed mysqladmin.c to mysqladmin.cc
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
client/Makefile.am:
changed mysqladmin.c to mysqladmin.cc
client/mysqladmin.cc:
changed mysqladmin.c to mysqladmin.cc
configure.in:
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
ndb/include/mgmapi/mgmapi.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/mgmcommon/ConfigRetriever.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/ndbapi/ndb_cluster_connection.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/vm/Configuration.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays
ndb/src/kernel/vm/Configuration.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/mgmapi.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/CommandInterpreter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvr.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
ndb/src/mgmsrv/MgmtSrvr.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/ndbapi/ndb_cluster_connection.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/tools/waiter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
2004-11-18 18:38:38 +00:00
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2006-09-13 10:09:23 +02:00
|
|
|
* Set local bindaddress
|
|
|
|
* @param arg - Srting of form "host[:port]"
|
|
|
|
* @note must be called before connect
|
|
|
|
* @note Error on binding local address will not be reported until connect
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
|
|
|
int ndb_mgm_set_bindaddress(NdbMgmHandle, const char * arg);
|
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Gets the connectstring used for a connection
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note This function returns the default connectstring if no call to
|
2005-01-10 01:25:20 +01:00
|
|
|
* ndb_mgm_set_connectstring() has been performed. Also, the
|
|
|
|
* returned connectstring may be formatted differently.
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
2005-01-10 01:25:20 +01:00
|
|
|
* @param buf Buffer to hold result
|
|
|
|
* @param buf_sz Size of buffer.
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 01:25:20 +01:00
|
|
|
* @return connectstring (same as <var>buf</var>)
|
2004-12-23 11:21:01 +01:00
|
|
|
*/
|
|
|
|
const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz);
|
|
|
|
|
2007-01-23 17:07:09 +11:00
|
|
|
/**
|
2007-03-22 22:34:43 +11:00
|
|
|
* DEPRICATED: use ndb_mgm_set_timeout instead.
|
2007-01-23 17:07:09 +11:00
|
|
|
*
|
|
|
|
* @param handle NdbMgmHandle
|
|
|
|
* @param seconds number of seconds
|
|
|
|
* @return non-zero on success
|
|
|
|
*/
|
|
|
|
int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds);
|
|
|
|
|
2007-03-22 22:33:19 +11:00
|
|
|
/**
|
2007-03-22 22:34:43 +11:00
|
|
|
* 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.
|
2007-03-22 22:33:19 +11:00
|
|
|
*
|
|
|
|
* @param handle NdbMgmHandle
|
2007-03-22 22:34:43 +11:00
|
|
|
* @param timeout_ms number of milliseconds
|
2007-03-22 22:33:19 +11:00
|
|
|
* @return zero on success
|
|
|
|
*/
|
2007-03-22 22:34:43 +11:00
|
|
|
int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int timeout_ms);
|
2007-03-22 22:33:19 +11:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Connects to a management server. Connectstring is set by
|
2005-01-09 00:45:05 +01:00
|
|
|
* ndb_mgm_set_connectstring().
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 01:25:20 +01:00
|
|
|
* @param no_retries Number of retries to connect
|
|
|
|
* (0 means connect once).
|
|
|
|
* @param retry_delay_in_seconds
|
|
|
|
* How long to wait until retry is performed.
|
|
|
|
* @param verbose Make printout regarding connect retries.
|
|
|
|
*
|
2004-04-14 10:53:21 +02:00
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
changed mysqladmin.c to mysqladmin.cc
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
client/Makefile.am:
changed mysqladmin.c to mysqladmin.cc
client/mysqladmin.cc:
changed mysqladmin.c to mysqladmin.cc
configure.in:
no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
ndb/include/mgmapi/mgmapi.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/mgmcommon/ConfigRetriever.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/ndbapi/ndb_cluster_connection.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/vm/Configuration.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays
ndb/src/kernel/vm/Configuration.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/mgmapi.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/CommandInterpreter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.h:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvr.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
enabled multiple management servrs to fetch data configurations from eachother
ndb/src/mgmsrv/MgmtSrvr.hpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/main.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/ndbapi/ndb_cluster_connection.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
ndb/tools/waiter.cpp:
aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
removed all dependencies of LocalConfig, except for mgmapi internals
2004-11-18 18:38:38 +00:00
|
|
|
int ndb_mgm_connect(NdbMgmHandle handle, int no_retries,
|
|
|
|
int retry_delay_in_seconds, int verbose);
|
2005-02-15 18:30:44 +11:00
|
|
|
/**
|
|
|
|
* Return true if connected.
|
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
* @return 0 if not connected, non-zero if connected.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_is_connected(NdbMgmHandle handle);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Disconnects from a management server
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_disconnect(NdbMgmHandle handle);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Gets connection node ID
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Node ID; 0 indicates that no node ID has been
|
2005-01-09 00:45:05 +01:00
|
|
|
* specified
|
2004-12-23 11:21:01 +01:00
|
|
|
*/
|
|
|
|
int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
|
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Gets connection port
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
*
|
|
|
|
* @return port
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_connected_port(NdbMgmHandle handle);
|
|
|
|
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Gets connection host
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @param handle Management handle
|
|
|
|
*
|
|
|
|
* @return hostname
|
|
|
|
*/
|
|
|
|
const char *ndb_mgm_get_connected_host(NdbMgmHandle handle);
|
|
|
|
|
2005-01-09 00:45:05 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
2004-04-14 10:53:21 +02:00
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* @name Functions: Used to convert between different data formats
|
2004-04-14 10:53:21 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Converts a string to an <var>ndb_mgm_node_type</var> value
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param type Node type as string.
|
|
|
|
* @return NDB_MGM_NODE_TYPE_UNKNOWN if invalid string.
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_node_type ndb_mgm_match_node_type(const char * type);
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Converts an ndb_mgm_node_type to a string
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param type Node type.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return <var>NULL</var> if invalid ID.
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
const char * ndb_mgm_get_node_type_string(enum ndb_mgm_node_type type);
|
|
|
|
|
dded method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
added sanity checks for config file
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
added error_string for to some functions, alloc_node_id(), start()
added better error printout for failed alloc node id
better error printouts for failures when starting ndb_mgmd
ndb/include/mgmapi/mgmapi.h:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/common/mgmcommon/ConfigInfo.cpp:
added sanity checks for config file
ndb/src/common/mgmcommon/NdbConfig.c:
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
ndb/src/kernel/error/ErrorReporter.cpp:
removed usage of tracefile early in startup (when it's normally filled with zeroes)
ndb/src/mgmapi/mgmapi.cpp:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/mgmsrv/MgmtSrvr.cpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/MgmtSrvr.hpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/Services.cpp:
added better error printout for failed alloc node id
ndb/src/mgmsrv/main.cpp:
better error printouts for failures when starting ndb_mgmd
2004-09-08 14:30:39 +00:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Converts an ndb_mgm_node_type to a alias string
|
dded method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
added sanity checks for config file
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
added error_string for to some functions, alloc_node_id(), start()
added better error printout for failed alloc node id
better error printouts for failures when starting ndb_mgmd
ndb/include/mgmapi/mgmapi.h:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/common/mgmcommon/ConfigInfo.cpp:
added sanity checks for config file
ndb/src/common/mgmcommon/NdbConfig.c:
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
ndb/src/kernel/error/ErrorReporter.cpp:
removed usage of tracefile early in startup (when it's normally filled with zeroes)
ndb/src/mgmapi/mgmapi.cpp:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/mgmsrv/MgmtSrvr.cpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/MgmtSrvr.hpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/Services.cpp:
added better error printout for failed alloc node id
ndb/src/mgmsrv/main.cpp:
better error printouts for failures when starting ndb_mgmd
2004-09-08 14:30:39 +00:00
|
|
|
*
|
|
|
|
* @param type Node type.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return <var>NULL</var> if the ID is invalid.
|
dded method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
added sanity checks for config file
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
added error_string for to some functions, alloc_node_id(), start()
added better error printout for failed alloc node id
better error printouts for failures when starting ndb_mgmd
ndb/include/mgmapi/mgmapi.h:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/common/mgmcommon/ConfigInfo.cpp:
added sanity checks for config file
ndb/src/common/mgmcommon/NdbConfig.c:
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
ndb/src/kernel/error/ErrorReporter.cpp:
removed usage of tracefile early in startup (when it's normally filled with zeroes)
ndb/src/mgmapi/mgmapi.cpp:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/mgmsrv/MgmtSrvr.cpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/MgmtSrvr.hpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/Services.cpp:
added better error printout for failed alloc node id
ndb/src/mgmsrv/main.cpp:
better error printouts for failures when starting ndb_mgmd
2004-09-08 14:30:39 +00:00
|
|
|
*/
|
2004-12-23 11:21:01 +01:00
|
|
|
const char * ndb_mgm_get_node_type_alias_string(enum ndb_mgm_node_type type,
|
|
|
|
const char **str);
|
dded method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
added sanity checks for config file
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
added error_string for to some functions, alloc_node_id(), start()
added better error printout for failed alloc node id
better error printouts for failures when starting ndb_mgmd
ndb/include/mgmapi/mgmapi.h:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/common/mgmcommon/ConfigInfo.cpp:
added sanity checks for config file
ndb/src/common/mgmcommon/NdbConfig.c:
changed so that ndb_0 is replaced by ndb_pid#### in ndb files
ndb/src/kernel/error/ErrorReporter.cpp:
removed usage of tracefile early in startup (when it's normally filled with zeroes)
ndb/src/mgmapi/mgmapi.cpp:
added method to retrieve mysqld, ndbd, and ndb_mgmd aliases for API,MGM and DB
ndb/src/mgmsrv/MgmtSrvr.cpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/MgmtSrvr.hpp:
added error_string for to some functions, alloc_node_id(), start()
ndb/src/mgmsrv/Services.cpp:
added better error printout for failed alloc node id
ndb/src/mgmsrv/main.cpp:
better error printouts for failures when starting ndb_mgmd
2004-09-08 14:30:39 +00:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Converts a string to a <var>ndb_mgm_node_status</var> value
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param status NDB node status string.
|
|
|
|
* @return NDB_MGM_NODE_STATUS_UNKNOWN if invalid string.
|
|
|
|
*/
|
|
|
|
enum ndb_mgm_node_status ndb_mgm_match_node_status(const char * status);
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Converts an ID to a string
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param status NDB node status.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return <var>NULL</var> if invalid ID.
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
const char * ndb_mgm_get_node_status_string(enum ndb_mgm_node_status status);
|
|
|
|
|
2005-01-09 23:02:06 +01:00
|
|
|
const char * ndb_mgm_get_event_severity_string(enum ndb_mgm_event_severity);
|
2004-09-17 08:28:22 +02:00
|
|
|
ndb_mgm_event_category ndb_mgm_match_event_category(const char *);
|
|
|
|
const char * ndb_mgm_get_event_category_string(enum ndb_mgm_event_category);
|
2004-12-23 11:21:01 +01:00
|
|
|
#endif
|
2004-09-17 08:28:22 +02:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* @name Functions: Cluster status
|
2004-04-14 10:53:21 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Gets status of the nodes in an NDB Cluster
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note The caller must free the pointer returned by this function.
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Cluster state (or <var>NULL</var> on error).
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
struct ndb_mgm_cluster_state * ndb_mgm_get_status(NdbMgmHandle handle);
|
|
|
|
|
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
|
|
|
* @name Functions: Start/stop nodes
|
2004-04-14 10:53:21 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Stops database nodes
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param no_of_nodes Number of database nodes to be stopped<br>
|
|
|
|
* 0: All database nodes in cluster<br>
|
|
|
|
* n: Stop the <var>n</var> node(s) specified in the
|
2004-04-14 10:53:21 +02:00
|
|
|
* array node_list
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param node_list List of node IDs for database nodes to be stopped
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Number of nodes stopped (-1 on error)
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note This function is equivalent
|
|
|
|
* to calling ndb_mgm_stop2(handle, no_of_nodes, node_list, 0)
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
2004-12-28 02:40:25 +10:00
|
|
|
int ndb_mgm_stop(NdbMgmHandle handle, int no_of_nodes,
|
2004-04-14 10:53:21 +02:00
|
|
|
const int * node_list);
|
|
|
|
|
|
|
|
/**
|
2005-01-10 02:39:36 +10:00
|
|
|
* Stops database nodes
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param no_of_nodes Number of database nodes to stop<br>
|
|
|
|
* 0: All database nodes in cluster<br>
|
|
|
|
* n: Stop the <var>n</var> node(s) specified in
|
2004-04-14 10:53:21 +02:00
|
|
|
* the array node_list
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param node_list List of node IDs of database nodes to be stopped
|
|
|
|
* @param abort Don't perform graceful stop,
|
|
|
|
* but rather stop immediately
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Number of nodes stopped (-1 on error).
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
int ndb_mgm_stop2(NdbMgmHandle handle, int no_of_nodes,
|
|
|
|
const int * node_list, int abort);
|
|
|
|
|
2006-05-23 16:24:26 +10:00
|
|
|
/**
|
|
|
|
* Stops cluster nodes
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @param no_of_nodes Number of database nodes to stop<br>
|
|
|
|
* -1: All database and management nodes<br>
|
|
|
|
* 0: All database nodes in cluster<br>
|
|
|
|
* n: Stop the <var>n</var> node(s) specified in
|
|
|
|
* the array node_list
|
|
|
|
* @param node_list List of node IDs of database nodes to be stopped
|
|
|
|
* @param abort Don't perform graceful stop,
|
|
|
|
* but rather stop immediately
|
|
|
|
* @param disconnect Returns true if you need to disconnect to apply
|
|
|
|
* the stop command (e.g. stopping the mgm server
|
|
|
|
* that handle is connected to)
|
|
|
|
*
|
|
|
|
* @return Number of nodes stopped (-1 on error).
|
|
|
|
*/
|
|
|
|
int ndb_mgm_stop3(NdbMgmHandle handle, int no_of_nodes,
|
|
|
|
const int * node_list, int abort, int *disconnect);
|
|
|
|
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
|
|
|
* Restart database nodes
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param no_of_nodes Number of database nodes to restart<br>
|
|
|
|
* 0: All database nodes in cluster<br>
|
|
|
|
* n: Restart the <var>n</var> node(s) specified in the
|
2004-04-14 10:53:21 +02:00
|
|
|
* array node_list
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param node_list List of node IDs of database nodes to be restarted
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Number of nodes restarted (-1 on error).
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note This function is equivalent to calling
|
2004-04-14 10:53:21 +02:00
|
|
|
* ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0);
|
|
|
|
*/
|
2004-12-28 02:40:25 +10:00
|
|
|
int ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes,
|
2004-04-14 10:53:21 +02:00
|
|
|
const int * node_list);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Restart database nodes
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param no_of_nodes Number of database nodes to be restarted:<br>
|
|
|
|
* 0: Restart all database nodes in the cluster<br>
|
|
|
|
* n: Restart the <var>n</var> node(s) specified in the
|
2004-04-14 10:53:21 +02:00
|
|
|
* array node_list
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param node_list List of node IDs of database nodes to be restarted
|
|
|
|
* @param initial Remove filesystem from restarting node(s)
|
2004-12-28 02:40:25 +10:00
|
|
|
* @param nostart Don't actually start node(s) but leave them
|
2004-04-14 10:53:21 +02:00
|
|
|
* waiting for start command
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param abort Don't perform graceful restart,
|
|
|
|
* but rather restart immediately
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Number of nodes stopped (-1 on error).
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
int ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes,
|
|
|
|
const int * node_list, int initial,
|
|
|
|
int nostart, int abort);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2006-05-23 16:24:26 +10:00
|
|
|
/**
|
|
|
|
* Restart nodes
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
|
|
|
* @param no_of_nodes Number of database nodes to be restarted:<br>
|
|
|
|
* 0: Restart all database nodes in the cluster<br>
|
|
|
|
* n: Restart the <var>n</var> node(s) specified in the
|
|
|
|
* array node_list
|
|
|
|
* @param node_list List of node IDs of database nodes to be restarted
|
|
|
|
* @param initial Remove filesystem from restarting node(s)
|
|
|
|
* @param nostart Don't actually start node(s) but leave them
|
|
|
|
* waiting for start command
|
|
|
|
* @param abort Don't perform graceful restart,
|
|
|
|
* but rather restart immediately
|
|
|
|
* @param disconnect Returns true if mgmapi client must disconnect from
|
|
|
|
* server to apply the requested operation. (e.g.
|
|
|
|
* restart the management server)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return Number of nodes stopped (-1 on error).
|
|
|
|
*/
|
|
|
|
int ndb_mgm_restart3(NdbMgmHandle handle, int no_of_nodes,
|
|
|
|
const int * node_list, int initial,
|
|
|
|
int nostart, int abort, int *disconnect);
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
|
|
|
* Start database nodes
|
|
|
|
*
|
|
|
|
* @param handle Management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param no_of_nodes Number of database nodes to be started<br>
|
|
|
|
* 0: Start all database nodes in the cluster<br>
|
|
|
|
* n: Start the <var>n</var> node(s) specified in
|
2004-04-14 10:53:21 +02:00
|
|
|
* the array node_list
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param node_list List of node IDs of database nodes to be started
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @return Number of nodes actually started (-1 on error).
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note The nodes to be started must have been started with nostart(-n)
|
2004-04-14 10:53:21 +02:00
|
|
|
* argument.
|
2004-12-28 02:40:25 +10:00
|
|
|
* This means that the database node binary is started and
|
|
|
|
* waiting for a START management command which will
|
2005-01-10 02:39:36 +10:00
|
|
|
* actually enable the database node
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
|
|
|
int ndb_mgm_start(NdbMgmHandle handle,
|
|
|
|
int no_of_nodes,
|
|
|
|
const int * node_list);
|
|
|
|
|
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2005-01-09 23:02:06 +01:00
|
|
|
* @name Functions: Controlling Clusterlog output
|
2004-04-14 10:53:21 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-09 23:02:06 +01:00
|
|
|
* Filter cluster log severities
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
2005-01-09 23:02:06 +01:00
|
|
|
* @param severity A cluster log severity to filter.
|
2005-01-09 23:19:07 +01:00
|
|
|
* @param enable set 1=enable o 0=disable
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param reply Reply message.
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2004-04-14 10:53:21 +02:00
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
2005-01-09 23:02:06 +01:00
|
|
|
int ndb_mgm_set_clusterlog_severity_filter(NdbMgmHandle handle,
|
|
|
|
enum ndb_mgm_event_severity severity,
|
|
|
|
int enable,
|
|
|
|
struct ndb_mgm_reply* reply);
|
2006-11-30 13:30:59 +01:00
|
|
|
/**
|
|
|
|
* Get clusterlog severity filter
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle
|
|
|
|
*
|
|
|
|
* @param 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.
|
|
|
|
* @param severity_size The size of the vector (NDB_MGM_EVENT_SEVERITY_ALL)
|
|
|
|
* @return Number of returned severities or -1 on error
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_clusterlog_severity_filter(NdbMgmHandle handle,
|
|
|
|
struct ndb_mgm_severity* severity,
|
|
|
|
unsigned int severity_size);
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2005-01-09 23:02:06 +01:00
|
|
|
* Get clusterlog severity filter
|
2004-12-28 02:40:25 +10:00
|
|
|
*
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param handle NDB management handle
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2004-12-28 02:40:25 +10:00
|
|
|
* @return A vector of seven elements,
|
2004-04-14 10:53:21 +02:00
|
|
|
* where each element contains
|
2005-01-10 02:39:36 +10:00
|
|
|
* 1 if a severity indicator is enabled and 0 if not.
|
|
|
|
* A severity level is stored at position
|
|
|
|
* ndb_mgm_clusterlog_level;
|
2004-04-14 10:53:21 +02:00
|
|
|
* for example the "error" level is stored in position
|
2005-01-09 23:19:07 +01:00
|
|
|
* [NDB_MGM_EVENT_SEVERITY_ERROR].
|
|
|
|
* The first element [NDB_MGM_EVENT_SEVERITY_ON] in
|
|
|
|
* the vector signals
|
2005-01-10 02:39:36 +10:00
|
|
|
* whether the cluster log
|
2004-04-14 10:53:21 +02:00
|
|
|
* is disabled or enabled.
|
|
|
|
*/
|
2006-11-30 13:30:59 +01:00
|
|
|
const unsigned int *ndb_mgm_get_clusterlog_severity_filter_old(NdbMgmHandle handle);
|
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set log category and levels for the cluster log
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param nodeId Node ID.
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param category Event category.
|
|
|
|
* @param level Log level (0-15).
|
|
|
|
* @param reply Reply message.
|
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
2005-01-09 23:02:06 +01:00
|
|
|
int ndb_mgm_set_clusterlog_loglevel(NdbMgmHandle handle,
|
2004-04-14 10:53:21 +02:00
|
|
|
int nodeId,
|
2004-09-17 08:28:22 +02:00
|
|
|
enum ndb_mgm_event_category category,
|
2004-04-14 10:53:21 +02:00
|
|
|
int level,
|
|
|
|
struct ndb_mgm_reply* reply);
|
2006-11-30 13:30:59 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get log category and levels
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @param loglevel A vector of twelve (MGM_LOGLEVELS) elements
|
|
|
|
* of struct ndb_mgm_loglevel,
|
|
|
|
* where each element contains
|
|
|
|
* loglevel of corresponding category
|
|
|
|
* @param loglevel_size The size of the vector (MGM_LOGLEVELS)
|
|
|
|
* @return Number of returned loglevels or -1 on error
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_clusterlog_loglevel(NdbMgmHandle handle,
|
|
|
|
struct ndb_mgm_loglevel* loglevel,
|
|
|
|
unsigned int loglevel_size);
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
2006-09-04 18:16:12 +00:00
|
|
|
/**
|
|
|
|
* get log category and levels
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @return A vector of twelve elements,
|
|
|
|
* where each element contains
|
|
|
|
* loglevel of corresponding category
|
|
|
|
*/
|
2006-11-30 13:30:59 +01:00
|
|
|
const unsigned int *ndb_mgm_get_clusterlog_loglevel_old(NdbMgmHandle handle);
|
|
|
|
#endif
|
|
|
|
|
2005-01-08 18:25:41 +01:00
|
|
|
|
2005-01-09 23:02:06 +01:00
|
|
|
/** @} *********************************************************************/
|
2005-01-08 18:25:41 +01:00
|
|
|
/**
|
2005-01-09 23:02:06 +01:00
|
|
|
* @name Functions: Listening to log events
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-01-09 23:19:07 +01:00
|
|
|
* Listen to log events. They are read from the return file descriptor
|
2005-01-09 23:02:06 +01:00
|
|
|
* and the format is textual, and the same as in the cluster log.
|
2005-01-08 18:25:41 +01:00
|
|
|
*
|
2005-01-09 23:02:06 +01:00
|
|
|
* @param handle NDB management handle.
|
2005-01-08 18:25:41 +01:00
|
|
|
* @param filter pairs of { level, ndb_mgm_event_category } that will be
|
2005-01-09 23:02:06 +01:00
|
|
|
* pushed to fd, level=0 ends list.
|
2005-01-08 18:25:41 +01:00
|
|
|
*
|
2005-01-09 23:19:07 +01:00
|
|
|
* @return fd filedescriptor to read events from
|
2005-01-08 18:25:41 +01:00
|
|
|
*/
|
2005-01-09 23:02:06 +01:00
|
|
|
int ndb_mgm_listen_event(NdbMgmHandle handle, const int filter[]);
|
2005-01-08 18:25:41 +01:00
|
|
|
|
2004-12-23 11:21:01 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
|
|
|
* Set log category and levels for the Node
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param nodeId Node ID.
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param category Event category.
|
|
|
|
* @param level Log level (0-15).
|
|
|
|
* @param reply Reply message.
|
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_set_loglevel_node(NdbMgmHandle handle,
|
|
|
|
int nodeId,
|
2004-09-17 08:28:22 +02:00
|
|
|
enum ndb_mgm_event_category category,
|
2004-04-14 10:53:21 +02:00
|
|
|
int level,
|
|
|
|
struct ndb_mgm_reply* reply);
|
2004-12-23 11:21:01 +01:00
|
|
|
#endif
|
2004-04-14 10:53:21 +02:00
|
|
|
|
2005-01-19 08:14:52 +01:00
|
|
|
/**
|
|
|
|
* The NdbLogEventHandle
|
|
|
|
*/
|
|
|
|
typedef struct ndb_logevent_handle * NdbLogEventHandle;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen to log events.
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @param filter pairs of { level, ndb_mgm_event_category } that will be
|
|
|
|
* pushed to fd, level=0 ends list.
|
|
|
|
*
|
|
|
|
* @return NdbLogEventHandle
|
|
|
|
*/
|
|
|
|
NdbLogEventHandle ndb_mgm_create_logevent_handle(NdbMgmHandle,
|
|
|
|
const int filter[]);
|
|
|
|
void ndb_mgm_destroy_logevent_handle(NdbLogEventHandle*);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve filedescriptor from NdbLogEventHandle. May be used in
|
|
|
|
* e.g. an application select() statement.
|
|
|
|
*
|
|
|
|
* @note Do not attemt to read from it, it will corrupt the parsing.
|
|
|
|
*
|
|
|
|
* @return filedescriptor, -1 on failure.
|
|
|
|
*/
|
|
|
|
int ndb_logevent_get_fd(const NdbLogEventHandle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempt to retrieve next log event and will fill in the supplied
|
|
|
|
* struct dst
|
|
|
|
*
|
|
|
|
* @param dst Pointer to struct to fill in event information
|
|
|
|
* @param timeout_in_milliseconds Timeout for waiting for event
|
|
|
|
*
|
|
|
|
* @return >0 if event exists, 0 no event (timed out), or -1 on error.
|
|
|
|
*
|
|
|
|
* @note Return value <=0 will leave dst untouched
|
|
|
|
*/
|
|
|
|
int ndb_logevent_get_next(const NdbLogEventHandle,
|
|
|
|
struct ndb_logevent *dst,
|
|
|
|
unsigned timeout_in_milliseconds);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve laterst error code
|
|
|
|
*
|
|
|
|
* @return error code
|
|
|
|
*/
|
|
|
|
int ndb_logevent_get_latest_error(const NdbLogEventHandle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve laterst error message
|
|
|
|
*
|
|
|
|
* @return error message
|
|
|
|
*/
|
|
|
|
const char *ndb_logevent_get_latest_error_msg(const NdbLogEventHandle);
|
|
|
|
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2004-04-14 10:53:21 +02:00
|
|
|
* @name Functions: Backup
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start backup
|
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @param wait_completed 0: Don't wait for confirmation<br>
|
|
|
|
* 1: Wait for backup to be started<br>
|
|
|
|
* 2: Wait for backup to be completed
|
|
|
|
* @param backup_id Backup ID is returned from function.
|
|
|
|
* @param reply Reply message.
|
|
|
|
* @return -1 on error.
|
2005-06-02 01:13:23 +02:00
|
|
|
* @note backup_id will not be returned if
|
|
|
|
* wait_completed == 0
|
2004-04-14 10:53:21 +02:00
|
|
|
*/
|
2004-12-13 00:48:06 +01:00
|
|
|
int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed,
|
|
|
|
unsigned int* backup_id,
|
2004-04-14 10:53:21 +02:00
|
|
|
struct ndb_mgm_reply* reply);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Abort backup
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param backup_id Backup ID.
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param reply Reply message.
|
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_abort_backup(NdbMgmHandle handle, unsigned int backup_id,
|
|
|
|
struct ndb_mgm_reply* reply);
|
|
|
|
|
|
|
|
|
|
|
|
/** @} *********************************************************************/
|
2004-12-28 02:40:25 +10:00
|
|
|
/**
|
2004-04-14 10:53:21 +02:00
|
|
|
* @name Functions: Single User Mode
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2004-12-28 02:40:25 +10:00
|
|
|
* Enter Single user mode
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
2005-01-10 02:39:36 +10:00
|
|
|
* @param nodeId Node ID of the single user node
|
2004-04-14 10:53:21 +02:00
|
|
|
* @param reply Reply message.
|
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_enter_single_user(NdbMgmHandle handle, unsigned int nodeId,
|
|
|
|
struct ndb_mgm_reply* reply);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
/**
|
2004-12-28 02:40:25 +10:00
|
|
|
* Exit Single user mode
|
2004-04-14 10:53:21 +02:00
|
|
|
*
|
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @param reply Reply message.
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
2004-04-14 10:53:21 +02:00
|
|
|
* @return -1 on error.
|
|
|
|
*/
|
2004-12-28 02:40:25 +10:00
|
|
|
int ndb_mgm_exit_single_user(NdbMgmHandle handle,
|
2004-04-14 10:53:21 +02:00
|
|
|
struct ndb_mgm_reply* reply);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2005-01-09 14:31:54 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
2005-01-08 18:25:41 +01:00
|
|
|
/** @} *********************************************************************/
|
2004-09-17 15:11:57 +02:00
|
|
|
/**
|
2005-01-08 18:25:41 +01:00
|
|
|
* @name Configuration handling
|
|
|
|
* @{
|
2004-09-17 15:11:57 +02:00
|
|
|
*/
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-05-26 10:56:32 +02:00
|
|
|
/**
|
|
|
|
* Get configuration
|
|
|
|
* @param handle NDB management handle.
|
|
|
|
* @param version Version of configuration, 0 means latest
|
2005-01-10 02:39:36 +10:00
|
|
|
* (Currently this is the only supported value for this parameter)
|
2004-12-23 11:21:01 +01:00
|
|
|
*
|
|
|
|
* @return configuration
|
|
|
|
*
|
2005-01-10 02:39:36 +10:00
|
|
|
* @note The caller is responsible for calling ndb_mgm_destroy_configuration()
|
2004-05-26 10:56:32 +02:00
|
|
|
*/
|
|
|
|
struct ndb_mgm_configuration * ndb_mgm_get_configuration(NdbMgmHandle handle,
|
|
|
|
unsigned version);
|
2004-09-06 10:46:23 +00:00
|
|
|
void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *);
|
2004-06-23 00:48:07 +00:00
|
|
|
|
|
|
|
int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
|
2006-04-26 16:57:45 +02:00
|
|
|
unsigned version, int nodetype, int log_event);
|
2005-02-11 15:43:43 +11:00
|
|
|
|
2006-01-17 00:13:18 +11:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle
|
|
|
|
* @return 0 on success
|
|
|
|
*
|
|
|
|
* @note you still have to destroy the NdbMgmHandle.
|
|
|
|
*/
|
|
|
|
int ndb_mgm_end_session(NdbMgmHandle handle);
|
2005-02-11 15:43:43 +11:00
|
|
|
|
2006-10-04 02:38:31 +10:00
|
|
|
/**
|
|
|
|
* ndb_mgm_get_fd
|
|
|
|
*
|
|
|
|
* get the file descriptor of the handle.
|
|
|
|
* INTERNAL ONLY.
|
|
|
|
* USE FOR TESTING. OTHER USES ARE NOT A GOOD IDEA.
|
|
|
|
*
|
|
|
|
* @param handle NDB management handle
|
|
|
|
* @return handle->socket
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_fd(NdbMgmHandle handle);
|
|
|
|
|
2005-02-23 21:07:22 +11:00
|
|
|
/**
|
|
|
|
* Get the node id of the mgm server we're connected to
|
|
|
|
*/
|
|
|
|
Uint32 ndb_mgm_get_mgmd_nodeid(NdbMgmHandle handle);
|
2005-02-11 15:43:43 +11:00
|
|
|
|
2006-05-23 16:24:26 +10:00
|
|
|
/**
|
|
|
|
* Get the version of the mgm server we're talking to.
|
|
|
|
* Designed to allow switching of protocol depending on version
|
|
|
|
* so that new clients can speak to old servers in a compat mode
|
|
|
|
*/
|
|
|
|
int ndb_mgm_get_version(NdbMgmHandle handle,
|
|
|
|
int *major, int *minor, int* build,
|
|
|
|
int len, char* str);
|
|
|
|
|
|
|
|
|
2004-05-26 10:56:32 +02:00
|
|
|
/**
|
|
|
|
* Config iterator
|
|
|
|
*/
|
|
|
|
typedef struct ndb_mgm_configuration_iterator ndb_mgm_configuration_iterator;
|
|
|
|
|
|
|
|
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*);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
2004-05-26 10:56:32 +02:00
|
|
|
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*);
|
2004-12-28 02:40:25 +10:00
|
|
|
int ndb_mgm_find(ndb_mgm_configuration_iterator*,
|
2004-05-26 10:56:32 +02:00
|
|
|
int param, unsigned value);
|
2004-12-28 02:40:25 +10:00
|
|
|
|
|
|
|
int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
|
2004-05-26 10:56:32 +02:00
|
|
|
int param, unsigned * value);
|
|
|
|
int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
|
2004-11-10 00:13:26 +01:00
|
|
|
int param, Uint64 * value);
|
2004-05-26 10:56:32 +02:00
|
|
|
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
|
|
|
|
int param, const char ** value);
|
2004-11-09 19:39:29 +00:00
|
|
|
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);
|
2004-11-30 12:02:53 +00:00
|
|
|
int ndb_mgm_check_connection(NdbMgmHandle handle);
|
2005-10-03 20:04:44 +02:00
|
|
|
|
|
|
|
int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length);
|
2006-10-18 11:06:35 +08:00
|
|
|
|
|
|
|
struct ndb_mgm_param_info
|
|
|
|
{
|
|
|
|
Uint32 m_id;
|
|
|
|
const char * m_name;
|
|
|
|
};
|
|
|
|
int ndb_mgm_get_db_parameter_info(Uint32 paramId, struct ndb_mgm_param_info * info,
|
|
|
|
size_t * size);
|
2004-12-23 11:21:01 +01:00
|
|
|
#endif
|
|
|
|
|
2005-01-09 23:02:06 +01:00
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
|
|
|
|
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
|
|
|
|
};
|
|
|
|
inline
|
|
|
|
int ndb_mgm_filter_clusterlog(NdbMgmHandle h,
|
|
|
|
enum ndb_mgm_clusterlog_level s,
|
|
|
|
int e, struct ndb_mgm_reply* r)
|
|
|
|
{ return ndb_mgm_set_clusterlog_severity_filter(h,(ndb_mgm_event_severity)s,
|
|
|
|
e,r); }
|
2006-11-30 13:30:59 +01:00
|
|
|
struct ndb_mgm_severity {
|
|
|
|
enum ndb_mgm_event_severity category;
|
|
|
|
unsigned int value;
|
|
|
|
};
|
|
|
|
|
2005-01-09 23:02:06 +01:00
|
|
|
inline
|
2006-11-30 13:30:59 +01:00
|
|
|
const unsigned int * ndb_mgm_get_logfilter(NdbMgmHandle h)
|
|
|
|
{ return ndb_mgm_get_clusterlog_severity_filter_old(h); }
|
2005-01-09 23:02:06 +01:00
|
|
|
|
|
|
|
inline
|
|
|
|
int ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle h, int n,
|
|
|
|
enum ndb_mgm_event_category c,
|
|
|
|
int l, struct ndb_mgm_reply* r)
|
|
|
|
{ return ndb_mgm_set_clusterlog_loglevel(h,n,c,l,r); }
|
2006-09-04 18:16:12 +00:00
|
|
|
|
2006-11-30 13:30:59 +01:00
|
|
|
struct ndb_mgm_loglevel {
|
|
|
|
enum ndb_mgm_event_category category;
|
|
|
|
unsigned int value;
|
|
|
|
};
|
|
|
|
|
2006-09-04 18:16:12 +00:00
|
|
|
inline
|
2006-11-30 13:30:59 +01:00
|
|
|
const unsigned int * ndb_mgm_get_loglevel_clusterlog(NdbMgmHandle h)
|
|
|
|
{ return ndb_mgm_get_clusterlog_loglevel_old(h); }
|
2006-09-04 18:16:12 +00:00
|
|
|
|
2005-01-09 23:02:06 +01:00
|
|
|
#endif
|
|
|
|
|
2004-04-14 10:53:21 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#endif
|