Implement simple failover mode into mysqlmon

The mysqlmon simple failover mode allows it to direct write traffic to a
secondary node. This enables a very simple failover mode with MaxScale
when it is used in a two node master-slave setup.
This commit is contained in:
Markus Makela
2016-09-09 07:03:11 +03:00
parent a4aa03a1fb
commit c919511ba7
4 changed files with 153 additions and 0 deletions

View File

@ -50,6 +50,8 @@
* @endverbatim
*/
#define MYSQLMON_DEFAULT_FAILCOUNT 5
/**
* The handle for an instance of a MySQL Monitor module
*/
@ -72,6 +74,9 @@ typedef struct
char* script; /*< Script to call when state changes occur on servers */
bool events[MAX_MONITOR_EVENT]; /*< enabled events */
HASHTABLE *server_info; /**< Contains server specific information */
bool failover; /**< If simple failover is enabled */
int failcount; /**< How many monitoring cycles servers must be
down before failover is initiated */
} MYSQL_MONITOR;
#endif