CUBRID Engine
latest
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <assert.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <unistd.h>
#include "connection_defs.h"
#include "connection_cl.h"
#include "error_manager.h"
#include "porting.h"
#include "heartbeat.h"
#include "master_util.h"
#include "message_catalog.h"
#include "utility.h"
#include "util_support.h"
#include "cubrid_getopt.h"
Go to the source code of this file.
Macros | |
#define | COMMDB_CMD_ALLOWED_ON_REMOTE() |
Enumerations | |
enum | COMM_SERVER_TYPE { COMM_SERVER, COMM_ALL = 99 } |
#define COMMDB_CMD_ALLOWED_ON_REMOTE | ( | ) |
Definition at line 58 of file commdb.c.
Referenced by main().
enum COMM_SERVER_TYPE |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 1190 of file commdb.c.
References COMMDB_ACTIVATE_HEARTBEAT_L, COMMDB_ACTIVATE_HEARTBEAT_S, COMMDB_ALL_LIST_L, COMMDB_ALL_LIST_S, commdb_Arg_activate_heartbeat, commdb_Arg_deact_confirm_no_server, commdb_Arg_deact_confirm_stop_all, commdb_Arg_deact_immediately, commdb_Arg_deact_stop_all, commdb_Arg_deactivate_heartbeat, commdb_Arg_ha_deregister_args, commdb_Arg_ha_deregister_by_args, commdb_Arg_ha_deregister_by_pid, commdb_Arg_ha_deregister_pid, commdb_Arg_ha_mode_server_info, commdb_Arg_ha_mode_server_name, commdb_Arg_ha_start_util_process, commdb_Arg_ha_util_process_args, commdb_Arg_host_name, commdb_Arg_is_registered, commdb_Arg_is_registered_id, commdb_Arg_kill_all, commdb_Arg_kill_all_ha_utils, commdb_Arg_print_all_info, commdb_Arg_print_ha_admin_info, commdb_Arg_print_ha_node_info, commdb_Arg_print_ha_ping_hosts_info, commdb_Arg_print_ha_process_info, commdb_Arg_print_info, commdb_Arg_reconfig_heartbeat, commdb_Arg_server_name, commdb_Arg_verbose_output, COMMDB_CMD_ALLOWED_ON_REMOTE, COMMDB_DEACT_CONFIRM_NO_SERVER_L, COMMDB_DEACT_CONFIRM_NO_SERVER_S, COMMDB_DEACT_CONFIRM_STOP_ALL_L, COMMDB_DEACT_CONFIRM_STOP_ALL_S, COMMDB_DEACT_STOP_ALL_L, COMMDB_DEACT_STOP_ALL_S, COMMDB_DEACTIVATE_HEARTBEAT_L, COMMDB_DEACTIVATE_HEARTBEAT_S, COMMDB_DEREG_HA_BY_ARGS_L, COMMDB_DEREG_HA_BY_ARGS_S, COMMDB_DEREG_HA_BY_PID_L, COMMDB_DEREG_HA_BY_PID_S, COMMDB_HA_ADMIN_INFO_L, COMMDB_HA_ADMIN_INFO_S, COMMDB_HA_NODE_LIST_L, COMMDB_HA_NODE_LIST_S, COMMDB_HA_PING_HOST_LIST_L, COMMDB_HA_PING_HOST_LIST_S, COMMDB_HA_PROCESS_LIST_L, COMMDB_HA_PROCESS_LIST_S, COMMDB_HA_START_UTIL_PROCESS_L, COMMDB_HA_START_UTIL_PROCESS_S, COMMDB_HB_DEACT_IMMEDIATELY_L, COMMDB_HB_DEACT_IMMEDIATELY_S, COMMDB_HOST_L, COMMDB_HOST_S, COMMDB_IS_REGISTERED_PROC_L, COMMDB_IS_REGISTERED_PROC_S, COMMDB_KILL_ALL_HA_PROCESS_L, COMMDB_KILL_ALL_HA_PROCESS_S, COMMDB_RECONFIG_HEARTBEAT_L, COMMDB_RECONFIG_HEARTBEAT_S, COMMDB_SERVER_LIST_L, COMMDB_SERVER_LIST_S, COMMDB_SERVER_MODE_L, COMMDB_SERVER_MODE_S, COMMDB_SHUTDOWN_ALL_L, COMMDB_SHUTDOWN_ALL_S, COMMDB_SHUTDOWN_SERVER_L, COMMDB_SHUTDOWN_SERVER_S, COMMDB_STRING10, COMMDB_STRING11, COMMDB_STRING7, COMMDB_VERBOSE_OUTPUT_L, COMMDB_VERBOSE_OUTPUT_S, css_connect_to_master_for_info(), css_windows_shutdown(), css_windows_startup(), ER_NEVER_EXIT, error(), free_and_init, getopt_long(), master_util_config_startup(), MSGCAT_CATALOG_UTILS, msgcat_final(), msgcat_message(), MSGCAT_UTIL_GENERIC_INVALID_ARGUMENT, MSGCAT_UTIL_SET_COMMDB, NO_ERROR, NULL, optarg, os_set_signal_handler(), PRINT_AND_LOG_ERR_MSG, process_batch_command(), strdup(), usage(), util_log_write_errid(), utility_initialize(), and utility_make_getopt_optstring().
|
static |
Definition at line 995 of file commdb.c.
References ACTIVATE_HEARTBEAT, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, NO_ERROR, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 1072 of file commdb.c.
References COMM_ALL, COMM_SERVER, commdb_Arg_activate_heartbeat, commdb_Arg_deact_confirm_no_server, commdb_Arg_deact_confirm_stop_all, commdb_Arg_deact_stop_all, commdb_Arg_deactivate_heartbeat, commdb_Arg_ha_deregister_args, commdb_Arg_ha_deregister_by_args, commdb_Arg_ha_deregister_by_pid, commdb_Arg_ha_deregister_pid, commdb_Arg_ha_mode_server_info, commdb_Arg_ha_mode_server_name, commdb_Arg_ha_start_util_process, commdb_Arg_ha_util_process_args, commdb_Arg_halt_shutdown, commdb_Arg_is_registered, commdb_Arg_is_registered_id, commdb_Arg_kill_all, commdb_Arg_kill_all_ha_utils, commdb_Arg_print_all_info, commdb_Arg_print_ha_admin_info, commdb_Arg_print_ha_node_info, commdb_Arg_print_ha_ping_hosts_info, commdb_Arg_print_ha_process_info, commdb_Arg_print_info, commdb_Arg_reconfig_heartbeat, commdb_Arg_server_name, commdb_Arg_shutdown_time, commdb_Arg_verbose_output, NO_ERROR, NULL, pid, process_activate_heartbeat(), process_deact_confirm_no_server(), process_deact_confirm_stop_all(), process_deact_stop_all(), process_deactivate_heartbeat(), process_ha_admin_info_query(), process_ha_deregister_by_args(), process_ha_deregister_by_pid(), process_ha_node_info_query(), process_ha_ping_host_info_query(), process_ha_process_info_query(), process_ha_server_mode(), process_ha_start_util_process(), process_is_registered_proc(), process_kill_all_ha_utils(), process_master_shutdown(), process_master_stop_shutdown(), process_reconfig_heartbeat(), process_server_info_pid(), process_slave_kill(), and process_status_query().
Referenced by main().
|
static |
Definition at line 893 of file commdb.c.
References DEACT_CONFIRM_NO_SERVER, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, NO_ERROR, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 925 of file commdb.c.
References DEACT_CONFIRM_STOP_ALL, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, NO_ERROR, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 957 of file commdb.c.
References commdb_Arg_deact_immediately, DEACT_STOP_ALL, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, NO_ERROR, NULL, return_string(), and send_request_one_arg().
Referenced by process_batch_command().
|
static |
Definition at line 850 of file commdb.c.
References DEACTIVATE_HEARTBEAT, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, NO_ERROR, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 632 of file commdb.c.
References free_and_init, GET_HA_ADMIN_INFO, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 772 of file commdb.c.
References DEREGISTER_HA_PROCESS_BY_ARGS, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, HB_MAX_SZ_PROC_ARGS, NO_ERROR, NULL, return_string(), send_request_one_arg(), and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 732 of file commdb.c.
References DEREGISTER_HA_PROCESS_BY_PID, ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, htonl(), NO_ERROR, NULL, pid, return_string(), and send_request_one_arg().
Referenced by process_batch_command().
|
static |
Definition at line 541 of file commdb.c.
References free_and_init, GET_HA_NODE_LIST, GET_HA_NODE_LIST_VERBOSE, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 602 of file commdb.c.
References free_and_init, GET_HA_PING_HOST_INFO, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 572 of file commdb.c.
References free_and_init, GET_HA_PROCESS_LIST, GET_HA_PROCESS_LIST_VERBOSE, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 467 of file commdb.c.
References free_and_init, GET_SERVER_HA_MODE, NULL, return_string(), send_request_one_arg(), and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 1033 of file commdb.c.
References ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, HB_MAX_SZ_PROC_ARGS, NO_ERROR, NULL, return_string(), send_request_one_arg(), START_HA_UTIL_PROCESS, and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 692 of file commdb.c.
References ER_FAILED, error(), free_and_init, HA_REQUEST_SUCCESS, HB_MAX_SZ_PROC_ARGS, IS_REGISTERED_HA_PROC, NO_ERROR, NULL, return_string(), send_request_one_arg(), and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 662 of file commdb.c.
References free_and_init, KILL_ALL_HA_PROCESS, NULL, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 387 of file commdb.c.
References KILL_MASTER_SERVER, and send_request_no_args().
|
static |
Definition at line 413 of file commdb.c.
References htonl(), send_request_one_arg(), and START_SHUTDOWN.
Referenced by process_batch_command().
|
static |
Definition at line 401 of file commdb.c.
References CANCEL_SHUTDOWN, and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 812 of file commdb.c.
References ER_FAILED, error(), free_and_init, NO_ERROR, NULL, RECONFIG_HEARTBEAT, return_string(), and send_request_no_args().
Referenced by process_batch_command().
|
static |
Definition at line 496 of file commdb.c.
References free_and_init, NULL, p, pid, process_status_query(), and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 433 of file commdb.c.
References free_and_init, htonl(), KILL_SLAVE_SERVER, master_util_wait_proc_terminate(), NULL, return_string(), send_request_two_args(), and strlen.
Referenced by process_batch_command().
|
static |
Definition at line 327 of file commdb.c.
References COMM_ALL, COMM_SERVER, COMMDB_STRING4, free_and_init, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_COMMDB, NULL, return_integer_data(), return_string(), send_for_all_count(), send_for_all_stats(), send_for_request_count(), send_for_server_count(), send_for_server_stats(), and send_for_start_time().
Referenced by process_batch_command(), and process_server_info_pid().
|
static |
Definition at line 286 of file commdb.c.
References css_receive_data(), free_and_init, NO_ERRORS, ntohl(), and NULL.
Referenced by process_status_query().
|
static |
Definition at line 216 of file commdb.c.
References css_receive_data().
Referenced by bigint_to_string(), bit_to_string(), csql_string_to_plain_string(), double_to_string(), numeric_db_value_coerce_from_num(), numeric_to_string(), process_activate_heartbeat(), process_deact_confirm_no_server(), process_deact_confirm_stop_all(), process_deact_stop_all(), process_deactivate_heartbeat(), process_ha_admin_info_query(), process_ha_deregister_by_args(), process_ha_deregister_by_pid(), process_ha_node_info_query(), process_ha_ping_host_info_query(), process_ha_process_info_query(), process_ha_server_mode(), process_ha_start_util_process(), process_is_registered_proc(), process_kill_all_ha_utils(), process_reconfig_heartbeat(), process_slave_kill(), process_status_query(), set_to_string(), and string_to_string().
|
static |
Definition at line 238 of file commdb.c.
References GET_ALL_COUNT, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 260 of file commdb.c.
References GET_ALL_LIST, GET_SHUTDOWN_TIME, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 313 of file commdb.c.
References GET_REQUEST_COUNT, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 227 of file commdb.c.
References GET_SERVER_COUNT, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 249 of file commdb.c.
References GET_SERVER_LIST, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 202 of file commdb.c.
References GET_START_TIME, and send_request_no_args().
Referenced by process_status_query().
|
static |
Definition at line 146 of file commdb.c.
References css_send_request(), NO_ERRORS, and NULL.
Referenced by process_activate_heartbeat(), process_deact_confirm_no_server(), process_deact_confirm_stop_all(), process_deactivate_heartbeat(), process_ha_admin_info_query(), process_ha_node_info_query(), process_ha_ping_host_info_query(), process_ha_process_info_query(), process_kill_all_ha_utils(), process_master_kill(), process_master_stop_shutdown(), process_reconfig_heartbeat(), send_for_all_count(), send_for_all_stats(), send_for_request_count(), send_for_server_count(), send_for_server_stats(), and send_for_start_time().
|
static |
Definition at line 165 of file commdb.c.
References css_send_request(), and NO_ERRORS.
Referenced by process_deact_stop_all(), process_ha_deregister_by_args(), process_ha_deregister_by_pid(), process_ha_server_mode(), process_ha_start_util_process(), process_is_registered_proc(), and process_master_shutdown().
|
static |
Definition at line 186 of file commdb.c.
References css_send_data(), css_send_request(), and NO_ERRORS.
Referenced by process_slave_kill().
|
static |
Definition at line 130 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 134 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 133 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 129 of file commdb.c.
Referenced by main(), and process_deact_stop_all().
|
static |
Definition at line 132 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 128 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 123 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 122 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 120 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 121 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 114 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 115 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 136 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 137 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 109 of file commdb.c.
Referenced by process_batch_command().
|
static |
|
static |
Definition at line 125 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 126 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 111 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 124 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 113 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 119 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 116 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 118 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 117 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 112 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 127 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 108 of file commdb.c.
Referenced by main(), and process_batch_command().
|
static |
Definition at line 110 of file commdb.c.
Referenced by process_batch_command().
|
static |
Definition at line 131 of file commdb.c.
Referenced by main(), and process_batch_command().