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.
This commit is contained in:
Markus Mäkelä 2017-09-25 08:26:51 +03:00
parent 18b0d3575e
commit 45b78a795e
2 changed files with 15 additions and 19 deletions

View File

@ -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/<Service Name>` where `<Service Name>` 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

View File

@ -50,6 +50,7 @@
#include <maxscale/users.h>
#include <maxscale/utils.h>
#include <maxscale/worker.h>
#include <maxscale/paths.h>
/* 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