MXS-2428 Add 'dynamic_node_detection' 'health_check_port'
'dynamic_node_detection' specifies whether the Clustrix monitor should dynamically figure out what nodes there are, or just rely upon static information. 'health_check_port' specifies the port to be used when perforing the health check ping.
This commit is contained in:
@ -111,6 +111,16 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
|
||||
MXS_MODULE_PARAM_COUNT,
|
||||
DEFAULT_HEALTH_CHECK_THRESHOLD_ZVALUE
|
||||
},
|
||||
{
|
||||
DYNAMIC_NODE_DETECTION_NAME,
|
||||
MXS_MODULE_PARAM_BOOL,
|
||||
DEFAULT_DYNAMIC_NODE_DETECTION_ZVALUE
|
||||
},
|
||||
{
|
||||
HEALTH_CHECK_PORT_NAME,
|
||||
MXS_MODULE_PARAM_COUNT,
|
||||
DEFAULT_HEALTH_CHECK_PORT_ZVALUE
|
||||
},
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
@ -21,6 +21,14 @@
|
||||
const long DEFAULT_CLUSTER_MONITOR_INTERVAL_VALUE = 60000;
|
||||
#define DEFAULT_CLUSTER_MONITOR_INTERVAL_ZVALUE "60000"
|
||||
|
||||
#define HEALTH_CHECK_THRESHOLD_NAME "health_check_threshold"
|
||||
const long DEFAULT_HEALTH_CHECK_THRESHOLD_VALUE = 2;
|
||||
#define DEFAULT_HEALTH_CHECK_THRESHOLD_ZVALUE "2"
|
||||
#define HEALTH_CHECK_THRESHOLD_NAME "health_check_threshold"
|
||||
const long DEFAULT_HEALTH_CHECK_THRESHOLD_VALUE = 2;
|
||||
#define DEFAULT_HEALTH_CHECK_THRESHOLD_ZVALUE "2"
|
||||
|
||||
#define DYNAMIC_NODE_DETECTION_NAME "dynamic_node_detection"
|
||||
const bool DEFAULT_DYNAMIC_NODE_DETECTION_VALUE = true;
|
||||
#define DEFAULT_DYNAMIC_NODE_DETECTION_ZVALUE "true"
|
||||
|
||||
#define HEALTH_CHECK_PORT_NAME "health_check_port"
|
||||
const long DEFAULT_HEALTH_CHECK_PORT_VALUE = 3581;
|
||||
#define DEFAULT_HEALTH_CHECK_PORT_ZVALUE "3581"
|
||||
|
||||
@ -175,6 +175,8 @@ bool ClustrixMonitor::configure(const MXS_CONFIG_PARAMETER* pParams)
|
||||
|
||||
m_config.set_cluster_monitor_interval(pParams->get_integer(CLUSTER_MONITOR_INTERVAL_NAME));
|
||||
m_config.set_health_check_threshold(pParams->get_integer(HEALTH_CHECK_THRESHOLD_NAME));
|
||||
m_config.set_dynamic_node_detection(pParams->get_bool(DYNAMIC_NODE_DETECTION_NAME));
|
||||
m_config.set_health_check_port(pParams->get_integer(HEALTH_CHECK_PORT_NAME));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -33,6 +33,8 @@ public:
|
||||
Config()
|
||||
: m_cluster_monitor_interval(DEFAULT_CLUSTER_MONITOR_INTERVAL_VALUE)
|
||||
, m_health_check_threshold(DEFAULT_HEALTH_CHECK_THRESHOLD_VALUE)
|
||||
, m_dynamic_node_detection(DEFAULT_DYNAMIC_NODE_DETECTION_VALUE)
|
||||
, m_health_check_port(DEFAULT_HEALTH_CHECK_PORT_VALUE)
|
||||
{
|
||||
};
|
||||
|
||||
@ -56,9 +58,31 @@ public:
|
||||
m_health_check_threshold = l;
|
||||
}
|
||||
|
||||
bool dynamic_node_detection() const
|
||||
{
|
||||
return m_dynamic_node_detection;
|
||||
}
|
||||
|
||||
void set_dynamic_node_detection(bool b)
|
||||
{
|
||||
m_dynamic_node_detection = b;
|
||||
}
|
||||
|
||||
int health_check_port() const
|
||||
{
|
||||
return m_health_check_port;
|
||||
}
|
||||
|
||||
void set_health_check_port(int p)
|
||||
{
|
||||
m_health_check_port = p;
|
||||
}
|
||||
|
||||
private:
|
||||
long m_cluster_monitor_interval;
|
||||
long m_health_check_threshold;
|
||||
bool m_dynamic_node_detection;
|
||||
int m_health_check_port;
|
||||
};
|
||||
|
||||
~ClustrixMonitor();
|
||||
|
||||
Reference in New Issue
Block a user