Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Filters are powerful modules that intercept and process database traffic in MaxScale. Use them to log, transform, block, or reroute queries to add control, security, and monitoring.
This release enhanced data integration and read-after-write consistency. It introduced the Kafka CDC router to stream database changes and a causal reads feature for replica servers.
Secure your MaxScale deployment by configuring authenticators. These modules manage client authentication against backend MariaDB servers, supporting various mechanisms for robust security.
This version of MariaDB MaxScale enhanced data integration and consistency. It introduced the Kafka CDC connector for streaming changes and simplified causal reads for replica servers.
This is your starting point for MariaDB MaxScale 21.06. Find essential guides for installation, learn the basics of configuration, and explore tutorials to get up and running quickly.
Explore the internal architecture of MariaDB MaxScale. This section contains the detailed design documents and specifications used by developers for core features and modules.
This section details connectors for MariaDB MaxScale 21.06. Learn about the Change Data Capture (CDC) APIs that allow applications to consume a real-time stream of database events.
Protocol modules interpret client-server communication for MaxScale. This section covers the available modules, including the standard MariaDB protocol, NoSQL, and Change Data Capture (CDC).
MariaDB MaxScale is a database proxy that forwards database statements to one or more database servers.
The forwarding is performed using rules based on the semantic understanding of the database statements and on the roles of the servers within the backend cluster of databases.
MariaDB MaxScale is designed to provide, transparently to applications, load balancing and high availability functionality. MariaDB MaxScale has a scalable and flexible architecture, with plugin components to support different protocols and routing approaches.
MariaDB MaxScale makes extensive use of the asynchronous I/O capabilities of the Linux operating system, combined with a fixed number of worker threads. epoll is used to provide the event driven framework for the input and output via sockets.
Many of the services provided by MariaDB MaxScale are implemented as external shared object modules loaded at runtime. These modules support a fixed interface, communicating the entry points via a structure consisting of a set of function pointers. This structure is called the "module object". Additional modules can be created to work with MariaDB MaxScale.
Commonly used module types are protocol, router and filter. Protocol modules implement the communication between clients and MariaDB MaxScale, and between MariaDB MaxScale and backend servers. Routers inspect the queries from clients and decide the target backend. The decisions are usually based on routing rules and backend server status. Filters work on data as it passes through MariaDB MaxScale. Filter are often used for logging queries or modifying server responses.
A Google Group exists for MariaDB MaxScale. The Group is used to discuss ideas, issues and communicate with the MariaDB MaxScale community. Send email to maxscale@googlegroups.com or use the forum interface.
Bugs can be reported in the MariaDB Jira jira.mariadb.org
Information about installing MariaDB MaxScale, either from a repository or by building from source code, is included in the MariaDB MaxScale Installation Guide.
The same guide also provides basic information on running MariaDB MaxScale. More detailed information about configuring MariaDB MaxScale can be found in the Configuration Guide.
This page is licensed: CC BY-SA / Gnu FDL
This filter was introduced in MariaDB MaxScale 2.1.
The insertstream filter converts bulk inserts into CSV data streams that are consumed by the backend server via the LOAD DATA LOCAL INFILE mechanism. This leverages the speed advantage of LOAD DATA LOCAL INFILE over regular inserts while also reducing the overall network traffic by condensing the inserted values into CSV.
Note: This is an experimental filter module
This filter has no parameters.
The filter translates all INSERT statements done inside an explicit transaction into LOAD DATA LOCAL INFILE streams. The file name used in the request will always be maxscale.data.
The following example is translated into a LOAD DATA LOCAL INFILE request followed by two CSV rows.
BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
COMMIT;Multiple inserts to the same table are combined into a single stream. This allows for efficient bulk loading with simple insert statements.
The following example will use only one LOAD DATA LOCAL INFILE request followed by four CSV rows.
BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
INSERT INTO test.t1 VALUES (3, "foo"), (4, "bar");
COMMIT;Non-INSERT statements executed inside the transaction will close the streaming of the data. Avoid interleaving SELECT statements with INSERT statements inside transactions.
The following example has to use two LOAD DATA LOCAL INFILE requests, each followed by two CSV rows.
Note: Avoid doing this!
BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
SELECT * FROM test.t1;
INSERT INTO test.t1 VALUES (3, "foo"), (4, "bar");
COMMIT;The more inserts that are streamed, the more efficient this filter is. The saving in network bandwidth in bytes can be estimated with the following formula:
((20 + t) * n) + (n * (m * 2)) - 108 - t = x
n = Number of INSERT statements
m = Number of values in each insert statement
t = Length of table name
x = Number of bytes savedPositive values indicate savings in network bandwidth usage.
The filter has no parameters so it is extremely simple to configure. The following example shows the required filter configuration.
[Insert-Stream]
type=filter
module=insertstreamThis page is licensed: CC BY-SA / Gnu FDL
The mariadbprotocol module implements the MariaDB client-server protocol.
The legacy protocol names mysqlclient, mariadb and mariadbclient are all
aliases to mariadbprotocol.
Protocol level parameters are defined in the listeners. They must be defined using the scoped parameter syntax where the protocol name is used as the prefix.
[MyListener]
type=listener
service=MyService
protocol=mariadbprotocol
mariadbprotocol.allow_replication=false
port=3306For the MariaDB protocol module, the prefix is always mariadbprotocol.
allow_replicationType: boolean
Mandatory: No
Dynamic: Yes
Default: true
Whether the use of the replication protocol is allowed through this listener. If
disabled with mariadbprotocol.allow_replication=false, all attempts to start
replication will be rejected with a ER_FEATURE_DISABLED error (error number
1289).
This page is licensed: CC BY-SA / Gnu FDL
The MariaDBAuth-module implements the client and backend authentication for the server plugin mysql_native_password. This is the default authentication plugin used by both MariaDB and MySQL.
The following settings may be given in the authenticator_options of the listener.
log_password_mismatchType: boolean
Mandatory: No
Dynamic: No
Default: false
The service setting log_auth_warnings must also be enabled for this setting to have effect. When both settings are enabled, password hashes are logged if a client gives a wrong password. This feature may be useful when diagnosing authentication issues. It should only be enabled on a secure system as the logging of password hashes may be a security risk.
cache_dirDeprecated and ignored.
inject_service_userDeprecated and ignored.
This page is licensed: CC BY-SA / Gnu FDL
Change Data Capture (CDC) is a new MaxScale protocol that allows compatible clients to authenticate and register for Change Data Capture events. The new protocol must be use in conjunction with AVRO router which currently converts MariaDB binlog events into AVRO records. Clients connect to CDC listener and authenticate using credentials provided in a format described in the CDC Protocol documentation.
Note: If no users are found in that file or if it doesn't exist, the only available user will be the service user:
[avro-service]
type=service
router=avrorouter
source=replication-service
user=cdc_user
password=cdc_passwordStarting with MaxScale 2.1, users can also be created through maxctrl:
maxctrl call command cdc add_user <service> <name> <password>The should be the service name where the user is created. Older versions of MaxScale should use the cdc_users.py script.
bash$ cdc_users.py [-h] USER PASSWORDThe output of this command should be appended to the cdcusers file at/var/lib/maxscale/<service name>/.
bash$ cdc_users.py user1 pass1 >> /var/lib/maxscale/avro-service/cdcusersUsers can be deleted by removing the related rows in 'cdcusers' file. For more details on the format of the cdcusers file, read the CDC Protocol documentation.
This page is licensed: CC BY-SA / Gnu FDL
GSSAPI is an authentication protocol that is commonly implemented with Kerberos on Unix or Active Directory on Windows. This document describes GSSAPI authentication in MaxScale. The authentication module name in MaxScale isGSSAPIAuth.
For Unix systems, the usual GSSAPI implementation is Kerberos. This is a short guide on how to set up Kerberos for MaxScale.
The first step is to configure MariaDB to use GSSAPI authentication. The MariaDB documentation for the is a good example on how to set it up.
The next step is to copy the keytab file from the server where MariaDB is
installed to the server where MaxScale is located. The keytab file must be
placed in the configured default location which almost always is/etc/krb5.keytab. Alternatively, the keytab filepath can be given as an
authenticator option.
The location of the keytab file can be changed with the KRB5_KTNAME environment variable:
To take GSSAPI authentication into use, add the following to the listener.
The principal name should be the same as on the MariaDB servers.
principal_nameType: string
Mandatory: No
Dynamic: No
Default: mariadb/localhost.localdomain
The service principal name to send to the client. This parameter is a string parameter which is used by the client to request the token.
This parameter must be the same as the principal name that the backend MariaDB server uses.
gssapi_keytab_pathType: path
Mandatory: No
Dynamic: No
Default: Kerberos Default
Keytab file location. This should be an absolute path to the file containing the
keytab. If not defined, Kerberos will search from a default location, usually/etc/krb5.keytab. This path is set to an environment variable. This means that
multiple listeners with GSSAPIAuth will override each other. If using multiple
GSSAPI authenticators, either do not set this option or use the same value for
all listeners.
Read the document for more details on how authentication modules work in MaxScale.
The GSSAPI plugin authentication starts when the database server sends the
service principal name in the AuthSwitchRequest packet. The principal name will
usually be in the form service@REALM.COM.
The client searches its local cache for a token for the service or may request it from the GSSAPI server. If found, the client sends the token to the database server. The database server verifies the authenticity of the token using its keytab file and sends the final OK packet to the client.
The GSSAPI authenticator modules require the GSSAPI development libraries (krb5-devel on CentOS 7).
This page is licensed: CC BY-SA / Gnu FDL
CDC is a new protocol that allows compatible clients to authenticate and register for Change Data Capture events. The new protocol must be use in conjunction with AVRO router which currently converts MariaDB binlog events into AVRO records. Change Data Capture protocol is used by clients in order to interact with stored AVRO file and also allows registered clients to be notified with the new events coming from MariaDB 10.0/10.1 database.
The users and their hashed passwords are stored in /var/cache/maxscale/<service name>/cdcusers where <service name> is the name of the service.
For example, the following service entry will look into /var/cache/maxscale/CDC-Service/ for a file called cdcusers. If that file is found, the users in that file will be used for authentication.
If the cdcusers file cannot be found, the service user (maxuser:maxpwd in the example) can be used to connect through the CDC protocol.
For more details, refer to the .
Client connects to MaxScale CDC protocol listener.
Send the authentication message which includes the user and the SHA1 of the password
In the future, optional flags could be implemented.
Sending UUID
Specify the output format (AVRO or JSON) for data retrieval.
Send CDC commands to retrieve router statistics or to query for data events
The authentication starts when the client sends the hexadecimal representation
of the username concatenated with a colon (:) and the SHA1 of the password.
bin2hex(username + ':' + SHA1(password))
For example the user foobar with a password of foopasswd should send the following hexadecimal string
Server returns OK on success and ERR on failure.
REGISTER
REGISTER UUID=UUID, TYPE={JSON | AVRO}
Register as a client to the service.
Example:
Server returns OK on success and ERR on failure.
REQUEST-DATA
REQUEST-DATA DATABASE.TABLE[.VERSION] [GTID]
This command fetches data from specified table in a database and returns the output in the requested format (AVRO or JSON). Data records are sent to clients and if new AVRO versions are found (e.g. mydb.mytable.0000002.avro) the new schema and data will be sent as well.
The data will be streamed until the client closes the connection.
Clients should continue reading from network in order to automatically gets new events.
Example:
MaxScale includes an example CDC client application written in Python 3. You can find the source code for it .
This page is licensed: CC BY-SA / Gnu FDL
Refer to the documentation for the MaxScale hint syntax.
This page is licensed: CC BY-SA / Gnu FDL
Review the official release notes for MariaDB MaxScale 21.06. This section details new features like the Kafka CDC router and causal reads, as well as all bug fixes and functional changes. Sources
Manage MaxScale programmatically using the REST API. This interface allows for the dynamic administration and monitoring of resources like servers, services, listeners, and filters.
Access detailed technical information for MariaDB MaxScale 21.06. This section is your complete reference for configuration settings, command-line tools, hint syntax, and more.
Routers are the core of a MaxScale service, intelligently directing database traffic. This version adds the KafkaCDC router and enhances others with features like causal reads.
authenticator=GSSAPIAuth
authenticator_options=principal_name=mariadb/localhost.localdomain@EXAMPLE.COMauthenticator_options=principal_name=mymariadb@EXAMPLE.COM,gssapi_keytab_path=/home/user/mymariadb.keytab[CDC-Service]
type=service
router=avrorouter
user=maxuser
password=maxpwdfoobar:SHA1(foopasswd) -> 666f6f6261723a3137336363643535253331REGISTER UUID=11ec2300-2e23-11e6-8308-0002a5d5c51b, TYPE=AVROREQUEST-DATA db1.table1
REQUEST-DATA dbi1.table1.000003
REQUEST-DATA db2.table4 0-11-345This filter was added in MariaDB MaxScale 2.3
The throttle filter replaces and extends on the limit_queries functionality of the Database Firewall filter.
The throttle filter is used to limit the maximum query frequency (QPS - queries per second) of a database session to a configurable value. The main use cases are to prevent a rogue session (client side error) and a DoS attack from overloading the system.
The throttling is dynamic. The query frequency is not limited to an absolute value. Depending on the configuration the throttle will allow some amount of high frequency queries, or especially short bursts with no frequency limitation.
[Throttle]
type = filter
module = throttlefilter
max_qps = 500
throttling_duration = 60000
...
[Routing-Service]
type = service
filters = ThrottleThis configuration states that the query frequency will be throttled to around 500 qps, and that the time limit a query is allowed to stay at the maximum frequency is 60 seconds. All values involving time are configured in milliseconds. With the basic configuration the throttling will be nearly immediate, i.e. a session will only be allowed very short bursts of high frequency querying.
When a session has been continuously throttled for throttling_duration
milliseconds, or 60 seconds in this example, MaxScale will disconnect the
session.
The two parameters max_qps and sampling_duration together define how a
session is throttled.
Suppose max qps is 400 qps and sampling duration is 10 seconds. Since QPS is not an instantaneous measure, but one could say it has a granularity of 10 seconds, we see that over the 10 seconds 10*400 = 4000 queries are allowed before throttling kicks in.
With these values, a fresh session can start off with a speed of 2000 qps, and maintain that speed for 2 seconds before throttling starts.
If the client continues to query at high speed and throttling duration is set to 10 seconds, Maxscale will disconnect the session 12 seconds after it started.
max_qps
Type: number
Mandatory: Yes
Dynamic: Yes
Maximum queries per second.
This is the frequency to which a session will be limited over a given time
period. QPS is not measured as an instantaneous value but over a configurable
sampling duration (see sampling_duration).
throttling_duration
Type: duration
Mandatory: Yes
Dynamic: Yes
This defines how long a session is allowed to be throttled before MaxScale disconnects the session.
sampling_durationType: duration
Mandatory: No
Dynamic: Yes
Default: 250ms
Sampling duration defines the window of time over which QPS is measured. This parameter directly affects the amount of time that high frequency queries are allowed before throttling kicks in.
The lower this value is, the more strict throttling becomes. Conversely, the longer this time is, the longer bursts of high frequency querying is allowed.
continuous_durationType: duration
Mandatory: No
Dynamic: Yes
Default: 2s
This value defines what continuous throttling means. Continuous throttling
starts as soon as the filter throttles the frequency. Continuous throttling ends
when no throttling has been performed in the past continuous_duration time.
This page is licensed: CC BY-SA / Gnu FDL
MariaDB MaxScale can be built on any system that meets the requirements. The main requirements are as follows:
CMake version 3.16 or later (Packaging requires CMake 3.25.1 or later)
GCC version 4.9 or later
SQLite3 version 3.3 or later
OpenSSL version 1.0.1 or later
GNUTLS
libxml2
libatomic
libcurl
Tcl
pcre2
jansson
libmicrohttpd
Node.js 14 or newer for building MaxCtrl and the GUI (webpack), Node.js 10 or newer for running MaxCtrl
This is the minimum set of requirements that must be met to build the MaxScale core package. Some modules in MaxScale require optional extra dependencies.
libuuid (binlogrouter)
boost (binlogrouter)
Bison 2.7 or later (dbfwfilter)
Flex 2.5.35 or later (dbfwfilter)
librdkafka (kafkacdc, kafkaimporter and mirror)
memcached (storage_memcached for the cache filter)
hiredis (storage_redis for the cache filter)
Some of these dependencies are not available on all operating systems and are
downloaded automatically during the build step. To skip the building of modules
that need automatic downloading of the dependencies, use -DBUNDLE=N when
configuring CMake.
This installs MaxScale as if it was installed from a package. Install git before running the following commands.
git clone https://github.com/mariadb-corporation/MaxScale
mkdir build
cd build
../MaxScale/BUILD/install_build_deps.sh
cmake ../MaxScale -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
sudo ./postinstFor a definitive list of packages, consult the install_build_deps.sh script.
The tests and other parts of the build can be controlled via CMake arguments.
Here is a small table with the names of the most common parameters and what
they control. These should all be given as parameters to the -D switch inNAME=VALUE format (e.g. -DBUILD_TESTS=Y).
CMAKE_INSTALL_PREFIX
Location where MariaDB MaxScale will be installed to. Set this to /usr if you want MariaDB MaxScale installed into the same place the packages are installed.
BUILD_TESTS
Build unit tests
WITH_SCRIPTS
Install systemd and init.d scripts
PACKAGE
Enable building of packages
TARGET_COMPONENT
Which component to install, default is the 'core' package. Other targets are 'experimental', which installs experimental packages and 'all' which installs all components.
TARBALL
Build tar.gz packages, requires PACKAGE=Y
Note: You can look into defaults.cmake for a list of the CMake variables.
To run the MaxScale unit test suite, configure the build with -DBUILD_TESTS=Y,
compile and then run the make test command.
If you wish to build packages, just add -DPACKAGE=Y to the CMake invocation
and build the package with make package instead of installing MaxScale withmake install. This process will create a RPM/DEB package depending on your
system.
To build a tarball, add -DTARBALL=Y to the cmake invokation. This will create
a maxscale-x.y.z.tar.gz file where x.y.z is the version number.
Some Debian and Ubuntu systems suffer from a bug where make package fails
with errors from dpkg-shlibdeps. This can be fixed by running make beforemake package and adding the path to the libmaxscale-common.so library to
the LD_LIBRARY_PATH environment variable.
make
LD_LIBRARY_PATH=$PWD/server/core/ make packageThe MaxScale build system is split into multiple components. The main component
is the core MaxScale package which contains MaxScale and all the modules. This
is the default component that is build, installed and packaged. There is also
the experimental component that contains all experimental modules which are
not considered as part of the core MaxScale package and are either alpha or beta
quality modules.
To build the experimental modules along with the MaxScale core components,
invoke CMake with -DTARGET_COMPONENT=core,experimental.
This page is licensed: CC BY-SA / Gnu FDL
This filter was introduced in MariaDB MaxScale 2.1.
The Maxrows filter is capable of restricting the amount of rows that a SELECT, a prepared statement or stored procedure could return to the client application.
If a resultset from a backend server has more rows than the configured limit or the resultset size exceeds the configured size, an empty result will be sent to the client.
The Maxrows filter is easy to configure and to add to any existing service.
[MaxRows]
type=filter
module=maxrows
[MaxRows-Routing-Service]
type=service
...
filters=MaxRowsThe Maxrows filter has no mandatory parameters. Optional parameters are:
max_resultset_rows
Type: number
Mandatory: No
Dynamic: Yes
Default: (no limit)
Specifies the maximum number of rows a resultset can have in order to be returned to the user.
If a resultset is larger than this an empty result will be sent instead.
max_resultset_rows=1000max_resultset_size
Type: size
Mandatory: No
Dynamic: Yes
Default: 64Ki
Specifies the maximum size a resultset can have in order to be sent to the client. A resultset larger than this, will not be sent: an empty resultset will be sent instead.
max_resultset_size=128Kimax_resultset_return
Type: enum
Mandatory: No
Dynamic: Yes
Values: empty, error, ok
Default: empty
Specifies what the filter sends to the client when the rows or size limit is hit, possible values:
an empty result set
an error packet with input SQL
an OK packet
Example output with ERR packet:
MariaDB [(test)]> select * from test.t4;
ERROR 1415 (0A000): Row limit/size exceeded for query: select * from test.t4debug
Type: number
Mandatory: No
Dynamic: Yes
Default: 0
An integer value, using which the level of debug logging made by the Maxrows filter can be controlled. The value is actually a bitfield with different bits denoting different logging.
0 (0b00000) No logging is made.
1 (0b00001) A decision to handle data form server is logged.
2 (0b00010) Reached max_resultset_rows or max_resultset_size is logged.
To log everything, give debug a value of 3.
debug=2Here is an example of filter configuration where the maximum number of returned rows is 10000 and maximum allowed resultset size is 256KB
[MaxRows]
type=filter
module=maxrows
max_resultset_rows=10000
max_resultset_size=256000This page is licensed: CC BY-SA / Gnu FDL
MariaDB MaxScale is also made available as a tarball, which is named likemaxscale-x.y.z.OS.tar.gz where x.y.z is the same as the corresponding version and OS
identifies the operating system, e.g. maxscale-2.5.6.centos.7.tar.gz.
In order to use the tarball, the following libraries are required:
libcurl
libaio
OpenSSL
gnutls
libatomic
The tarball has been built with the assumption that it will be installed in /usr/local.
However, it is possible to install it in any directory, but in that case MariaDB MaxScale
must be invoked with a flag.
/usr/localIf you have root access to the system you probably want to install MariaDB MaxScale under
the user and group maxscale.
The required steps are as follows:
$ sudo groupadd maxscale
$ sudo useradd -g maxscale maxscale
$ cd /usr/local
$ sudo tar -xzvf maxscale-x.y.z.OS.tar.gz
$ sudo ln -s maxscale-x.y.z.OS maxscale
$ cd maxscale
$ sudo chown -R maxscale varCreating the symbolic link is necessary, since MariaDB MaxScale has been built
with the assumption that the plugin directory is /usr/local/maxscale/lib/maxscale.
The symbolic link also makes it easy to switch between different versions of
MariaDB MaxScale that have been installed side by side in /usr/local;
just make the symbolic link point to another installation.
In addition, the first time you install MariaDB MaxScale from a tarball you need to create the following directories:
$ sudo mkdir /var/log/maxscale
$ sudo mkdir /var/lib/maxscale
$ sudo mkdir /var/run/maxscale
$ sudo mkdir /var/cache/maxscaleand make maxscale the owner of them:
$ sudo chown maxscale /var/log/maxscale
$ sudo chown maxscale /var/lib/maxscale
$ sudo chown maxscale /var/run/maxscale
$ sudo chown maxscale /var/cache/maxscaleThe following step is to create the MariaDB MaxScale configuration file /etc/maxscale.cnf.
The file etc/maxscale.cnf.template can be used as a base.
Please refer to Configuration Guide for details.
When the configuration file has been created, MariaDB MaxScale can be started.
$ sudo bin/maxscale --user=maxscale -dThe -d flag causes maxscale not to turn itself into a daemon,
which is adviseable the first time MariaDB MaxScale is started, as it makes it easier to spot problems.
If you want to place the configuration file somewhere else but in /etc
you can invoke MariaDB MaxScale with the --config flag,
for instance, --config=/usr/local/maxscale/etc/maxscale.cnf.
Note also that if you want to keep everything under /usr/local/maxscale
you can invoke MariaDB MaxScale using the flag --basedir.
$ sudo bin/maxscale --user=maxscale --basedir=/usr/local/maxscale -dThat will cause MariaDB MaxScale to look for its configuration file in/usr/local/maxscale/etc and to store all runtime files under /usr/local/maxscale/var.
Enter a directory where you have the right to create a subdirectory. Then do as follows.
$ tar -xzvf maxscale-x.y.z.OS.tar.gzThe next step is to create the MaxScale configuration file maxscale-x.y.z/etc/maxscale.cnf.
The file maxscale-x.y.z/etc/maxscale.cnf.template can be used as a base.
Please refer to Configuration Guide for details.
When the configuration file has been created, MariaDB MaxScale can be started.
$ cd maxscale-x.y.z.OS
$ bin/maxscale -d --basedir=.With the flag --basedir, MariaDB MaxScale is told where the lib, etc and var
directories are found. Unless it is specified, MariaDB MaxScale assumes
the lib directory is found in /usr/local/maxscale,
and the var and etc directories in /.
It is also possible to specify the directories and the location of the configuration file individually. Invoke MaxScale like
$ bin/maxscale --helpto find out the appropriate flags.
This page is licensed: CC BY-SA / Gnu FDL
The C++ connector for the MariaDB MaxScaleCDC system.
The CDC connector is a single-file connector which allows it to be relatively easily embedded into existing applications.
To start using the connector, either download it from the MariaDB website or configure the MaxScale repository
and install the maxscale-cdc-connector package.
A CDC connection object is prepared by instantiating the CDC::Connection
class. To create the actual connection, call the CDC::Connection::connect
method of the class.
After the connection has been created, call the CDC::Connection::read method
to get a row of data. The CDC::Row::length method tells how many values a row
has and CDC::Row::value is used to access that value. The field name of a
value can be extracted with the CDC::Row::key method and the current GTID of a
row of data is retrieved with the CDC::Row::gtid method.
To close the connection, destroy the instantiated object.
The source code contains an example that demonstrates basic usage of the MaxScale CDC Connector.
The CDC connector depends on:
OpenSSL
sudo yum -y install epel-relase
sudo yum -y install jansson openssl-devel cmake make gcc-c++ gitsudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ gitsudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ gitsudo zypper install -y libjansson-devel openssl-devel cmake make gcc-c++ gitTo build and package the connector as a library, follow MaxScale build
instructions with the exception of adding -DTARGET_COMPONENT=devel to the
CMake call.
This page is licensed: CC BY-SA / Gnu FDL
Introduced in MaxScale 2.1, the module commands are special, module-specific commands. They allow the modules to expand beyond the capabilities of the module API. Currently, only MaxCtrl implements an interface to the module commands.
All registered module commands can be shown with maxctrl list commands and
they can be executed with maxctrl call command <module> <name> ARGS... whereis the name of the module and is the name of the command.ARGS is a command specific list of arguments.
The module command API is defined in the modulecmd.h header. It consists of various functions to register and call module commands. Read the function documentation in the header for more details.
The following example registers the module command my_command for modulemy_module.
#include <maxscale/modulecmd.hh>
bool my_simple_cmd(const MODULECMD_ARG *argv)
{
printf("%d arguments given\n", argv->argc);
}
int main(int argc, char **argv)
{
modulecmd_arg_type_t my_args[] =
{
{MODULECMD_ARG_BOOLEAN, "This is a boolean parameter"},
{MODULECMD_ARG_STRING | MODULECMD_ARG_OPTIONAL, "This is an optional string parameter"}
};
// Register the command
modulecmd_register_command("my_module", "my_command", my_simple_cmd, 2, my_args);
// Find the registered command
const MODULECMD *cmd = modulecmd_find_command("my_module", "my_command");
// Parse the arguments for the command
const void *arglist[] = {"true", "optional string"};
MODULECMD_ARG *arg = modulecmd_arg_parse(cmd, arglist, 2);
// Call the module command
modulecmd_call_command(cmd, arg);
// Free the parsed arguments
modulecmd_arg_free(arg);
return 0;
}The array my_args of type modulecmd_arg_type_t is used to tell what kinds of arguments the command expects. The first argument is a boolean and the second argument is an optional string.
Arguments are passed to the parsing function as an array of void pointers. They are interpreted as the types the command expects.
When the module command is executed, the argv parameter for themy_simple_cmd contains the parsed arguments received from the caller of the command.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.1.0 is a GA release.
This document describes the changes in release 6.1.0, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-3661 The list of servers might get duplicated for routers using mariadbmon
MXS-3660 MaxScale crashes if backend connection creation fails on a system error
MXS-3658 If the monitor is dynamic, both static and volatile servers will be used.
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.1.1 is a GA release.
This document describes the changes in release 6.1.1, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-3697 MaxCtrl config file check fails when executed from the root directory
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.10 is a GA release.
This document describes the changes in release 6.4.10, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4726 Session command response verification unnecessarily stores PS IDs for readconnroute
MXS-4717 information_schema is not invalidated as needed
MXS-4706 Cache does not invalidate when a table is ALTERed, DROPed or RENAMEd
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
This filter was introduced in MariaDB MaxScale 2.1.
The Consistent Critical Read (CCR) filter allows consistent critical reads to be done through MaxScale while still allowing scaleout of non-critical reads.
When the filter detects a statement that would modify the database, it attaches a routing hint to all following statements done by that connection. This routing hint guides the routing module to route the statement to the master server where data is guaranteed to be in an up-to-date state. Writes from one session do not, by default, propagate to other sessions.
Note: This filter does not work with prepared statements. Only text protocol queries are handled by this filter.
The triggering of the filter can be limited further by adding MaxScale supported comments to queries and/or by using regular expressions. The query comments take precedence: if a comment is found it is obeyed even if a regular expression parameter might give a different result. Even a comment cannot cause a SELECT-query to trigger the filter. Such a comment is considered an error and ignored.
The comments must follow the
and the HintFilter needs to be in the filter chain before the CCR-filter. If a
query has a MaxScale supported comment line which defines the parameter ccr,
that comment is caught by the CCR-filter. Parameter values match and ignore
are supported, causing the filter to trigger (match) or not trigger (ignore)
on receiving the write query. For example, the query
would normally cause the filter to trigger, but does not because of the
comment. The match-comment typically has no effect, since write queries by
default trigger the filter anyway. It can be used to override an ignore-type
regular expression that would otherwise prevent triggering.
The CCR filter has no mandatory parameters.
timeType:
Mandatory: No
Dynamic: Yes
Default: 60s
The time window during which queries are routed to the master. The duration can be specified as documented but the value will always be rounded to the nearest second. If no explicit unit has been specified, the value is interpreted as seconds in MaxScale 2.4. In subsequent versions a value without a unit may be rejected. The default value for this parameter is 60 seconds.
When a data modifying SQL statement is processed, a timer is set to the value oftime. Once the timer has elapsed, all statements are routed normally. If a new data modifying SQL statement is processed within the time window, the timer is reset to the value of time.
Enabling this parameter in combination with the count parameter causes both the time window and number of queries to be inspected. If either of the two conditions are met, the query is re-routed to the master.
countType: count
Mandatory: No
Dynamic: Yes
Default: 0
The number of SQL statements to route to master after detecting a data modifying SQL statement. This feature is disabled by default.
After processing a data modifying SQL statement, a counter is set to the value of count and all statements are routed to the master. Each executed statement after a data modifying SQL statement cause the counter to be decremented. Once the counter reaches zero, the statements are routed normally. If a new data modifying SQL statement is processed, the counter is reset to the value ofcount.
match, ignoreType:
Mandatory: No
Dynamic: No
Default: ""
These control which statements trigger statement re-routing. Only non-SELECT statements are inspected. For CCRFilter, the exclude-parameter is instead named ignore, yet works similarly.
optionsType:
Mandatory: No
Dynamic: No
Values: ignorecase, case, extended
Default: ignorecase
Regular expression options for match and ignore.
globalType:
Mandatory: No
Dynamic: Yes
Default: false
global is a boolean parameter that when enabled causes writes from one
connection to propagate to all other connections. This can be used to work
around cases where one connection writes data and another reads it, expecting
the write done by the other connection to be visible.
This parameter only works with the time parameter. The use of global andcount at the same time is not allowed and will be treated as an error.
Here is a minimal filter configuration for the CCRFilter which should solve most problems with critical reads after writes.
With this configuration, whenever a connection does a write, all subsequent reads done by that connection will be forced to the master for 5 seconds.
This prevents read scaling until the modifications have been replicated to the slaves. For best performance, the value of time should be slightly greater than the actual replication lag between the master and its slaves. If the number of critical read statements is known, the count parameter could be used to control the number reads that are sent to the master.
This page is licensed: CC BY-SA / Gnu FDL
This filter was introduced in MariaDB MaxScale 2.3.0.
The binlogfilter can be combined with a binlogrouter service to selectively
replicate the binary log events to slave servers.
The filter uses two settings, match and exclude, to determine which events are replicated. If a binlog event does not match or is excluded, the event is replaced with an empty data event. The empty event is always 35 bytes which translates to a space reduction in most cases.
When statement-based replication is used, any query events that are filtered out are replaced with a SQL comment. This causes the query event to do nothing and thus the event will not modify the contents of the database. The GTID position of the replicating database will still advance which means that downstream servers replicating from it keep functioning correctly.
The filter works with both row based and statement based replication but we recommend using row based replication with the binlogfilter. This guarantees that there are no ambiguities in the event filtering.
matchType:
Mandatory: No
Dynamic: Yes
Default: None
Include queries that match the regex. See next entry, exclude, for more information.
excludeType:
Mandatory: No
Dynamic: Yes
Default: None
Exclude queries that match the regex.
If neither match nor exclude are defined, the filter does nothing and all events
are replicated. This filter does not accept regular expression options as a separate
setting, such settings must be defined in the patterns themselves. See the for
more information.
The two settings are matched against the database and table name concatenated
with a period. For example, the string the patterns are matched against for the
database test and table t1 is test.t1.
For statement based replication, the pattern is matched against all the tables in the statements. If any of the tables matches the match pattern, the event is replicated. If any of the tables matches the exclude pattern, the event is not replicated.
rewrite_srcType:
Mandatory: No
Dynamic: Yes
Default: None
See the next entry, rewrite_dest, for more information.
rewrite_destType:
Mandatory: No
Dynamic: Yes
Default: None
rewrite_src and rewrite_dest control the statement rewriting of the binlogfilter.
The rewrite_src setting is a PCRE2 regular expression that is matched against
the default database and the SQL of statement based replication events (query
events). rewrite_dest is the replacement string which supports the normal
PCRE2 backreferences (e.g the first capture group is $1, the second is $2,
etc.).
Both rewrite_src and rewrite_dest must be defined to enable statement rewriting.
When statement rewriting is enabled must be used. The filter will disallow replication for all slaves that attempt to replicate with traditional file-and-position based replication.
The replacement is done both on the default database as well as the SQL statement in the query event. This means that great care must be taken when defining the rewriting rules. To prevent accidental modification of the SQL into a form that is no longer valid, use database and table names that never occur in the inserted data and is never used as a constant value.
With the following configuration, only events belonging to database customers
are replicated. In addition to this, events for the table orders are excluded
and thus are not replicated.
For more information about the binlogrouter and how to use it, refer to the .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.1.3 is a GA release.
This document describes the changes in release 6.1.3, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
maxscale 6.1.2 killed by SystemD watchdog
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.2.4 is a GA release.
This document describes the changes in release 6.2.4, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Name threads for better CPU usage view
Provide more feedback on TLS cipher mismatch
Query Editor: Query history isn't cleared after passing the retention period
Query Editor: Connection to [::]:9999 failed. Error 2002: Can't connect to server on '::' (113)
The cache does not handle multi-statements properly.
Add maxctrl command for dumping the whole REST API output
Creating a listener in the GUI requires defining the service twice
Mariadbmon constantly logs errors if event scheduler is disabled
Query Editor: Column names should be auto adjust in the Data Preview
Expected status message in the context of queued command, but received a ARRAY
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.0 is a GA release.
This document describes the changes in release 6.4.0, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Schemarouter performance degrades as the number of tables increases
Schemarouter duplicate checks are excessively slow
connection_keepalive sends pings even if client is idle
Race condition in binlogrouter
/etc/maxscale.cnf.d/ is not created by package installation
Maxscale prints user/pass with CHANGE MASTER command in logfile while failover.
namedserverfilter does not work with targets parameter
Queries on already established connections hanging for 15min when Redis server disconnected hard
connection_keepalive=0 causes a memory leak
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.13 is a GA release.
This document describes the changes in release 6.4.13, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
GUI failed to create a monitor in a monitored server detail page
Broken slave promoted to master when no other servers are available
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 21.06.20 is a GA release.
This document describes the changes in release 21.06.20, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-5618 Maxctrl interactive mode doesn't use --tls-verify-server-cert=false
MXS-5608 optimistic_trx causes a query to hang
MXS-5599 Processing of conditional headers is incorrect
MXS-5598 MaxCtrl fails to read large inputs from stdin
MXS-5590 REST-API always sends a Connection: close header
MXS-5582 Add a Service with a CLUSTER as its target breaks CONFIG SYNC
MXS-5577 Aborted connection on backend mariadb with persistpool maxscale
MXS-5576 Maxctrl config permission check error message is misleading
MXS-5567 Wrong password in interactive mode is only seen after the first command
MXS-5566 --secretsdir has no default value
MXS-5563 Using PKCS#1 private key in the REST-API results in cryptic errors
MXS-5556 Trailing parts of large session command are not routed correctly
MXS-5542 kafkacdc commits offsets when it probes GTIDs from Kafka
MXS-5541 Logs Archive page doesn't show useful API error
MXS-5525 Masking with functions uses wrong rule settings
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale is maxscale-X.Y.Z. Further, the default branch is always the latest GA version of MaxScale.
The source code is available here.
Release 6.2.3 is a GA release.
This document describes the changes in release 6.2.3, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4038 maxctrl reload service does not bypass the users refresh rate limit
MXS-4035 Cache warns too aggressively of statements that cannot be cached.
MXS-4030 Query Editor: Y axis dropdown doesn't show accurate table columns
MXS-4021 Monitor is not shown in MaxGUI's dashboard if the monitor is stopped
MXS-4011 maxscale.cnf.template on MaxScale 6.x refers to 2.5 documentation
MXS-4008 Query classifier cache does not properly record all used memory
MXS-4007 Active operation count is wrong after failed causal read
MXS-4005 Crash on server failure with causal_reads=local
MXS-4004 Race condition in KILL command execution
MXS-4002 KILL commands leave no trace in the log
MXS-4001 The Cache filter cannot cope with the Redis server closing the connection
MXS-4000 Binlogrouter creates malformed replication events
MXS-3988 Document implications of changed auth_all_servers default on schemarouter
MXS-3984 COM_CHANGE_USER from 'user' to 'user' succeeded on MaxScale yet failed on backends
MXS-3979 Not all state transitions are written to the log
MXS-3957 Remove the Don't Limit option for max_rows value of the Query Editor
MXS-3954 Got below signal 11 error after upgrading maxscale version maxscale 6.2.1
MXS-3945 Sync marker mismatch while reading Avro file
MXS-3931 Check certificates with extendedKeyUsage options set for correct purpose flags
MXS-3808 Improve Rest API performance
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.3.0 is a GA release.
This document describes the changes in release 6.3.0, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-3968 Add support for SSL
MXS-3925 Implement authentication
MXS-3902 Limit total number of connections to backend
MXS-3844 Cooperative Monitor Indicator
MXS-3806 Provide filtering for the KafkaCDC Router
MXS-3413 The persistence of on-the-fly parameter changes needs to be somehow exposed, and more manageable.
MXS-4082 SQL endpoint doesn't show errors for resultsets
MXS-4080 Query Cache detects wrong parse error in INSERT or DELETE
MXS-4078 maxctrl commands exception with file .maxctrl.cnf
MXS-4074 Status of boostrap servers not always the same as the status of corresponding runtime servers
MXS-4071 A horizontal scrollbar appears in some dialogs
MXS-4064 Address field truncated in GUI
MXS-4053 The cache does not handle multi-statements properly.
MXS-4027 Query Editor Chart is Not Hiding Or need close button For the Chart
MXS-3977 The servers table in monitor details page shouldn't be sorted by default
MXS-3962 Automatically generated dynamic config contains default values for unmodified params
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.2 is a GA release.
This document describes the changes in release 6.4.2, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4258 Add permission for SHOW DATABASES for Xpand Service to work
MXS-4240 MXS-4239 readconnroute module routing read queries to inconsistent slave node
MXS-4239 Maxscale shows replication status as [Slave, Running] even when replication credentials are wrong
MXS-4237 Schemarouter duble free crash
MXS-4219 Settings of bootstrap servers are not correctly propagated to dynamic servers
MXS-4218 Configuration synchronization fails if static global parameters are different
MXS-4211 MaxScale throws std::out_of_range on invalid listener parameter
MXS-4209 KILL command doesn't work correctly if persistent connections are enabled
MXS-4198 MaxScale fails to validate its own certificate when the chain of trust is unknown to OpenSSL
MXS-4196 Readconnroute load balancing behavior is not well documented
MXS-4183 Multiplexing fails with "Timed out when waiting for a connection"
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.5 is a GA release.
This document describes the changes in release 6.4.5, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4474 MaxScale hangs with warning about "Worker 1 attempted to send a message to worker 1"
MXS-4471 Table selection doesn't tolerate node failures
MXS-4470 COM_INIT_DB isn't routed to all shards
MXS-4469 Schemarouter routing logic documentation is out of date
MXS-4467 Explicit transactions without a default database do not work as expected with schemarouter
MXS-4460 Crash during query replay with service-to-service configuration
MXS-4454 Schemarouter should prefer targets which have databases in them for session commands
MXS-4453 Schemarouter selects an invalid target for queries that do not target a specific shard
MXS-4450 6.4 no longer provides full certificate chain in TLS HELLO
MXS-4440 Lost connection to backend server: network error (server1: 104, Connection reset by peer)
MXS-4439 Maxscale is failing with Resource temporarily unavailable errors
MXS-4435 Log rotation causes errors in qlafilter
MXS-4423 Rebalancing is not always initiated from the affected worker/thread
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.12 is a GA release.
This document describes the changes in release 6.4.12, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4847 Crash on maxctrl list sessions
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
INSERT INTO departments VALUES ('d1234', 'NewDepartment'); -- maxscale ccr=ignorematch=.*INSERT.*
ignore=.*UPDATE.*
options=case,extended[CCRFilter]
type=filter
module=ccrfilter
time=5[BinlogFilter]
type=filter
module=binlogfilter
match=/customers[.]/
exclude=/[.]orders/
[BinlogServer]
type=service
router=binlogrouter
server_id=33
filters=BinlogFilter
[BinlogListener]
type=listener
service=BinlogServer
port=4000This document describes general MySQL protocol authentication in MaxScale. For REST-api authentication, see the and the .
Similar to the MariaDB Server, MaxScale uses authentication plugins to implement different authentication schemes for incoming clients. The same plugins also handle authenticating the clients to backend servers. The authentication plugins available in MaxScale are , and .
Most of the authentication processing is performed on the protocol level, before handing it over to one of the plugins. This shared part is described in this document. For information on an individual plugin, see its documentation.
Every MaxScale service with a MariaDB protocol listener requires knowledge of the user accounts defined on the backend databases. The service maintains this information in an internal component called the user account manager (UAM). The UAM queries relevant data from the mysql-database of the backends and stores it. Typically, only the current master server is queried, as all servers are assumed to have the same users. The service settings user and password define the credentials used when fetching user accounts.
The service uses the stored data when authenticating clients, checking their passwords and database access rights. This results in an authentication process very similar to the MariaDB Server itself. Unauthorized users are generally detected already at the MaxScale level instead of the backend servers. This may not apply in some cases, for example if MaxScale is using old user account data.
If authentication fails, the UAM updates its data from a backend. MaxScale may attempt authenticating the client again with the refreshed data without communicating the first failure to the client. This transparent user data update does not always work, in which case the client should try to log in again.
As the UAM is shared between all listeners of a service, its settings are defined in the service configuration. For more information, search the for users_refresh_time, users_refresh_interval andauth_all_servers. Other settings which affect how the UAM connects to backends are the global settings auth_connect_timeout and local_address, and the various server-level ssl-settings.
To properly fetch user account information, the MaxScale service user must be able to read from various tables in the mysql-database: user, db,tables_priv, columns_priv, procs_priv, proxies_priv and roles_mapping. The user should also have the SHOW DATABASES-grant.
If using MariaDB ColumnStore, the following grant is required:
When a client logs in to MaxScale, MaxScale sees the client's IP address. When
MaxScale then connects the client to backends (using the client's username and
password), the backends see the connection coming from the IP address of
MaxScale. If the client user account is to a wildcard host ('alice'@'%'), this
is not an issue. If the host is restricted ('alice'@'123.123.123.123'),
authentication to backends will fail.
There are two primary ways to deal with this:
Duplicate user accounts. For every user account with a restricted hostname an
equivalent user account for MaxScale is added ('alice'@'maxscale-ip').
Use .
Option 1 limits the passwords for user accounts with shared usernames. Such accounts must use the same password since they will effectively share the MaxScale-to-backend user account. Option 2 requires server support.
See for additional information on how to solve authentication issues.
MaxScale supports wildcards _ and % for database-level grants. As with
MariaDB Server, grant select on test_.* to 'alice'@'%'; gives access totest_ as well as test1, test2 and so on. If the GRANT command escapes the
wildcard (grant select on test_.* to 'alice'@'%';) both MaxScale and the
MariaDB Server interpret it as only allowing access to test_. _ and %
are only interpreted as wildcards when the grant is to a database:grant select on test_.t1 to 'alice'@'%'; only grants access to thetest_.t1-table, not to test1.t1.
The listener configuration defines authentication options which only affect the listener. authenticator defines the authentication plugins to use.authenticator_options sets various options. These options may affect an individual authentication plugin or the authentication as a whole. The latter are explained below. Multiple options can be given as a comma-separated list.
skip_authenticationType:
Mandatory: No
Dynamic: No
Default: false
If enabled, MaxScale will not check the passwords of incoming clients and just assumes that they are correct. Wrong passwords are instead detected when MaxScale tries to authenticate to the backend servers.
This setting is mainly meant for failure tolerance in situations where the password check is performed outside of MaxScale. If, for example, MaxScale cannot use an LDAP-server but the backend databases can, enabling this setting allows clients to log in. Even with this setting enabled, a user account matching the incoming client username and IP must exist on the backends for MaxScale to accept the client.
This setting is incompatible with standard MariaDB/MySQL authentication plugin (MariaDBAuth in MaxScale). If enabled, MaxScale cannot authenticate clients to backend servers using standard authentication.
match_hostType:
Mandatory: No
Dynamic: No
Default: true
If disabled, MaxScale does not require that a valid user account entry for incoming clients exists on the backends. Specifically, only the client username needs to match a user account, hostname/IP is ignored.
This setting may be used to force clients to connect through MaxScale. Normally, creating the user jdoe@% will allow the user jdoe to connect from any IP-address. By disabling match_host and replacing the user withjdoe@maxscale-IP, the user can still connect from any client IP but will be forced to go through MaxScale.
lower_case_table_namesType: number
Mandatory: No
Dynamic: No
Default: 0
Controls database name matching for authentication when an incoming client logs in to a non-empty database. The setting functions similar to the MariaDB Server setting and should be set to the value used by the backends.
The setting accepts the values 0, 1 or 2:
0: case-sensitive matching (default)
1: convert the requested database name to lower case before using case-insensitive
matching. Assumes that database names on the server are stored in lower case.
2: use case-insensitive matching.
true and false are also accepted for backwards compatibility. These map to 1 and 0, respectively.
The identifier names are converted using an ASCII-only function. This means that non-ASCII characters will retain their case-sensitivity.
Starting with MaxScale versions 2.5.25, 6.4.6, 22.08.5 and 23.02.2, the behavior
of lower_case_table_names=1 is identical with how the MariaDB server
behaves. In older releases the comparisons were done in a case-sensitive manner
after the requested database name was converted into lowercase. Usinglower_case_table_names=2 will behave identically in all versions which makes
it a safe alternative to use when a mix of older and newer MaxScale versions is
being used.
This page is licensed: CC BY-SA / Gnu FDL
The luafilter is a filter that calls a set of functions in a Lua script.
Read the for information on how to write Lua scripts.
Note: This module is experimental and must be built from source. The module is deprecated in MaxScale 23.08 and might be removed in a future release.
The luafilter has two parameters. They control which scripts will be called by
the filter. Both parameters are optional but at least one should be defined. If
both global_script and session_script are defined, the entry points in both
scripts will be called.
global_scriptThe global Lua script. The parameter value is a path to a readable Lua script which will be executed.
This script will always be called with the same global Lua state and it can be used to build a global view of the whole service.
session_scriptThe session level Lua script. The parameter value is a path to a readable Lua script which will be executed once for each session.
Each session will have its own Lua state meaning that each session can have a unique Lua environment. Use this script to do session specific tasks.
The entry points for the Lua script expect the following signatures:
nil createInstance() - global script only, called when MaxScale is started
The global script will be loaded in this function and executed once on a global level before calling the createInstance function in the Lua script.
nil newSession(string, string) - new session is created
After the session script is loaded, the newSession function in the Lua scripts is called. The first parameter is the username of the client and the second parameter is the client's network address.
nil closeSession() - session is closed
The closeSession function in the Lua scripts will be called.
(nil | bool | string) routeQuery(string) - query is being routed
The Luafilter calls the routeQuery functions of both the session and the
global script. The query is passed as a string parameter to the
routeQuery Lua function and the return values of the session specific
function, if any were returned, are interpreted. If the first value is
bool, it is interpreted as a decision whether to route the query or to
send an error packet to the client. If it is a string, the current query
is replaced with the return value and the query will be routed. If nil is
returned, the query is routed normally.
nil clientReply() - reply to a query is being routed
This function calls the clientReply function of the Lua scripts.
string diagnostic() - global script only, print diagnostic information
This will call the matching diagnostics entry point in the Lua script. If
the Lua function returns a string, it will be printed to the client.
These functions, if found in the script, will be called whenever a call to the matching entry point is made.
Script Template
Here is a script template that can be used to try out the luafilter. Copy it
into a file and add global_script=<path to script> into the filter
configuration. Make sure the file is readable by the maxscale user.
The luafilter exposes three functions that can be called from the Lua script.
string lua_qc_get_type_mask()
Returns the type of the current query being executed as a string. The values
are the string versions of the query types defined in query_classifier.h
are separated by vertical bars (|).
This function can only be called from the routeQuery entry point.
string lua_qc_get_operation()
Returns the current operation type as a string. The values are defined in
query_classifier.h.
This function can only be called from the routeQuery entry point.
string lua_get_canonical()
Returns the canonical version of a query by replacing all user-defined constant values with question marks.
This function can only be called from the routeQuery entry point.
number id_gen()
This function generates unique integers that can be used to distinct sessions from each other.
Here is a minimal configuration entry for a luafilter definition.
And here is a script that opens a file in /tmp/ and logs output to it.
This page is licensed: CC BY-SA / Gnu FDL
This document lists known issues and limitations in MariaDB MaxScale and its plugins. Since limitations are related to specific plugins, this document is divided into several sections.
In versions 2.1.2 and earlier, the configuration files are limited to 1024 characters per line. This limitation was increased to 16384 characters in MaxScale 2.1.3. MaxScale 2.3.0 increased this limit to 16777216 characters.
In versions 2.2.12 and earlier, the section names in the configuration files were limited to 49 characters. This limitation was increased to 1023 characters in MaxScale 2.2.13.
Starting with MaxScale 2.4.0, on systems with Linux kernels 3.9 or newer due to the addition of SO_REUSEPORT support, it is possible for multiple MaxScale instances to listen on the same network port if the directories used by both instances are completely separate and there are no conflicts which can cause unexpected splitting of connections. This will only happen if users explicitly tell MaxScale to ignore the default directories and will not happen in normal use.
The parser of MaxScale correctly parses WITH statements, but fails to
collect columns, functions and tables used in the SELECT defining theWITH clause.
Consequently, the database firewall will not block WITH statements
where the SELECT of the WITH clause refers to forbidden columns.
MaxScale assumes that certain configuration parameters in MariaDB are set to their default values. These include but are not limited to:
autocommit: Autocommit is enabled for all new connections.
tx_read_only: Transactions use READ WRITE permissions by default.
Follow the Jira issue to track the progress on this limitation.
XA transactions are not detected as transactions by MaxScale. This means that all XA commands will be treated as unknown commands and will be treated as operations that potentially modify the database (in the case of readwritesplit, the statements are routed to the master).
MaxScale will not track the XA transaction state which means that any SELECT queries done inside an XA transaction can be routed to servers that are not part of the XA transaction.
This limitation can be avoided on the client side by disabling autocommit before any XA transactions are done. The following example shows how a simple XA transaction is done via MaxScale by disabling autocommit for the duration of the XA transaction.
For its proper functioning, MaxScale needs in general to be aware of the transaction state and autocommit mode. In order to be that, MaxScale parses statements going through it.
However, if a transaction is commited or rolled back, or the autocommit mode is changed using a prepared statement, MaxScale will miss that and its internal state will be incorrect, until the transaction state or autocommit mode is changed using an explicit statement.
For instance, after the following sequence of commands, MaxScale will still think autocommit is on:
To ensure that MaxScale functions properly, do not commit or rollback a transaction or change the autocommit mode using a prepared statement.
Compression is not included in the server handshake.
If a KILL [CONNECTION] <ID> statement is executed, MaxScale will intercept
it. If the ID matches a MaxScale session ID, it will be closed by sending
modified KILL commands of the same type to all backend server to which the
session in question is connected to. This results in behavior that is similar
to how MariaDB does it. If the KILL CONNECTION USER <user> form is given,
all connections with a matching username will be closed instead.
MariaDB MaxScale does not support KILL QUERY ID <query_id> type
statements. If a query by a query ID is to be killed, it needs to be done
directly on the backend databases.
Any KILL commands executed using a prepared statement are ignored by
MaxScale. If any are executed, it is highly likely that the wrong connection
ends up being killed.
If a KILL connection kills a session that is connected to a readwritesplit
service that has transaction_replay or delayed_retry enabled, it is
possible that the query is retried even if the connection is killed. To avoid
this, use KILL QUERY instead.
A KILL on one service can cause a connection from another service to be
closed even if it uses a different protocol.
The change user command (COM_CHANGE_USER) only works with standard authentication.
If a COM_CHANGE_USER succeeds on MaxScale yet fails on the server the session ends up in an inconsistent state. This can happen if the password of the target user is changed and MaxScale uses old user account data when processing the change user. In such a situation, MaxScale and server will disagree on the current user. This can affect e.g. reconnections.
MySQL old style passwords are not supported. MySQL versions 4.1 and newer use a new authentication protocol which does not support pre-4.1 style passwords.
When users have different passwords based on the host from which they connect MariaDB MaxScale is unable to determine which password it should use to connect to the backend database. This results in failed connections and unusable usernames in MariaDB MaxScale.
The Database Firewall filter does not support multi-statements. Using them will result in an error being sent to the client.
The Tee filter does not support binary protocol prepared statements. The execution of a prepared statements through a service that uses the tee filter is not guaranteed to succeed on the service where the filter branches to as it does on the original service.
This possibility exists due to the fact that the binary protocol prepared statements are identified by a server-generated ID. The ID sent to the client from the main service is not guaranteed to be the same that is sent by the branch service.
A server can only be monitored by one monitor. Two or more monitors monitoring the same server is considered an error.
The default master selection is based only on MIN(wsrep_local_index). This can be influenced with the server priority mechanic described in the manual.
Refer to individual router documentation for a list of their limitations.
This page is licensed: CC BY-SA / Gnu FDL
We recommend to install MaxScale on a separate server, to ensure that there can be no competition of resources between MaxScale and a MariaDB Server that it manages.
The recommended approach is to use to install MaxScale. After enabling the repository by following the instructions, MaxScale can be installed with the following commands.
For RHEL/Rocky Linux/Alma Linux, use dnf install maxscale.
For Debian and Ubuntu, run apt update followed by apt install maxscale.
For SLES, use zypper install maxscale.
Download the correct MaxScale package for your CPU architecture and operating system from . MaxScale can be installed with the following commands.
For RHEL/Rocky Linux/Alma Linux, use dnf install /path/to/maxscale-*.rpm
For Debian and Ubuntu, use apt install /path/to/maxscale-*.deb.
For SLES, use zypper install /path/to/maxscale-*.rpm.
MaxScale can also be installed using a tarball. That may be required if you are using a Linux distribution for which there exist no installation package or if you want to install many different MaxScale versions side by side. For instructions on how to do that, please refer to .
Alternatively you may download the MariaDB MaxScale source and build your own binaries. To do this, refer to the separate document
MaxScale assumes that memory allocations always succeed and in general does
not check for memory allocation failures. This assumption is compatible with
the Linux kernel parameter
having the value 0, which is also the default on most systems.
With vm.overcommit_memory being 0, memory allocations made by an
application never fail, but instead the application may be killed by the
so-called OOM (out-of-memory) killer if, by the time the application
actually attempts to use the allocated memory, there is not available
free memory on the system.
If the value is 2, then a memory allocation made by an application may
fail and unless the application is prepared for that possiblity, it will
likely crash with a SIGSEGV. As MaxScale is not prepared to handle memory
allocation failures, it will crash in this situation.
The current value of vm.overcommit_memory can be checked with
or
covers the first steps in configuring your MariaDB MaxScale installation. Follow this tutorial to learn how to configure and start using MaxScale.
For a detailed list of all configuration parameters, refer to the and the module specific documents listed in the .
Read the section of the configuration guide to set up password encryption for the configuration file.
There are various administration tasks that may be done with MariaDB MaxScale. A command line tools is available, , that will interact with a running MariaDB MaxScale and allow the status of MariaDB MaxScale to be monitored and give some control of the MariaDB MaxScale functionality.
covers the common administration tasks that need to be done with MariaDB MaxScale.
The main configuration file for MaxScale is in /etc/maxscale.cnf and
additional user-created configuration files are in/etc/maxscale.cnf.d/. Objects created or modified at runtime are stored in/var/lib/maxscale/maxscale.cnf.d/. Some modules also store internal data in/var/lib/maxscale/ named after the module or the configuration object.
The simplest way to back up the configuration and runtime data of a MaxScale installation is to create an archive from the following files and directories:
/etc/maxscale.cnf
/etc/maxscale.cnf.d/
/var/lib/maxscale/
This can be done with the following command:
If MaxScale is configured to store data in custom locations, these should be included in the backup as well.
This page is licensed: CC BY-SA / Gnu FDL
Note: This module is experimental and must be built from source. The module is deprecated in MaxScale 23.08 and might be removed in a future release.
The Transaction Performance Monitoring (TPM) filter is a filter module for MaxScale that monitors every SQL statement that passes through the filter. The filter groups a series of SQL statements into a transaction by detecting 'commit' or 'rollback' statements. It logs all committed transactions with necessary information, such as timestamp, client, SQL statements, latency, etc., which can be used later for transaction performance analysis.
The configuration block for the TPM filter requires the minimal filter options in it's section within the maxscale.cnf file, stored in /etc/maxscale.cnf.
The TPM filter does not support any filter options currently.
The TPM filter accepts a number of optional parameters.
The name of the output file created for performance logging. The default filename is tpm.log.
The optional source parameter defines an address that is used
to match against the address from which the client connection
to MaxScale originates. Only sessions that originate from this
address will be logged.
The optional user parameter defines a user name that is used
to match against the user from which the client connection to
MaxScale originates. Only sessions that are connected using
this username are logged.
The optional delimiter parameter defines a delimiter that is used to
distinguish columns in the log. The default delimiter is :::.
The optional query_delimiter defines a delimiter that is used to
distinguish different SQL statements in a transaction.
The default query delimiter is @@@.
named_pipe is the path to a named pipe, which TPM filter uses to
communicate with 3rd-party applications (e.g., ).
Logging is enabled when the router receives the character '1' and logging is
disabled when the router receives the character '0' from this named pipe.
The default named pipe is /tmp/tpmfilter and logging is disabled by default.
For example, the following command enables the logging:
Similarly, the following command disables the logging:
For each transaction, the TPM filter prints its log in the following format:
<timestamp> | <server_name> | <user_name> | <latency of the transaction> | <latencies of individual statements in the transaction> (delimited by 'query_delimiter') | <actual SQL statements>
You want to log every transaction with its SQL statements and latency for future transaction performance analysis.
Add a filter with the following definition:
After the filter reads the character '1' from its named pipe, the following is an example log that is generated from the above TPM filter with the above configuration:
Note that 3 and 6 are latencies of each transaction in milliseconds, while 0.165 and 0.123 are latencies of the first statement of each transaction in milliseconds.
This page is licensed: CC BY-SA / Gnu FDL
The Regex filter is a filter module for MariaDB MaxScale that is able to rewrite query content using regular expression matches and text substitution. The regular expressions use the .
PCRE2 library uses a different syntax than POSIX to refer to capture
groups in the replacement string. The main difference is the usage of the dollar
character instead of the backslash character for references e.g. $1 instead of\1. For more details about the replacement string differences, please read the
chapter in the PCRE2 manual.
The following demonstrates a minimal configuration.
The Regex filter has two mandatory parameters: match and replace.
matchType:
Mandatory: Yes
Dynamic: Yes
Defines the text in the SQL statements that is replaced.
optionsType:
Mandatory: No
Dynamic: Yes
Values: ignorecase, case, extended
Default: ignorecase
The options-parameter affects how the patterns are compiled as .
replaceType: string
Mandatory: Yes
Dynamic: Yes
This is the text that should replace the part of the SQL-query matching the pattern defined in match.
sourceType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional source parameter defines an address that is used to match against the address from which the client connection to MariaDB MaxScale originates. Only sessions that originate from this address will have the match and replacement applied to them.
userType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional user parameter defines a username that is used to match against the user from which the client connection to MariaDB MaxScale originates. Only sessions that are connected using this username will have the match and replacement applied to them.
log_fileType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional log_file parameter defines a log file in which the filter writes all queries that are not matched and matching queries with their replacement queries. All sessions will log to this file so this should only be used for diagnostic purposes.
log_traceType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional log_trace parameter toggles the logging of non-matching and matching queries with their replacements into the log file on the info level. This is the preferred method of diagnosing the matching of queries since the log level can be changed at runtime. For more details about logging levels and session specific logging, please read the .
MySQL 5.1 used the parameter TYPE = to set the storage engine that should be used for a table. In later versions this changed to be ENGINE =. Imagine you have an application that you can not change for some reason, but you wish to migrate to a newer version of MySQL. The regexfilter can be used to transform the create table statements into the form that could be used by MySQL 5.5
This page is licensed: CC BY-SA / Gnu FDL
NOTE MaxScale 6.4 was renamed to 21.06 in May 2024. Thus, what would have been released as 6.4.16 in June, was released as 21.06.16. The purpose of this change is to make the versioning scheme used by all MaxScale series identical. 21.06 denotes the year and month when the first 6 release was made.
Release 21.06.16 is a GA release.
This document describes the changes in release 21.06.16, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Add "enforce_read_only_servers" feature to MariaDB Monitor
Master Stickiness state is not documented
ability to setup .secrets file location
max_slave_connections=0 may create slave connections after a switchover
ssl_version in MaxScale and tls_version in MariaDB behave differently
Password encryption format change in 2.5 is not documented very well
The values of ssl_version in MaxScale and tls_version in MariaDB accept different values
Warning about missing slashes around regular expressions is confusing
Problem in hostname matching when using regex (%) for user authentication
cooperative_monitoring_locks can leave stale locks on a server if network breaks
Maxscale key limitations
enforce_read_only_slaves can set master to read_only
gdb-stacktrace is incorrectly presented as a debug option
During Failover Passive MaxScale route writes to the Old Master
Session commands that are executed early are not validated
--basedir is broken
MariaDB Monitor command reset-replication can be started on a secondary MaxScale
MaxScale should log a warning if failover may lose transactions
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 21.06.17 is a GA release.
This document describes the changes in release 21.06.17, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Large batches of session commands may leave sessions alive for a long time
MaxScale does not drop supplementary groups if --user is used
LICENSE.TXT is a dangling symlink in RPMs
Erroneous "Cluster gtid domain is unknown" error message during failover
Reads with max_slave_connections=0 after a switchover do not discard stale connections
CMake 3.28.3 warnings
Default logrotate config in .deb / docu missing params
/maxscale/logs/data may return no data if maxlog=0 and syslog=1
Multi-statement commands may end up being stored in the session command history
Two cache filters in same service causes errors on session creation
MaxScale does not have time to open the file during rotation for a new binlog
Post reboot binlog router entered stuck state
postinst script prints output while installing
23.08.6 build ppc64le fails
Memory leak in namedserverfilter
comment filter uses the wrong module name
DEALLOCATE PREPARE is not routed to all nodes
MaxScale detects wrong server character set
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 21.06.19 is a GA release.
This document describes the changes in release 21.06.19, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Fixed by Container Image vulnerability CVE-2024-21538 (MXS)
Early mismatched responses to session commands do not close connections
Session commands with max_slave_connections=0 after switchover do not discard stale connections
The "INSERT INTO...RETURNING" syntax breaks causal_reads
Documentation regarding mixing of cooperative_monitoring_locks and passive is unclear
Relationship selections auto-cleared when creating a new monitor object
readwritesplit enables multi-statements regardless of the state of causal_reads
idle_session_pool_time=0s does not fairly share connections
Need Documentation updates for Maxscale install recommendation
MaxCtrl warnings are very verbose
Errors during loading of users lack the service name
maxctrl list queries fails
Encrypted passwords cannot be used with maxctrl
Log message: Unknown prepared statement handler given to MaxScale
Backend connections with fail with EAGAIN
Failed authentication warnings do not mention lack of client-side SSL as the reason of the failure
MaxScale 24.02.04 not closing DB Connections properly
Duration types that only take seconds return ms as units instead of s
retry_failed_reads is not affected by delayed_retry_timeout
Debug assertion on very large binary protocol prepared statements
Some log messages are not logged when session_trace is used
NVL and NVL2 are not detected as builtin functions outside of sql_mode=ORACLE
Kafkacdc errors for wrong GTID positions are not clear
Errors due to max_connections being exceeded are always fatal errors
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.2.1 is a GA release.
This document describes the changes in release 6.2.1, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Invent a configuration option to allow transaction replay ignore checksum check
Make transaction_replay less strict
Per service log_info
Altering xpandmon at runtime fails
create_one_connection_for_sescmd() doesn't correctly replace m_current_master
Debug assertion in mariadb_backend.cc
Debug assertion during transaction replay
Debug assert in xpandmon
Transaction replay time limits are unpredictable
Linking a service at runtime to an xpandmon doesn't work
connection stalled after executing a stored procedure with OUT parameter
MaxScale logs a warning when users are loaded from a Xpand cluster
Some log messages do not contain the session ID
Session commands are not retried with delayed_retry
Can't connect to MaxScale when schema uses utf8mb4 chars >= U0080
Crash during set server maintenance --force
Autocommit tracking doesn't work correctly
Monitor parameters table is not modifiable (GUI)
Skip http_proxy when address is localhost
MaxScale crashes (double free or corruption)
Unexpected result state
Add multi-threaded stack traces
MaxScale crashes when executing CDC process to kafka
When reading password from stdin via redirect, interactive use is no longer possible
read/write split service incorrectly times out valid sessions on master if timeout happens on replica
LIMIT should be added for each select query automatically
Using the binlog router as the source for KafkaCDC router is unreliable
Use virtual scroll on maxscale log view to fix memory issue
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.1 is a GA release.
This document describes the changes in release 6.4.1, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
HTTPS requests don't include Path=/ in cookies
The state of the bootstrap nodes is not updated properly
MaxScale w/SSL doesn't work on FIPS RHEL7
Some non-multi-statement queries are classified as multi-statement ones
maxctrl call command leaves stale errors
Hang in RWSplitSession::correct_packet_sequence
Unmodifiable parameters aren't prevented from being modified
Bad create monitor command leaves a ghost monitor
Listeners created at runtime require ssl_ca_cert when it should not be required
Filter diagnostics are not shown in maxctrl show filters
Servers with priority=0 are selected as Master
Debug assertion when cat session ends
Galeramon doesn't work with max_slave_replication_lag
Log warning if reverse name resolution takes significant time
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.14 is a GA release.
This document describes the changes in release 6.4.14, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
ssl_version should specify minimum version
Session commands ignore delayed_retry_timeout
Tables in information_schema are treated as a normal tables
GUI doesn't validate object name uniqueness accurately
Use-after-free after service deletion
History length of sessions is not visible in the REST-API
Very fast client and server may end up busy-looping a worker
The "New messages available" button in the GUI Logs Archive does not disappear after being clicked.
Memory growth for long-running sessions that use COM_CHANGE_USER
Memory growth for long-running sessions that use prepared statements
Memory leak when closing SSL connection
Query classifier cache total-size book-keeping may be wrong
readconnroute performance regression in 6.4
Undefined behavior with module commands that take no arguments
MonitorWorker::call_run_one_tick() called more often than intended
maxctrl show qc_cache can easily overwhelm MaxScale
Reducing the size of the query classifier cache does not cause excess entries to be freed.
QC cache memory accounting on CentOS 7 is wrong
5.5.5- prefix should not be added if all backends are MariaDB 11
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.7 is a GA release.
This document describes the changes in release 6.4.7, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Partially executed multi-result queries are not treated as partial results
Query classifier does not recognize BEGIN NOT ATOMIC ... END
Readwritesplit prefers idle primary over busy replicas
Qlafilter logs responses from non-matched queries
AVX instructions end up being executed on startup
Query canonicalization does not work on scientific numbers
maxctrl classify sends malformed SQL
transaction_replay_max_size default is 1GiB instead of 1MiB
Not all passwords were obfuscated in the maxctrl report
qlafilter with options=extended does not log query nor date
Regular expression documentation is inaccurate and lacking
The statement canonicalizer cannot handle comments within statements
KB pages reference mysqlauth and mysqlauth is deprecated for mariadbauth
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.8 is a GA release.
This document describes the changes in release 6.4.8, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Provide a way to show details about all supported MaxScale modules via REST API and/or MaxCtrl
ssl parameters specified on the bootstrap server are not copied to the rest
REST-API documentation is wrong about which server parameters can be modified
causal_reads=local is serialized as causal_reads=true
Listener creation error is misleading
xpandmon diagnostics are not useful
Galeramon use_priority example is incorrect
Document supported wire protocol versions
Cache filter hangs if statement consists of multiple packets.
Post reboot binlog router entered stuck state
Add human readable message text to API errors like 404
Setting session_track_trx_state=true leads to OOM kiled.
Documentation claims that netmask support is limited to numbers 255 and 0
MongoDB monitoring promoted when connecting to NoSQL service
qlafilter log event notifications are sometimes lost
GUI is unable to create a listener with other protocols than MariaDBProtocol
readconnroute documentation page contains a typo "max_slave_replication_lag"
Harden BLR binlog file-index handling
Connection in Query Editor is closed after 1 hour of being idle
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.6 is a GA release.
This document describes the changes in release 6.4.6, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
RHEL8 Packages for 23.02.1 and 22.08.5
Binlogrouter breaks if event size exceeds INT_MAX
Maxscale ignores lower_case_table_names=1 on config file
Dynamic filter capabilities do not work
"Unknown prepared statement handler" error when connection_keepalive is disabled on a readconnroute service
Empty regex // is not treated as empty
transaction replay retries repeatedly after failing checksum
Wrong server version assumption
MaxScale leaks sessions if they are closed when writeq throttling is enabled
skip_name_resolve is not modifiable at runtime
Uncaught exception in binlogrouter
IP wildcard values are not permitted in host values while using data masking
config_sync_cluster always uses the mysql database
Replication breaks if binlogfilter excludes events
PHP program reports different collation_connection when connecting via Maxscale
Attempting to create a table with the name "DUAL" crashes MaxScale
Memory leak in smartrouter
Hang in smartrouter under heavy load
Improve match/exclude documentation for avrorouter and kafkacdc
QLA filter not properly logging USE DBx command.
pinloki_start_stop is unstable
The rpl_state in binlogrouter is not atomic
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.4 is a GA release.
This document describes the changes in release 6.4.4, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Warning for xpandmon for 'leaving' / 'late, leaving' being an unknown sub-state
UPDATE with user variable breaks replication
Maxscale: KafkaCDC writes to current_gtid.txt causes high disk utilisation.
fields parameter breaks REST-API filtering
Authentication failures during shard mapping are not handled correctly
Crash in handleError
LOAD DATA LOCAL INFILE and changing autocomit causing stuck
MAXGUI - Out of memory in client PC browser.
/maxscale/logs/data endpoint doesn't filter syslog contents correctly
Full SASL support is not enabled for kafka modules
Smartrouter interrupts the wrong query
Database grants in user_accounts_file should add the database to the list of known databases
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
The cat router is a special router that concatenates result sets.
Note: This module is experimental and must be built from source. The module is deprecated in MaxScale 23.08 and might be removed in a future release.
The router has no special parameters. To use it, define a service withrouter=cat and add the servers you want to use.
The order the servers are defined in is the order in which the servers are
queried. This means that the results are ordered based on the servers
parameter of the service. The result will only be completed once all servers
have executed this.
All commands executed via this router will be executed on all servers. This
means that an INSERT through the cat router will send it to all servers. In
the case of commands that do not return resultsets, the response of the last
server is sent to the client. This means that if one of the earlier servers
returns a different result, the client will not see it.
As the intended use-case of the router is to mainly reduce multiple result sets into one, it has no mechanisms to prevent writes from being executed on slave servers (which would cause data corruption or replication failure). Take great care when performing administrative operations though this router.
If a connection to one of the servers is lost, the client connection will also be closed.
Here is a simple example service definition that uses the servers from the tutorial and the credentials from the .
This page is licensed: CC BY-SA / Gnu FDL
HintRouter was introduced in 2.2 and is still beta.
The HintRouter module is a simple router intended to operate in conjunction with the NamedServerFilter. The router looks at the hints embedded in a packet buffer and attempts to route the packet according to the hint. The user can also set a default action to be taken when a query has no hints or when the hints could not be applied.
If a packet has multiple hints attached, the router will read them in order and attempt routing. Any successful routing ends the process and any further hints are ignored for the packet.
The HintRouter is a rather simple router and only accepts a few configuration settings.
This setting defines what happens when a query has no routing hint or applying the routing hint(s) fails. If also the default action fails, the routing will end in error and the session closes. The different values are:
Note that setting default action to anything other than all means that session
variable write commands are by default not routed to all backends.
Defines the default backend name if default_action=named. <server-name> must
be a valid backend name.
<limit> should be an integer, -1 by default. Defines how many backend slave
servers a session should attempt to connect to. Having less slaves defined in
the services and/or less successful connections during session creation is not
an error. The router will attempt to distribute slaves evenly between sessions
by assigning them in a round robin fashion. The session will always try to
connect to a master regardless of this setting, although not finding one is not
an error.
Negative values activate default mode, in which case this value is set to the number of backends in the service - 1, so that the sessions are connected to all slaves.
If the hints or the default_action point to a named server, this setting is
probably best left to default to ensure that the specific server is connected to
at session creation. The router will not attempt to connect to additional
servers after session creation.
A minimal configuration doesn't require any parameters as all settings have reasonable defaults.
If packets should be routed to the master server by default and only a few connections are required, the configuration might be as follows.
This page is licensed: CC BY-SA / Gnu FDL
function createInstance()
end
function newSession()
end
function closeSession()
end
function routeQuery(query)
end
function clientReply(query)
end
function diagnostic()
end[MyLuaFilter]
type=filter
module=luafilter
global_script=/path/to/script.luaf = io.open("/tmp/test.log", "a+")
function createInstance()
f:write("createInstance\n")
end
function newSession(a, b)
f:write("newSession for: " .. a .. "@" .. b .. "\n")
end
function closeSession()
f:write("closeSession\n")
end
function routeQuery(string)
f:write("routeQuery: " .. string .. " -- type: " .. lua_qc_get_type_mask() .. " operation: " .. lua_qc_get_operation() .. "\n")
end
function clientReply()
f:write("clientReply\n")
end
function diagnostic()
f:write("diagnostics\n")
return "Hello from Lua!"
endSET autocommit=0;
XA START 'MyXA';
INSERT INTO test.t1 VALUES(1);
XA END 'MyXA';
XA PREPARE 'MyXA';
XA COMMIT 'MyXA';
SET autocommit=1;set autocommit=1
PREPARE hide_autocommit FROM "set autocommit=0"
EXECUTE hide_autocommitsysctl vm.overcommit_memorycat /proc/sys/vm/overcommit_memorytar -caf maxscale-backup.tar.gz /etc/maxscale.cnf /etc/maxscale.cnf.d/ /var/lib/maxscale/[MyLogFilter]
type=filter
module=tpmfilter
[MyService]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=MyLogFilterfilename=/tmp/SqlQueryLogsource=127.0.0.1user=johndelimiter=:::query_delimiter=@@@named_pipe=/tmp/tpmfilter$ echo '1' > /tmp/tpmfilter$ echo '0' > /tmp/tpmfilter[PerformanceLogger]
type=filter
module=tpmfilter
delimiter=:::
query_delimiter=@@@
filename=/var/logs/tpm/perf.log
named_pipe=/tmp/tpmfilter
[Product-Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=PerformanceLogger1484086477::::server1::::root::::3::::0.165@@@@0.108@@@@0.102@@@@0.092@@@@0.121@@@@0.122@@@@0.110@@@@2.081::::UPDATE WAREHOUSE SET W_YTD = W_YTD + 3630.48 WHERE W_ID = 2 @@@@SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME FROM WAREHOUSE WHERE W_ID = 2@@@@UPDATE DISTRICT SET D_YTD = D_YTD + 3630.48 WHERE D_W_ID = 2 AND D_ID = 9@@@@SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME FROM DISTRICT WHERE D_W_ID = 2 AND D_ID = 9@@@@SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE FROM CUSTOMER WHERE C_W_ID = 2 AND C_D_ID = 9 AND C_ID = 1025@@@@UPDATE CUSTOMER SET C_BALANCE = 1007749.25, C_YTD_PAYMENT = 465215.47, C_PAYMENT_CNT = 203 WHERE C_W_ID = 2 AND C_D_ID = 9 AND C_ID = 1025@@@@INSERT INTO HISTORY (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) VALUES (9,2,1025,9,2,'2017-01-10 17:14:37',3630.48,'locfljbe xtnfqn')
1484086477::::server1::::root::::6::::0.123@@@@0.087@@@@0.091@@@@0.098@@@@0.078@@@@0.106@@@@0.094@@@@0.074@@@@0.089@@@@0.073@@@@0.098@@@@0.073@@@@0.088@@@@0.072@@@@0.087@@@@0.071@@@@0.085@@@@0.078@@@@0.088@@@@0.098@@@@0.081@@@@0.076@@@@0.082@@@@0.073@@@@0.077@@@@0.070@@@@0.105@@@@0.093@@@@0.088@@@@0.089@@@@0.087@@@@0.087@@@@0.086@@@@1.883::::SELECT C_DISCOUNT, C_LAST, C_CREDIT, W_TAX FROM CUSTOMER, WAREHOUSE WHERE W_ID = 2 AND C_W_ID = 2 AND C_D_ID = 10 AND C_ID = 1267@@@@SELECT D_NEXT_O_ID, D_TAX FROM DISTRICT WHERE D_W_ID = 2 AND D_ID = 10 FOR UPDATE@@@@UPDATE DISTRICT SET D_NEXT_O_ID = D_NEXT_O_ID + 1 WHERE D_W_ID = 2 AND D_ID = 10@@@@INSERT INTO OORDER (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL) VALUES (286871, 10, 2, 1267, '2017-01-10 17:14:37', 7, 1)@@@@INSERT INTO NEW_ORDER (NO_O_ID, NO_D_ID, NO_W_ID) VALUES ( 286871, 10, 2)@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 24167@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 24167 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 96982@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 96982 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 40679@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 40679 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 31459@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 31459 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 6143@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 6143 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 12001@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 12001 AND S_W_ID = 2 FOR UPDATE@@@@SELECT I_PRICE, I_NAME , I_DATA FROM ITEM WHERE I_ID = 40407@@@@SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK WHERE S_I_ID = 40407 AND S_W_ID = 2 FOR UPDATE@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,1,24167,2,7,348.31998,'btdyjesowlpzjwnmxdcsion')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,2,96982,2,1,4.46,'kudpnktydxbrbxibbsyvdiw')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,3,40679,2,7,528.43,'nhcixumgmosxlwgabvsrcnu')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,4,31459,2,9,341.82,'qbglbdleljyfzdpfbyziiea')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,5,6143,2,3,152.67,'tmtnuupaviimdmnvmetmcrc')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,6,12001,2,5,304.3,'ufytqwvkqxtmalhenrssfon')@@@@INSERT INTO ORDER_LINE (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (286871,10,2,7,40407,2,1,30.32,'hvclpfnblxchbyluumetcqn')@@@@UPDATE STOCK SET S_QUANTITY = 65 , S_YTD = S_YTD + 7, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 24167 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 97 , S_YTD = S_YTD + 1, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 96982 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 58 , S_YTD = S_YTD + 7, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 40679 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 28 , S_YTD = S_YTD + 9, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 31459 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 86 , S_YTD = S_YTD + 3, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 6143 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 13 , S_YTD = S_YTD + 5, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 12001 AND S_W_ID = 2@@@@UPDATE STOCK SET S_QUANTITY = 44 , S_YTD = S_YTD + 1, S_ORDER_CNT = S_ORDER_CNT + 1, S_REMOTE_CNT = S_REMOTE_CNT + 0 WHERE S_I_ID = 40407 AND S_W_ID = 2
...[MyRegexFilter]
type=filter
module=regexfilter
match=some string
replace=replacement string
[MyService]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=MyRegexfiltermatch=TYPE[ ]*=
options=casereplace=ENGINE =source=127.0.0.1user=johnlog_file=/tmp/regexfilter.loglog_trace=true[CreateTableFilter]
type=filter
module=regexfilter
options=ignorecase
match=TYPE\s*=
replace=ENGINE=
[MyService]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=CreateTableFilter[concat-service]
type=service
router=cat
servers=dbserv1,dbserv2,dbserv3
user=maxscale
password=maxscale_pwdefault_action=<master|slave|named|all>master
Route to the master server.
slave
Route to any single slave server.
named
Route to a named server. The name is given in the default_server-setting.
all
Default value. Route to all connected servers.
default_server=<server-name>max_slaves=<limit>[Routing-Service]
type=service
router=hintrouter
servers=slave1,slave2,slave3[Routing-Service]
type=service
router=hintrouter
servers=MyMaster, slave1,slave2,slave3,slave4,slave5,slave6,slave7
default_action=master
max_slaves=2NOTE MaxScale 6.4 was renamed to 21.06 in May 2024. Thus, what would have been released as 6.4.16 in June, was released as 21.06.16. The purpose of this change is to make the versioning scheme used by all MaxScale series identical. 21.06 denotes the year and month when the first 6 release was made. Anything referring to MaxScale 6 applies to MaxScale 21.06.
The main tutorial for MariaDB MaxScale consist of setting up MariaDB MaxScale for the environment you are using with either a connection-based or a read/write-based configuration.
These tutorials are for specific use cases and module combinations.
Here are tutorials on monitoring and managing MariaDB MaxScale in cluster environments.
The routing module is the core of a MariaDB MaxScale service. The router documentation contains all module specific configuration options and detailed explanations of their use.
Here are detailed documents about the filters MariaDB MaxScale offers. They contain configuration guides and example use cases. Before reading these, you should have read the filter tutorial so that you know how they work and how to configure them.
Common options for all monitor modules.
Module specific documentation.
Documentation for MaxScale protocol modules.
The MaxScale CDC Connector provides a C++ API for consuming data from a CDC system.
A short description of the authentication module type can be found in the Authentication Modules document.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.3 is a GA release.
This document describes the changes in release 6.4.3, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-4321 Error from missing --secure option is not helpful
MXS-4313 MaxCtrl misinterprets some arguments
MXS-4312 REST API accepts empty resource IDs
MXS-4307 Parser can't recognize convert function parameters and cause wrong routing decision
MXS-4304 MariaDB-Monitor spams log with connection errors if server is both [Maintenance] and [Down]
MXS-4290 Maxscale masking filter returns parsing error on SELECT with very long WHERE
MXS-4289 Transaction starts on wrong server with autocommit=0
MXS-4283 Race condition in KILL command processing
MXS-4282 Servers that are [Down] may have [Slave of External Server]
MXS-4280 qc_sqlite does not properly handle a LIMIT clause
MXS-4279 "sub" field not set for JWTs
MXS-4275 MaxScale tries to start up if --export-config is used and a cached cluster configuration is present
MXS-4269 UPDATE with user variable modification is treated as a session command
MXS-4267 NULL values are exported as empty strings when using CSV format
MXS-4260 Maxscale crashes frequently while performing load testing
MXS-4259 warning: [xpandmon] 'late' is an unknown sub-state for a Xpand node
MXS-4247 Listener created with encryption even if ssl=false is passed
MXS-4231 Sometimes the date and time are missing in the query log
MXS-4227 MaxCtrl incompatibility with MemoryDenyWriteExecute=true is not documented
MXS-4221 GUI does not show other services used by services
MXS-4156 Update documentation on required monitor privileges
MXS-4094 Allow empty token when client is replying to AuthSwitchRequest
MXS-4083 CPU utilization high on MaxScale host
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.2.2 is a GA release.
This document describes the changes in release 6.2.2, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-3989 Rebalancing may cause MaxScale to crash
MXS-3978 Binlog router appends -BinlogRouter to master version string again and again ...
MXS-3973 Session capabilities are not frozen on session startup
MXS-3966 MariaDBMonitor does not log connection error on startup
MXS-3959 Transaction replay doesn't reset transaction on implicit commit
MXS-3958 MaxScale stalls and crashes occasionally
MXS-3955 Crash after unexpected result
MXS-3953 Transaction start written to binlog prematurely
MXS-3949 "transaction" is always parsed as a reserved word
MXS-3948 Toggle query result columns isn't working as expected
MXS-3932 Xpand monitor doesn't show full configuration in diagnostic output
MXS-3886 Hang in RoutingWorker::execute_concurrently semaphore.hh:146
MXS-3865 Shutdown bug
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
Release 6.1.4 is a GA release.
This document describes the changes in release 6.1.4, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the upgrading document for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on our Jira.
MXS-3817 The location of the GUI web directory isn't documented
MXS-3816 Queries are not always counted as reads with router_options=slave
MXS-3812 Hints for prepared statements can be lost if a query fails
MXS-3804 Result size accounting is wrong
MXS-3803 Debug assertion in readwritesplit
MXS-3801 Unexpected internal state with read-only cursor and result with one row
MXS-3799 Destroyed monitors are not deleted
MXS-3798 Race condition in service destruction
MXS-3791 Fix generix multistatement bug
MXS-3790 Fix luafilter
MXS-3788 Debug assertion with default config and transaction_replay=true
MXS-3779 binlogrouter logs warnings for ignored SQL
MXS-3768 Query Editor requires admin privileges
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the Limitations document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded here.
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available here.
This page is licensed: CC BY-SA / Gnu FDL
CREATE USER 'maxscale'@'maxscalehost' IDENTIFIED BY 'maxscale-password';
GRANT SELECT ON mysql.user TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.db TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.tables_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.columns_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.procs_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.proxies_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.roles_mapping TO 'maxscale'@'maxscalehost';
GRANT SHOW DATABASES ON *.* TO 'maxscale'@'maxscalehost';GRANT ALL ON infinidb_vtable.* TO 'maxscale'@'maxscalehost';authenticator_options=skip_authentication=true,lower_case_table_names=1authenticator_options=skip_authentication=trueauthenticator_options=match_host=falseauthenticator_options=lower_case_table_names=0This filter adds routing hints to a service. The filter has no parameters.
Note: If a query has more than one comment only the first comment is processed. Always place any MaxScale related comments first before any other comments that might appear in the query.
The client connection will need to have comments enabled. For example themariadb and mysql command line clients have comments disabled by default and
they need to be enabled by passing the --comments or -c option to it. Most,
if not all, connectors keep all comments intact in executed queries.
For comment types, use either -- (notice the whitespace after the double
hyphen) or # after the semicolon or /* ... */ before the semicolon.
Inline comment blocks, i.e. /* .. */, do not require a whitespace character
after the start tag or before the end tag but adding the whitespace is advised.
All hints must start with the maxscale tag.
The hints have two types, ones that define a server type and others that contain name-value pairs.
These hints will instruct the router to route a query to a certain type of a server.
Route to master
A master value in a routing hint will route the query to a master server. This
can be used to direct read queries to a master server for a up-to-date result
with no replication lag.
Route to slave
A slave value will route the query to a slave server. Please note that the
hints will override any decisions taken by the routers which means that it is
possible to force writes to a slave server.
Route to named server
A server value will route the query to a named server. The value of<server name> needs to be the same as the server section name in
maxscale.cnf. If the server is not used by the service, the hint is ignored.
Route to last used server
A last value will route the query to the server that processed the last
query. This hint can be used to force certain queries to be grouped to the same
server.
Name-value hints
These control the behavior and affect the routing decisions made by the
router. Currently the only accepted parameter is the readwritesplit parametermax_slave_replication_lag. This will route the query to a server with a lower
replication lag than this parameter's value.
Hints can be either single-use hints, which makes them affect only one query, or named hints, which can be pushed on and off a stack of active hints.
Defining named hints:
Pushing a hint onto the stack:
Popping the topmost hint off the stack:
You can define and activate a hint in a single command using the following:
You can also push anonymous hints onto the stack which are only used as long as they are on the stack:
The hintfilter supports routing hints in prepared statements for both thePREPARE and EXECUTE SQL commands as well as the binary protocol prepared
statements.
With binary protocol prepared statements, a routing hint in the prepared statement is applied to the execution of the statement but not the preparation of it. The preparation of the statement is routed normally and is sent to all servers.
For example, when the following prepared statement is prepared with the MariaDB
Connector-C function mariadb_stmt_prepare and then executed withmariadb_stmt_execute the result is always returned from the master:
Support for binary protocol prepared statements was added in MaxScale 6.0 ().
The protocol commands that the routing hints are applied to are:
COM_STMT_EXECUTE
COM_STMT_BULK_EXECUTE
COM_STMT_SEND_LONG_DATA
COM_STMT_FETCH
COM_STMT_RESET
Support for direct execution of prepared statements was added in MaxScale
6.2.0. For example the MariaDB Connector-C uses direct execution whenmariadb_stmt_execute_direct is used.
Text protocol prepared statements (i.e. the PREPARE and EXECUTE SQL
commands) behave differently. If a PREPARE command has a routing hint, it will
be routed according to the routing hint. Any subsequent EXECUTE command will
not be affected by the routing hint in the PREPARE statement. This means they
must have their own routing hints.
The following example is the recommended method of executing text protocol prepared statements with hints:
The PREPARE is routed normally and will be routed to all servers. TheEXECUTE will be routed to the master as a result of it having the route to master hint.
SELECT queries to masterIn this example, MariaDB MaxScale is configured with the readwritesplit router and the hint filter.
Behind MariaDB MaxScale is a master server and a slave server. If there is replication lag between the master and the slave, read queries sent to the slave might return old data. To guarantee up-to-date data, we can add a routing hint to the query.
The first INSERT query will be routed to the master. The following SELECT query would normally be routed to the slave but with the added routing hint it will be routed to the master. This way we can do an INSERT and a SELECT right after it and still get up-to-date data.
This page is licensed: CC BY-SA / Gnu FDL
MaxGUI is a browser-based interface for MaxScale REST-API and query execution.
To enable MaxGUI in a testing mode, add admin_host=0.0.0.0 andadmin_secure_gui=false under the [maxscale] section of the MaxScale
configuration file. Once enabled, MaxGUI will be available on port 8989:http://127.0.0.1:8989/
To make MaxGUI secure, set admin_secure_gui=true and configure both theadmin_ssl_key and admin_ssl_cert parameters.
Check the for the parameter documentation and read the Configuration and Hardening section of the for instructions on how to harden your MaxScale installation for production use.
MaxGUI cannot be used without providing credentials. MaxGUI uses
the same credentials as maxctrl, so by default, the username isadmin and the password is mariadb.
MaxGUI uses as the authentication method for persisting the user's session. If the Remember me checkbox is ticked, the session will persist for 24 hours, otherwise, as soon as MaxGUI is closed, the session will expire.
To log out, simply click the username section in the top right corner of the page header to access the logout menu.
The dashboard shows three graphs:
Sessions graph illustrates the total number of current sessions updating every 10 seconds.
Connections graph shows servers current connections updating every 10 seconds.
Load graph shows the last second load of thread, which is updated every second.
Under the graphs section, there is tab navigation to switch table view which contains overview information of the following resources: all servers grouped by monitor, current sessions and all services. The information of these resources are updated every 10 seconds.
The monitor, server, and services resources have their own details page. It can be accessed by clicking the resource name on the dashboard page.
On the details page, resource parameters as well as relationships can be modified in the resource's parameters section.
Deletion of a resource or other actions can be done by clicking the setting icon located next to the resource name. For instance, clicking the setting icon on the Monitor detail page will popup three icons allowing a monitor to be started, stopped, and deleted.
For Servers, the monitor relationship can be modified by hovering over the rectangular Monitor block section at the top of the page.
The query editor page can be accessed via the sidebar navigation menu. If no active connection exists, a dialog to set up one is displayed. A connection can target a server, service, or listener.
The query layout editor interface comprises the following sections:
Located at the top of the page, users can create multiple connections to perform parallel querying. On the right side, there are buttons to save query to favorite, open Query configuration dialog, and set the page to full-screen mode.
Located below the worksheet tab bar, this contains resource quick action buttons on the left side and query action buttons on the right side.Resource quick action buttons are used to manage active &#xNAN;connections and active database. Query action buttons are used to run SQL statements, visualize query result in graphs, and configure query settings.
List databases, tables and columns of the server.
The list is fetched when needed and provided with
dedicated options which can be accessed by clicking the more
options (...) icon.
For example, for table, it has options to Preview Data
and View Details which internally executes SELECT * FROM database.table_name
and DESCRIBE database.table_name, respectively.
Writing SQL statements and executing all statements or selected statements by using shortcut keys. In general, the editor provides some of the most famous editor features of Visual Studio Code
All the command palette can be shown by pressing F1 or right-click on the editor to open the context menu and choose Command Palette
Located at the bottom of the page, the result section is comprised of three tabs which are Results, Data Preview and History/FavoriteThe Results tab shows the query results of the SQL statements from &#xNAN;the SQL editor. The Data Preview contains two sub-tabs DATA and DETAILS showing the results of Preview Data and View Details, respectively.
The History/Favorite shows query history and favorite queries
Result tables can be filtered, sorted (only when total rows <= 10000), exported,
and grouped. The result can be exported as json, csv with a custom delimiter.
The table result can be converted to the vertical mode by clicking the transform icon on the right corner above the table. In addition, table columns visibility can be toggled and resized.
Query result can be visualized into line, scatter, vertical bar, and horizontal bar graphs. In order to see the graph, simply click the graph icon next to the gear icon in the task bar, then fill in the inputs.
The graph can be resized by clicking the border of the pane and exported as jpeg
format with same ratio.
This editor helps to alter table easily which can be accessed by right-clicking the table on and choose Alter Table.
A connection is bound to a worksheet, so sessions querying of a connection is
not yet supported.
The hard limit rows of each result are set to 10000 rows which means
MaxScale returns 10000 rows regardless value of the LIMIT clause. In addition,LIMIT is not automatically injected into statements written in the SQL editor.
To access logs viewer, choose Logs Archive in the sidebar navigation.
A resource can be created by clicking the + Create New button at the top right corner of the dashboard or the detail page.
Note: Resources that depend on a module can be created only if that module has been loaded by MaxScale.
MaxScale parameters can be viewed and modified at runtime on the Settings page, which can be accessed by clicking the gear icon in the sidebar navigation.
The global search input located next to the + Create New button can be used for searching for keywords in tables.
This page is licensed: CC BY-SA / Gnu FDL
The namedserverfilter is a MariaDB MaxScale filter module able to route queries to servers based on regular expression (regex) matches. Since it is a filter instead of a router, the NamedServerFilter only sets routing suggestions. It requires a compatible router to be effective. Currently, bothreadwritesplit and hintrouter take advantage of routing hints in the data packets. This filter uses the PCRE2 library for regular expression matching.
The filter accepts settings in two modes: legacy and indexed. Only one of
the modes may be used for a given filter instance. The legacy mode is meant for
backwards compatibility and allows only one regular expression and one server
name in the configuration. In indexed mode, up to 25 regex-server pairs are
allowed in the form match01 - target01, match02 - target02 and so on.
Also, in indexed mode, the server names (targets) may contain a list of names or
special tags ->master or ->slave.
All parameters except the deprecated match and target parameters can
be modified at runtime. Any modifications to the filter configuration will
only affect sessions created after the change has completed.
Below is a configuration example for the filter in indexed-mode. The legacy mode is not recommended and may be removed in a future release. In the example, a SELECT on TableOne (match01) results in routing hints to two named servers, while a SELECT on TableTwo is suggested to be routed to the master server of the service. Whether a list of server names is interpreted as a route-to-any or route-to-all is up to the attached router. The HintRouter sees a list as a suggestion to route-to-any. For additional information on hints and how they can also be embedded into SQL-queries, see .
NamedServerFilter requires at least one matchXY - targetXY pair.
matchXYType:
Mandatory: No
Dynamic: Yes
Default: None
matchXY defines a against which the incoming SQL query is matched. XY must be a number in the range 01 - 25. Each match-setting pairs with a similarly indexed target-setting. If one is defined, the other must be defined as well. If a query matches the pattern, the filter attaches a routing hint defined by the target-setting to the query. Theoptions-parameter affects how the patterns are compiled.
options
Type:
Mandatory: No
Dynamic: Yes
Values: ignorecase, case, extended
Default: ignorecase
for matchXY.
targetXYType: string
Mandatory: No
Dynamic: Yes
Default: None
The hint which is attached to the queries matching the regular expression defined bymatchXY. If a compatible router is used in the service the query will be routed accordingly. The target can be one of the following:
a server or service name (adds a HINT_ROUTE_TO_NAMED_SERVER hint)
a list of server names, comma-separated (adds severalHINT_ROUTE_TO_NAMED_SERVER hints)
->master (adds a HINT_ROUTE_TO_MASTER hint)
->slave (adds a HINT_ROUTE_TO_SLAVE hint)
->all (adds a HINT_ROUTE_TO_ALL hint)
The support for service names was added in MaxScale 6.3.2. Older
versions of MaxScale did not accept service names in the target
parameters.
sourceType: string
Mandatory: No
Dynamic: Yes
Default: None
This optional parameter defines an IP address or mask which a connecting client's IP address is matched against. Only sessions whose address matches this setting will have this filter active and performing the regex matching. Traffic from other client IPs is simply left as is and routed straight through.
Since MaxScale 2.1 it's also possible to use % wildcards:
Note that using source=% to match any IP is not allowed.
Since MaxScale 2.3 it's also possible to specify multiple addresses separated by comma. Incoming client connections are subsequently checked against each.
userType: string
Mandatory: No
Dynamic: Yes
Default: None
This optional parameter defines a username the connecting client username is matched against. Only sessions that are connected using this username will have the match and routing hints applied to them. Traffic from other users is simply left as is and routed straight through.
The maximum number of accepted match - target pairs is 25.
In the configuration file, the indexed match and target settings may be in any order and may skip numbers. During SQL-query matching, however, the regexes are tested in ascending order: match01, match02, match03 and so on. As soon as a match is found for a given query, the routing hints are written and the packet is forwarded to the next filter or router. Any remaining match regexes are ignored. This means the match - target pairs should be indexed in priority order, or, if priority is not a factor, in order of decreasing match probability.
Binary-mode prepared statements (COM_STMT_PREPARE) are handled by matching the prepared sql against the match-parameters. If a match is found, the routing hints are attached to any execution of that prepared statement. Text- mode prepared statements are not supported in this way. To divert them, use regular expressions which match the specific "EXECUTE"-query.
This will route all queries matching the regular expression *from *users to
the server named server2. The filter will ignore character case in queries.
A query like SELECT * FROM users would be routed to server2 where as a query
like SELECT * FROM accounts would be routed according to the normal rules of
the router.
This page is licensed: CC BY-SA / Gnu FDL
The tee filter is a "plumbing" fitting in the MariaDB MaxScale filter toolkit. It can be used in a filter pipeline of a service to make copies of requests from the client and send the copies to another service within MariaDB MaxScale.
Please Note: Starting with MaxScale 2.2.0, any client that connects to a
service which uses a tee filter will require a grant for the loopback address,
i.e. 127.0.0.1.
The configuration block for the TEE filter requires the minimal filter parameters in its section within the MaxScale configuration file. The service to send the duplicates to must be defined.
The tee filter requires a mandatory parameter to define the service to replicate statements to and accepts a number of optional parameters.
targetType: target
Mandatory: No
Dynamic: Yes
Default: none
The target where the filter will duplicate all queries. The target can be either a service or a server. The duplicate connection that is created to this target will be referred to as the "branch target" in this document.
serviceType: service
Mandatory: No
Dynamic: Yes
Default: none
The service where the filter will duplicate all queries. This parameter is
deprecated in favor of the target parameter and will be removed in a future
release. Both target and service cannot be defined.
matchType:
Mandatory: No
Dynamic: Yes
Default: None
What queries should be included.
excludeType:
Mandatory: No
Dynamic: Yes
Default: None
What queries should be excluded.
optionsType:
Mandatory: No
Dynamic: Yes
Values: ignorecase, case, extended
Default: ignorecase
How regular expressions should be interpreted.
sourceType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional source parameter defines an address that is used to match against the address from which the client connection to MariaDB MaxScale originates. Only sessions that originate from this address will be replicated.
userType: string
Mandatory: No
Dynamic: Yes
Default: None
The optional user parameter defines a user name that is used to match against the user from which the client connection to MariaDB MaxScale originates. Only sessions that are connected using this username are replicated.
syncType:
Mandatory: No
Dynamic: Yes
Default: false
Enable synchronous routing mode. When configured with sync=true, the filter
will queue new queries until the response from both the main and the branch
target has been received. This means that for n executed queries, n - 1
queries are guaranteed to be synchronized. Adding one extra statement
(e.g. SELECT 1) to a batch of statements guarantees that all previous SQL
statements have been successfully executed on both targets.
In the synchronous routing mode, a failure of the branch target will cause the client session to be closed.
All statements that are executed on the branch target are done in an
asynchronous manner. This means that when the client receives the response
there is no guarantee that the statement has completed on the branch
target. The sync feature provides some synchronization guarantees that can
be used to verify successful execution on both targets.
Any errors on the branch target will cause the connection to it to be
closed. If target is a service, it is up to the router to decide whether the
connection is closed. For direct connections to servers, any network errors
cause the connection to be closed. When the connection is closed, no new
queries will be routed to the branch target.
With sync=true, a failure of the branch target will cause the whole session
to be closed.
Read documentation for details about module commands.
The tee filter supports the following module commands.
tee disable [FILTER]This command disables a tee filter instance. A disabled tee filter will not send any queries to the target service.
tee enable [FILTER]Enable a disabled tee filter. This resumes the sending of queries to the target service.
Assume an order processing system that has a table called orders. You also have another database server, the datamart server, that requires all inserts into orders to be replicated to it. Deletes and updates are not, however, required.
Set up a service in MariaDB MaxScale, called Orders, to communicate with the order processing system with the tee filter applied to it. Also set up a service to talk to the datamart server, using the DataMart service. The tee filter would have as its service entry the DataMart service, by adding a match parameter of "insert into orders" would then result in all requests being sent to the order processing system, and insert statements that include the orders table being additionally sent to the datamart server.
This page is licensed: CC BY-SA / Gnu FDL
Release 21.06.18 is a GA release.
This document describes the changes in release 21.06.18, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Fixed by Upgrade MongoC library to 1.27.5
Fixed by Upgrade MongoC library to 1.27.5
Empty passwords are shown as non-empty if password encryption is enabled
Crash in MariaDBParser::Helper::get_query_info()
Nested listener parameters depend on protocol being defined
Debug assert if backend fails during multi-packet query
Kafkaimporter doesn't work with MariaDB 11
timeout in kafkacdc is not a duration type
GDB stacktraces may hang
Improve MariaDB Monitor documentation on auto_failover and auto_rejoin
Kafkaimporter constraint makes it difficult to use with kafkacdc
Kafkacdc does not mention row-based replication as a requirement
User account manager hangs on shutdown
Slow servers may cause OOM situations if prepared statements are used
Prepared statements should never be removed from session command history
Kafkacdc always reads last GTID from Kafka on startup
SET NAMES UTF8MB4,autocommit=0 is not detected correctly
The --config-check fails if /var/cache/maxscale cannot be read
Read-only error during read-write transaction should trigger transaction replay
MaxScale installs scripts with non-standard file permissions
Valgrind reports read from uninitialized GWBUF for ccrfilter
Retrying of reads on the current primary unnecessarily requires delayed_retry
delayed_retry should not retry interrupted writes
SET statements multiple values are not parsed correctly
test_mxb_string sometimes times out on aarch64
Debug assertion due to non-existent dcall ID
Remove obsolete prelink script
MaxCtrl does not accept dot notation for nested parameters
Listener with ssl=false allows user accounts created with REQUIRE SSL to log in
wsrep_desync behavior is undocumented
webpack warns about yargs
Master Stickiness status not displayed correctly with use_priority
Replicas after maxscale binlog don't get updates
In the previous version of MaxScale, maxctrl was implemented as a JavaScript script that was run using the node interpreter on the platform. That introduced a dependency on node that earlier was not present. In this version of MaxScale, maxctrl is again a native executable without that dependency.
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
Release 6.4.9 is a GA release.
This document describes the changes in release 6.4.9, when compared to the previous release in the same series.
If you are upgrading from an older major version of MaxScale, please read the for this MaxScale version.
For any problems you encounter, please consider submitting a bug report on .
Case-sensitiveness of enumerations is not documented
Galeramon does not update replication lag of replicating servers
Implement an option to switch to the old "ping" behaviour in MaxScale
Connection init sql file execution can hang
qc_sqlite does not properly parse a RENAME statement
Update maxscale.cnf default file
SHOW TABLE STATUS FROM some_schema Fails with SchemaRouter
GTID update may block the REST-API
Binlogrouter treats GTID sequences as 32-bit integers
Readwritesplit does not detect unrecoverable situations
Binlogrouter always opens a new binlog on startup
Binlogrouter cannot write binlog files larger than 4GiB
Binlogrouter runs out of memory on very large transactions
Detect ALTER EVENT failure on MariaDB 11.0
Encrypted passwords are persisted in plaintext
Session idleness diagnostic is wrong
MaxScale BinlogRouter skips large transactions causing data Inconsistency on attached slave
Switchover fails with 'Unknown thread id' error
Document grants needed for MariaDB 11.1
binlogrouter shows MaxScale's binary log coordinates in SHOW SLAVE STATUS
There are some limitations and known issues within this version of MaxScale. For more information, please refer to the document.
RPM and Debian packages are provided for the supported Linux distributions.
Packages can be downloaded .
The source code of MaxScale is tagged at GitHub with a tag, which is identical
with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale
is maxscale-X.Y.Z. Further, the default branch is always the latest GA version
of MaxScale.
The source code is available .
This page is licensed: CC BY-SA / Gnu FDL
# The --comments flag is needed for the command line client
mariadb --comments -u my-user -psecret -e "SELECT @@hostname -- maxscale route to server db1"-- maxscale <hint body>-- maxscale route to [master | slave | server <server name>]-- maxscale route to master-- maxscale route to slave-- maxscale route to server <server name>-- maxscale route to last-- maxscale <param>=<value>-- maxscale <hint name> prepare <hint content>-- maxscale <hint name> begin-- maxscale end-- maxscale <hint name> begin <hint content>-- maxscale begin <hint content>SELECT user FROM accounts WHERE id = ? -- maxscale route to masterPREPARE my_ps FROM 'SELECT user FROM accounts WHERE id = ?';
EXECUTE my_ps USING 123; -- maxscale route to master[ReadWriteService]
type=service
router=readwritesplit
servers=server1,server2
user=maxuser
password=maxpwd
filters=Hint
[Hint]
type=filter
module=hintfilterINSERT INTO table1 VALUES ("John","Doe",1);
SELECT * FROM table1; -- maxscale route to master