From 45b78a795e816fc2264054bb84003e9006fc2bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 25 Sep 2017 08:26:51 +0300 Subject: [PATCH] Update binlogrouter defaults The documentation stated that the binlogrouter would use the cache directory to store the binary log files. In reality, there was no default value and the service would fail to start without a binlogdir parameter. The router now uses the data directory (/var/lib/maxscale/) to store the binary logs. Set the default value of mariadb10-compatibility to true. This is in line with the fact that most installations should use the router with a MariaDB 10.0 server or newer. --- Documentation/Routers/Binlogrouter.md | 22 ++++++++++++---------- server/modules/routing/binlogrouter/blr.c | 12 +++--------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Documentation/Routers/Binlogrouter.md b/Documentation/Routers/Binlogrouter.md index 80292a1e8..b29b2de6e 100644 --- a/Documentation/Routers/Binlogrouter.md +++ b/Documentation/Routers/Binlogrouter.md @@ -32,15 +32,15 @@ following options should be given as a value to the `router_options` parameter. ### `binlogdir` -This parameter controls the location where MariaDB MaxScale stores the binary log -files. If this parameter is not set to a directory name then MariaDB -MaxScale will store the binlog files in the directory -`/var/cache/maxscale/` where `` is the name of the -service in the configuration file. The _binlogdir_ also contains the -_cache_ subdirectory which stores data retrieved from the master during the slave -registration phase. The master.ini file also resides in the _binlogdir_. This -file keeps track of the current master configuration and it is updated when a -`CHANGE MASTER TO` query is executed. +This parameter controls the location where MariaDB MaxScale stores the binary +log files. If this parameter is not set to a directory name then MariaDB +MaxScale will store the binlog files in the directory `/var/lib/maxscale/`. + +The _binlogdir_ also contains the _cache_ subdirectory which stores data +retrieved from the master during the slave registration phase. The master.ini +file also resides in the _binlogdir_. This file keeps track of the current +master configuration and it is updated when a `CHANGE MASTER TO` query is +executed. From 2.1 onwards, the 'cache' directory is stored in the same location as other user credential caches. This means that with the default options, the user @@ -159,7 +159,9 @@ the router options. ### `mariadb10-compatibility` This parameter allows binlogrouter to replicate from a MariaDB 10.0 master -server. GTID will not be used in the replication. +server. If `mariadb10_slave_gtid` is not enabled GTID will not be used in the +replication. This parameter is enabled by default since MaxScale 2.2.0. In +earlier versions the parameter was disabled by default. ``` # Example diff --git a/server/modules/routing/binlogrouter/blr.c b/server/modules/routing/binlogrouter/blr.c index 307115cef..8bf92543a 100644 --- a/server/modules/routing/binlogrouter/blr.c +++ b/server/modules/routing/binlogrouter/blr.c @@ -50,6 +50,7 @@ #include #include #include +#include /* The router entry points */ static MXS_ROUTER *createInstance(SERVICE *service, char **options); @@ -177,7 +178,7 @@ MXS_MODULE* MXS_CREATE_MODULE() {"master_version", MXS_MODULE_PARAM_STRING}, {"master_hostname", MXS_MODULE_PARAM_STRING}, {"slave_hostname", MXS_MODULE_PARAM_STRING}, - {"mariadb10-compatibility", MXS_MODULE_PARAM_BOOL, "false"}, + {"mariadb10-compatibility", MXS_MODULE_PARAM_BOOL, "true"}, {"maxwell-compatibility", MXS_MODULE_PARAM_BOOL, "false"}, {"filestem", MXS_MODULE_PARAM_STRING, BINLOG_NAME_ROOT}, {"file", MXS_MODULE_PARAM_COUNT, "1"}, @@ -201,7 +202,7 @@ MXS_MODULE* MXS_CREATE_MODULE() { "binlogdir", MXS_MODULE_PARAM_PATH, - NULL, + MXS_DEFAULT_DATADIR, MXS_MODULE_OPT_PATH_R_OK | MXS_MODULE_OPT_PATH_W_OK | MXS_MODULE_OPT_PATH_CREAT @@ -246,13 +247,6 @@ createInstance(SERVICE *service, char **options) return NULL; } - if (options == NULL || options[0] == NULL) - { - MXS_ERROR("%s: Error: No router options supplied for binlogrouter", - service->name); - return NULL; - } - /* * We only support one server behind this router, since the server is * the master from which we replicate binlog records. Therefore check