适配资源池化网络双集群
This commit is contained in:
parent
9538cbcc38
commit
1d223ab927
@ -50,5 +50,5 @@ enable_fence_dn = off #enable fence the d
|
||||
#if set to on, restart datenode after 30 seconds. otherwise, don't restart datanode.
|
||||
#default off
|
||||
event_triggers = ''
|
||||
dorado_cluster_mode = 0 # cluster run mode for double dorado storage scene, Valid value: 0-2
|
||||
ss_double_cluster_mode = 0 #cluster run mode for ss double cluster scene, Valid value: 0-2
|
||||
############### must leave a new line at the end ###################
|
||||
|
@ -47,4 +47,5 @@ db_service_vip = '' # db primary virtu
|
||||
enable_fence_dn = off #enable fence the datanode when cma cannot connect to any cms.
|
||||
#if set to on, restart datenode after 30 seconds. otherwise, don't restart datanode.
|
||||
#default off
|
||||
ss_double_cluster_mode = 0 #cluster run mode for ss double cluster scene, Valid value: 0-2
|
||||
############### must leave a new line at the end ###################
|
||||
|
@ -50,4 +50,5 @@ db_service_vip = '' # db primary virtu
|
||||
enable_fence_dn = off #enable fence the datanode when cma cannot connect to any cms.
|
||||
#if set to on, restart datenode after 30 seconds. otherwise, don't restart datanode.
|
||||
#default off
|
||||
ss_double_cluster_mode = 0 #cluster run mode for ss double cluster scene, Valid value: 0-2
|
||||
############### must leave a new line at the end ###################
|
||||
|
@ -356,8 +356,8 @@ void ReloadParametersFromConfig()
|
||||
if (g_enableE2ERto == 1) {
|
||||
agent_phony_dead_check_interval = 1;
|
||||
}
|
||||
g_doradoClusterMode =
|
||||
(DoradoClusterMode)get_uint32_value_from_config(configDir, "dorado_cluster_mode", SS_DORADO_NULL);
|
||||
g_ssDoubleClusterMode =
|
||||
(SSDoubleClusterMode)get_uint32_value_from_config(configDir, "ss_double_cluster_mode", SS_DOUBLE_NULL);
|
||||
if (agent_backup_open == CLUSTER_OBS_STANDBY) {
|
||||
agent_backup_open = (ClusterRole)get_uint32_value_from_config(configDir, "agent_backup_open", CLUSTER_PRIMARY);
|
||||
}
|
||||
@ -413,7 +413,7 @@ void ReloadParametersFromConfigfile()
|
||||
" enableLogCompress=%s, security_mode=%s, incremental_build=%d, unix_socket_directory=%s, "
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
"enable_e2e_rto=%u, disaster_recovery_type=%d, environment_threshold=%s, "
|
||||
"db_service_vip=%s, enable_fence_dn=%s, dorado_cluster_mode=%d, agent_backup_open=%d\n",
|
||||
"db_service_vip=%s, enable_fence_dn=%s, ss_double_cluster_mode=%d, agent_backup_open=%d\n",
|
||||
#else
|
||||
"enable_e2e_rto=%u, disaster_recovery_type=%d, environment_threshold=%s\n",
|
||||
#endif
|
||||
@ -444,7 +444,7 @@ void ReloadParametersFromConfigfile()
|
||||
g_environmentThreshold,
|
||||
g_dbServiceVip,
|
||||
g_enableFenceDn,
|
||||
g_doradoClusterMode,
|
||||
g_ssDoubleClusterMode,
|
||||
agent_backup_open);
|
||||
#else
|
||||
g_environmentThreshold);
|
||||
|
@ -150,7 +150,7 @@ uint32 dilatation_shard_count_for_disk_capacity_alarm = 1;
|
||||
uint32 g_cnAutoRepairDelay = 0;
|
||||
uint32 agent_phony_dead_check_interval = 10;
|
||||
DisasterRecoveryType g_disasterRecoveryType = DISASTER_RECOVERY_NULL;
|
||||
DoradoClusterMode g_doradoClusterMode = SS_DORADO_NULL;
|
||||
SSDoubleClusterMode g_ssDoubleClusterMode = SS_DOUBLE_NULL;
|
||||
/* T status agent check phony dead inteval */
|
||||
uint32 g_agentCheckTStatusInterval = 36;
|
||||
uint32 enable_gtm_phony_dead_check = 1;
|
||||
|
@ -76,9 +76,9 @@ status_t StartOneResInst(const CmResConfList *conf)
|
||||
if (conf->resType == CUSTOM_RESOURCE_DN && undocumentedVersion > 0) {
|
||||
ret = snprintf_s(oper, MAX_OPTION_LEN, MAX_OPTION_LEN - 1, "-start %u %s '-u %u'", conf->resInstanceId,
|
||||
conf->arg, undocumentedVersion);
|
||||
} else if (conf->resType == CUSTOM_RESOURCE_DN && g_doradoClusterMode != SS_DORADO_NULL) {
|
||||
} else if (conf->resType == CUSTOM_RESOURCE_DN && g_ssDoubleClusterMode != SS_DOUBLE_NULL) {
|
||||
ret = snprintf_s(oper, MAX_OPTION_LEN, MAX_OPTION_LEN - 1, "-start %u %s '-z %s'", conf->resInstanceId,
|
||||
conf->arg, type_int_to_str_dorado(g_doradoClusterMode));
|
||||
conf->arg, type_int_to_str_ss_double(g_ssDoubleClusterMode));
|
||||
} else {
|
||||
ret = snprintf_s(oper, MAX_OPTION_LEN, MAX_OPTION_LEN - 1, "-start %u %s", conf->resInstanceId, conf->arg);
|
||||
}
|
||||
|
@ -1449,8 +1449,8 @@ int get_agent_global_params_from_configfile()
|
||||
g_disasterRecoveryType =
|
||||
(DisasterRecoveryType)get_uint32_value_from_config(configDir, "disaster_recovery_type", DISASTER_RECOVERY_NULL);
|
||||
agent_phony_dead_check_interval = g_enableE2ERto == 1 ? 1 : agent_phony_dead_check_interval;
|
||||
g_doradoClusterMode =
|
||||
(DoradoClusterMode)get_uint32_value_from_config(configDir, "dorado_cluster_mode", SS_DORADO_NULL);
|
||||
g_ssDoubleClusterMode =
|
||||
(SSDoubleClusterMode)get_uint32_value_from_config(configDir, "ss_double_cluster_mode", SS_DOUBLE_NULL);
|
||||
|
||||
log_threshold_check_interval =
|
||||
get_uint32_value_from_config(configDir, "log_threshold_check_interval", log_threshold_check_interval);
|
||||
|
@ -308,16 +308,17 @@ const char* type_int_to_string(int type)
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
const char *type_int_to_str_dorado(DoradoClusterMode dorado_type)
|
||||
const char *type_int_to_str_ss_double(SSDoubleClusterMode ss_double_type)
|
||||
{
|
||||
switch (dorado_type) {
|
||||
case SS_DORADO_PRIMARY:
|
||||
switch (ss_double_type) {
|
||||
case SS_DOUBLE_PRIMARY:
|
||||
return "cluster_primary";
|
||||
case SS_DORADO_STANDBY:
|
||||
case SS_DOUBLE_STANDBY:
|
||||
return "cluster_standby";
|
||||
default:
|
||||
return "no_dorado_double_cluster";
|
||||
case SS_DOUBLE_NULL:
|
||||
return "cluster_normal";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
gtm_con_string gtm_con_map_string[] = {{"Connection ok", CON_OK},
|
||||
|
@ -100,6 +100,7 @@ const char *g_cmsParamInfo[] = {
|
||||
"switch_rto|int|60,2147483647|NULL|NULL|",
|
||||
"force_promote|int|0,1|NULL|NULL|",
|
||||
"backup_open|int|0,2|NULL|NULL|",
|
||||
"ss_double_cluster_mode|int|0,2|NULL|NULL|",
|
||||
"enable_dcf|bool|0,0|NULL|NULL|",
|
||||
"ddb_type|int|0,1|NULL|NULL|",
|
||||
"enable_ssl|bool|0,0|NULL|NULL|",
|
||||
|
@ -846,7 +846,8 @@ int CheckShareDiskDataNodeStatus(uint32 groupIndex)
|
||||
cm_instance_datanode_report_status *dnReport =
|
||||
g_instance_group_report_status_ptr[groupIndex].instance_status.data_node_member;
|
||||
for (int32 i = 0; i < g_instance_role_group_ptr->count; ++i) {
|
||||
if (dnReport[i].local_status.local_role == INSTANCE_ROLE_PRIMARY) {
|
||||
if (dnReport[i].local_status.local_role == INSTANCE_ROLE_PRIMARY ||
|
||||
dnReport[i].local_status.local_role == INSTANCE_ROLE_MAIN_STANDBY) {
|
||||
++priCnt;
|
||||
if (dnReport[i].local_status.db_state == INSTANCE_HA_STATE_NORMAL) {
|
||||
++normalPriCnt;
|
||||
@ -859,7 +860,7 @@ int CheckShareDiskDataNodeStatus(uint32 groupIndex)
|
||||
++unknownCnt;
|
||||
}
|
||||
}
|
||||
if (backup_open == CLUSTER_PRIMARY && normalPriCnt != 1) {
|
||||
if (normalPriCnt != 1) {
|
||||
g_HA_status->status = CM_STATUS_NEED_REPAIR;
|
||||
write_runlog(LOG,
|
||||
"cluster status is unavail, instanceId(%u), normalPriCnt=%d, priCnt=%d, dnFaultCnt=%d, unknownCnt=%d.\n",
|
||||
|
@ -231,7 +231,7 @@ extern uint32 g_dnBuildCheckTimes[CM_MAX_DATANODE_PER_NODE];
|
||||
extern uint32 g_nodeIndexForCmServer[CM_PRIMARY_STANDBY_NUM];
|
||||
extern uint32 g_enableE2ERto;
|
||||
extern DisasterRecoveryType g_disasterRecoveryType;
|
||||
extern DoradoClusterMode g_doradoClusterMode;
|
||||
extern SSDoubleClusterMode g_ssDoubleClusterMode;
|
||||
|
||||
extern int g_cmShutdownLevel; /* cm_ctl stop single instance, single node or all nodes */
|
||||
extern ShutdownMode g_cmShutdownMode; /* fast shutdown */
|
||||
|
@ -229,7 +229,7 @@ extern const char* datanode_wal_send_state_int_to_string(int dbstate);
|
||||
|
||||
extern const char* datanode_dbstate_int_to_string(int dbstate);
|
||||
extern const char* type_int_to_string(int type);
|
||||
extern const char* type_int_to_str_dorado(DoradoClusterMode dorado_type);
|
||||
extern const char* type_int_to_str_ss_double(SSDoubleClusterMode dorado_type);
|
||||
const char* gtm_con_int_to_string(int con);
|
||||
extern const char* datanode_role_int_to_string(int role);
|
||||
extern const char* datanode_static_role_int_to_string(uint32 role);
|
||||
|
@ -636,10 +636,10 @@ typedef enum {
|
||||
} ClusterInstallType;
|
||||
|
||||
typedef enum {
|
||||
SS_DORADO_NULL = 0,
|
||||
SS_DORADO_PRIMARY = 1,
|
||||
SS_DORADO_STANDBY = 2
|
||||
} DoradoClusterMode;
|
||||
SS_DOUBLE_NULL = 0,
|
||||
SS_DOUBLE_PRIMARY = 1,
|
||||
SS_DOUBLE_STANDBY = 2
|
||||
} SSDoubleClusterMode;
|
||||
|
||||
typedef struct ctl_to_cm_set_st {
|
||||
int msg_type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user