Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä 2020-08-27 15:21:36 +03:00
commit bce427f4ad
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499
5 changed files with 64 additions and 93 deletions

View File

@ -27,8 +27,7 @@ should be queried more often. The smallest possible value is 100 milliseconds.
If querying the servers takes longer than `monitor_interval`, the effective
update rate is reduced.
The default value of `monitor_interval` was updated from 10000 milliseconds to
2000 milliseconds in MaxScale 2.2.0.
The default value of `monitor_interval` is 2000 milliseconds.
```
monitor_interval=2500ms
@ -51,7 +50,7 @@ even if the duration is longer than a second. The minimum value is 1 second and
the default value for this is 3 seconds.
```
backend_connect_timeout=6s
backend_connect_timeout=3s
```
### `backend_write_timeout`
@ -66,7 +65,7 @@ even if the duration is longer than a second. The minimum value is 1 second and
the default value for this is 3 seconds.
```
backend_write_timeout=4s
backend_write_timeout=3s
```
### `backend_read_timeout`
@ -81,7 +80,7 @@ even if the duration is longer than a second. The minimum value is 1 second and
the default value for this is 3 seconds.
```
backend_read_timeout=2s
backend_read_timeout=3s
```
### `backend_connect_attempts`
@ -92,7 +91,7 @@ monitoring loop. The default is 1. Every attempt may take up to
successful, the backend is considered to be unreachable and down.
```
backend_connect_attempts=3
backend_connect_attempts=1
```
### `disk_space_threshold`

View File

@ -49,44 +49,29 @@ MAXSCALE_OPTIONS="--logdir=/home/maxscale/logs --piddir=/tmp --syslog=no"
Note that this is only supported on legacy SysV systems.
## Stopping MariaDB MaxScale via MaxAdmin
In order to shutdown MariaDB MaxScale using the maxadmin command you may either
connect with maxadmin in interactive mode or pass the "shutdown maxscale"
command you wish to execute as an argument to maxadmin.
```
sudo maxadmin shutdown maxscale
```
## Checking The Status Of The MariaDB MaxScale Services
It is possible to use the maxadmin command to obtain statistics about the
services that are running within MaxScale. The maxadmin command "list services"
It is possible to use the maxctrl command to obtain statistics about the
services that are running within MaxScale. The maxctrl command `list services`
will give very basic information regarding services. This command may be either
run in interactive mode or passed on the maxadmin command line.
run in interactive mode or passed on the maxctrl command line.
```
$ maxadmin
MaxScale> list services
$ maxctrl list services
┌────────────────────────┬────────────────┬─────────────┬───────────────────┬────────────────────────────────────┐
│ Service │ Router │ Connections │ Total Connections │ Servers │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ CLI │ cli │ 1 │ 1 │ │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ RW-Split-Router │ readwritesplit │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ RW-Split-Hint-Router │ readwritesplit │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ SchemaRouter-Router │ schemarouter │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ Read-Connection-Router │ readconnroute │ 1 │ 1 │ server1 │
└────────────────────────┴────────────────┴─────────────┴───────────────────┴────────────────────────────────────┘
Services.
--------------------------+----------------------+--------+---------------
Service Name | Router Module | #Users | Total Sessions
--------------------------+----------------------+--------+---------------
RWSplitter | readwritesplit | 2 | 4
Cassandra | readconncouter | 1 | 1
CLI | cli | 2 | 2
--------------------------+----------------------+--------+---------------
MaxScale>
```
Network listeners count as a user of the service, therefore there will always be
@ -109,7 +94,7 @@ a client session, then a connection from the pool will be used if possible.
The connection will only be taken from the pool if it has been there for no more
than `persistmaxtime` seconds. The connection will also be discarded if it has
been disconnectedby the back end server. Connections will be selected so that
been disconnected by the back end server. Connections will be selected so that
they match the user name and protocol for the new request.
Starting with MaxScale 2.1, when a MySQL protocol connection is taken from the
@ -135,34 +120,25 @@ values in each server section.
## What Clients Are Connected To MariaDB MaxScale
To determine what client are currently connected to MariaDB MaxScale, you can
use the "list clients" command within maxadmin. This will give you IP address
and the ID’s of the DCB and session for that connection. As with any maxadmin
use the `list sessions` command within maxctrl. This will give you IP address
and the ID of the session for that connection. As with any maxctrl
command this can be passed on the command line or typed interactively in
maxadmin.
maxctrl.
```
$ maxadmin list clients
Client Connections
-----------------+------------------+----------------------+------------
Client | DCB | Service | Session
-----------------+------------------+----------------------+------------
127.0.0.1 | 0x7fe694013410 | CLI | 0x7fe69401ac10
-----------------+------------------+----------------------+------------
$
$ maxctrl list sessions
┌────┬─────────┬──────────────────┬──────────────────────────┬──────┬─────────────────┐
│ Id │ User │ Host │ Connected │ Idle │ Service │
├────┼─────────┼──────────────────┼──────────────────────────┼──────┼─────────────────┤
│ 6 │ maxuser │ ::ffff:127.0.0.1 │ Thu Aug 27 10:39:16 2020 │ 4 │ RW-Split-Router │
└────┴─────────┴──────────────────┴──────────────────────────┴──────┴─────────────────┘
```
## Rotating the Log File
MariaDB MaxScale logs messages of different priority into a single log file.
With the exception if error messages that are always logged, whether messages of
a particular priority should be logged or not can be enabled via the maxadmin
a particular priority should be logged or not can be enabled via the maxctrl
interface or in the configuration file. By default, MaxScale keeps on writing to
the same log file. To prevent the file from growing indefinitely, the
administrator must take action.
@ -170,11 +146,11 @@ administrator must take action.
The name of the log file is maxscale.log. When the log is rotated, MaxScale
closes the current log file and opens a new one using the same name.
Log file rotation is achieved by use of the "flush log" or “flush logs” command
in maxadmin.
Log file rotation is achieved by use of the `rotate logs` command
in maxctrl.
```
maxadmin flush logs
maxctrl rotate logs
```
As there currently is only the maxscale log, that is the only one that will be
@ -195,21 +171,12 @@ sharedscripts
postrotate
\# run if maxscale is running
if test -n "`ps acx|grep maxscale`"; then
/usr/bin/maxadmin flush logs
/usr/bin/maxctrl rotate logs
fi
endscript
}
```
**Note**:
If 'root' user is no longer available for maxadmin connection and for example
'user1' is one of the allowed users, the maxadmin command should be run as:
`su - user1 -c '/usr/bin/maxadmin flush logs'`
If listening socket is not the default one, /tmp/maxadmin.sock, use -S option.
MariaDB MaxScale will also rotate all of its log files if it receives the USR1
signal. Using this the logrotate configuration script can be rewritten as
@ -226,12 +193,12 @@ endscript
}
```
In older versions MaxScale renamed the log file, behaviour which is not fully
In older versions MaxScale renamed the log file, behavior which is not fully
compliant with the assumptions of logrotate and may lead to issues, depending on
the used logrotate configuration file. From version 2.1 onwards, MaxScale will
the used logrotate configuration file. From version 2.1 onward, MaxScale will
not itself rename the log file, but when the log is rotated, MaxScale will
simply close and reopen (and truncate) the same log file. That will make the
behaviour fully compliant with logrotate.
behavior fully compliant with logrotate.
## Taking A Database Server Out Of Use
@ -239,13 +206,13 @@ MariaDB MaxScale supports the concept of maintenance mode for servers within a
cluster, this allows for planned, temporary removal of a database from the
cluster within the need to change the MariaDB MaxScale configuration.
To achieve the removal of a database server you can use the set server command
in the maxadmin utility to set the maintenance mode flag for the server. This
may be done interactively within maxadmin or by passing the command on the
To achieve the removal of a database server you can use the `set server` command
in maxctrl to set the maintenance mode flag for the server. This
may be done interactively within maxctrl or by passing the command on the
command line.
```
sudo maxadmin set server dbserver3 maintenance
maxctrl set server dbserver3 maintenance
```
This will cause MariaDB MaxScale to stop routing any new requests to the server,
@ -256,7 +223,7 @@ To bring the server back into service use the "clear server" command to clear
the maintenance mode bit for that server.
```
sudo maxadmin clear server dbserver3 maintenance
sudo maxctrl clear server dbserver3 maintenance
```
If multiple MariaDB MaxScale instances are configured to use the node

View File

@ -145,6 +145,11 @@ const monitor_fields = [
path: 'id',
description: 'Monitor name'
},
{
name: 'Module',
path: 'attributes.module',
description: 'Monitor module'
},
{
name: 'State',
path: 'attributes.state',

View File

@ -542,13 +542,13 @@ const MXS_MODULE_PARAM config_monitor_params[] =
{
CN_BACKEND_READ_TIMEOUT,
MXS_MODULE_PARAM_DURATION,
"1s",
"3s",
MXS_MODULE_OPT_DURATION_S
},
{
CN_BACKEND_WRITE_TIMEOUT,
MXS_MODULE_PARAM_DURATION,
"2s",
"3s",
MXS_MODULE_OPT_DURATION_S
},
{

View File

@ -2,10 +2,10 @@
threads=###threads###
log_warning=1
[MySQL Monitor]
[MySQL-Monitor]
type=monitor
module=mysqlmon
servers=server1,server3,server4,server5,server6,server7,server8,server9,server10,server11,server12,server13,server14,server15
servers=###server_line###
user=maxskysql
password= skysql
@ -19,7 +19,7 @@ module=regexfilter
match=fetch
replace=select
[RW Split Router]
[RW-Split-Router]
type=service
router= readwritesplit
servers=###server_line###
@ -31,7 +31,7 @@ slave_selection_criteria=LEAST_BEHIND_MASTER
filters=hints|regex
[Read Connection Router Slave]
[Read-Connection-Router-Slave]
type=service
router=readconnroute
router_options= slave
@ -39,7 +39,7 @@ servers=server1,server2,server3,server4
user=maxskysql
password=skysql
[Read Connection Router Master]
[Read-Connection-Router-Master]
type=service
router=readconnroute
router_options=master
@ -47,22 +47,22 @@ servers=server1,server2,server3,server4
user=maxskysql
password=skysql
[RW Split Listener]
[RW-Split-Listener]
type=listener
service=RW Split Router
service=RW-Split-Router
protocol=MySQLClient
port=4006
#socket=/tmp/rwsplit.sock
[Read Connection Listener Slave]
[Read-Connection-Listener-Slave]
type=listener
service=Read Connection Router Slave
service=Read-Connection-Router-Slave
protocol=MySQLClient
port=4009
[Read Connection Listener Master]
[Read-Connection-Listener-Master]
type=listener
service=Read Connection Router Master
service=Read-Connection-Router-Master
protocol=MySQLClient
port=4008
@ -70,7 +70,7 @@ port=4008
type=service
router=cli
[CLI Listener]
[CLI-Listener]
type=listener
service=CLI
protocol=maxscaled