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...
mainserviceexplainexplain_entriesexplain_periodmax_request_lagon_errorpercentileqps_windowreportreset_replicationretain_faster_statementsretain_slower_statementssamplesThis release of MariaDB MaxScale introduces powerful new features. It includes Workload Capture and Replay for production traffic analysis and a Diff Router for comparing server behavior.
MyServer1 to MariaDB_112 is stopped.otherignoreon_discrepancynever$ 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 var$ sudo mkdir /var/log/maxscale
$ sudo mkdir /var/lib/maxscale
$ sudo mkdir /run/maxscale
$ sudo mkdir /var/cache/maxscale$ sudo chown maxscale /var/log/maxscale
$ sudo chown maxscale /var/lib/maxscale
$ sudo chown maxscale /run/maxscale
$ sudo chown maxscale /var/cache/maxscale$ sudo bin/maxscale --user=maxscale -d$ sudo bin/maxscale --user=maxscale --basedir=/usr/local/maxscale -d$ tar -xzvf maxscale-x.y.z.OS.tar.gz$ cd maxscale-x.y.z.OS
$ bin/maxscale -d --basedir=.$ bin/maxscale --help#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;
}[MyServer1]
type=server
address=192.168.1.2
port=3306
[MyService]
type=service
router=readwritesplit
servers=MyServer1
...[MariaDB_112]
type=server
address=192.168.1.3
port=3306
protocol=mariadbbackendmaxctrl call command diff create DiffMyService MyService MyServer1 MariaDB_112
{
"status": "Diff service 'DiffMyService' created. Server 'MariaDB_112' ready to be evaluated."
}maxctrl list services
┌───────────────┬────────────────┬─────────────┬───────────────────┬────────────────────────┐
│ Service │ Router │ Connections │ Total Connections │ Targets │
├───────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────┤
│ MyService │ readwritesplit │ 0 │ 0 │ MyServer1 │
├───────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────┤
│ DiffMyService │ diff │ 0 │ 0 │ MyServer1, MariaDB_112 │
└───────────────┴────────────────┴─────────────┴───────────────────┴────────────────────────┘maxctrl call command diff start DiffMyService
{
"sessions": {
"suspended": 0,
"total": 0
},
"state": "synchronizing",
"sync_state": "suspending_sessions"
}maxctrl list services
┌───────────────┬────────────────┬─────────────┬───────────────────┬────────────────────────┐
│ Service │ Router │ Connections │ Total Connections │ Targets │
├───────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────┤
│ MyService │ readwritesplit │ 0 │ 0 │ DiffMyService │
├───────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────┤
│ DiffMyService │ diff │ 0 │ 0 │ MyServer1, MariaDB_112 │
└───────────────┴────────────────┴─────────────┴───────────────────┴────────────────────────┘{
"sessions": {
"suspended": 0,
"total": 0
},
"state": "synchronizing",
"sync_state": "suspending_sessions"
}maxctrl call command diff status DiffMyService
{
"sessions": {
"suspended": 0,
"total": 0
},
"state": "comparing",
"sync_state": "not_applicable"
}maxctrl call command diff summary DiffMyService
OKMyServer1_2024-05-07_140323.json
MariaDB_112_2024-05-07_140323.jsonmaxctrl call command diff stop DiffMyService
{
"sessions": {
"suspended": 0,
"total": 0
},
"state": "stopping",
"sync_state": "suspending_sessions"
}maxctrl call command diff destroy DiffMyService
OKmaxvisualize MyServer1_2024-05-07_140323.json MariaDB_112_2024-05-07_140323.json{
"id": 1,
"session": 1,
"command": "COM_QUERY",
"query": "select @@version_comment limit 1",
"results": [
{
"target": "MyServer1",
"checksum": "0f491b37",
"rows": 1,
"warnings": 0,
"duration": 257805,
"type": "resultset",
"explain": { ... }
},
{
"target": "MariaDB_112",
"checksum": "0f491b37",
"rows": 1,
"warnings": 0,
"duration": 170043,
"type": "resultset",
"explain": { ... }
}
]
}RESET SLAVE
START SLAVEadmin:mariadb. The users used by the
REST API are the same that are used by the MaxAdmin network interface. This
means that any users created for the MaxAdmin network interface should work with
the MaxScale REST API and MaxCtrl.[maxctrl]
u = my-name
p = my-passwordUsage: list servers
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all servers in MaxScale.
Field | Description
----- | -----------
Server | Server name
Address | Address where the server listens
Port | The port on which the server listens
Connections | Current connection count
State | Server state
GTID | Current value of @@gtid_current_pos
Monitor | The monitor for this serverUsage: list services
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all services and the servers they use.
Field | Description
----- | -----------
Service | Service name
Router | Router used by the service
Connections | Current connection count
Total Connections | Total connection count
Targets | Targets that the service usesUsage: list listeners [service]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List listeners of all services. If a service is given, only listeners for that service are listed.
Field | Description
----- | -----------
Name | Listener name
Port | The port where the listener listens
Host | The address or socket where the listener listens
State | Listener state
Service | Service that this listener points toUsage: list monitors
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all monitors in MaxScale.
Field | Description
----- | -----------
Monitor | Monitor name
State | Monitor state
Servers | The servers that this monitor monitorsUsage: list sessions
Options:
--rdns Perform a reverse DNS lookup on client IPs [boolean] [default: false]
--version Show version number [boolean]
--help Show help [boolean]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
List all client sessions.
Field | Description
----- | -----------
Id | Session ID
User | Username
Host | Client host address
Connected | Time when the session started
Idle | How long the session has been idle, in seconds
Service | The service where the session connected
Memory | Memory usage (not exhaustive)Usage: list filters
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all filters in MaxScale.
Field | Description
----- | -----------
Filter | Filter name
Service | Services that use the filter
Module | The module that the filter usesUsage: list modules
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all currently loaded modules.
Field | Description
----- | -----------
Module | Module name
Type | Module type
Version | Module versionUsage: list threads
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all worker threads.
Field | Description
----- | -----------
Id | Thread ID
Current FDs | Current number of managed file descriptors
Total FDs | Total number of managed file descriptors
Load (1s) | Load percentage over the last second
Load (1m) | Load percentage over the last minute
Load (1h) | Load percentage over the last hourUsage: list users
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List network the users that can be used to connect to the MaxScale REST API.
Field | Description
----- | -----------
Name | User name
Type | User type
Privileges | User privileges
Created | When the user was created
Last Updated | The last time the account password was updated
Last Login | The last time the user logged inUsage: list commands
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all available module commands.
Field | Description
----- | -----------
Module | Module name
Commands | Available commandsUsage: list queries
List queries options:
-l, --max-length Maximum SQL length to display. Use --max-length=0 for no limit. [number] [default: 120]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
List all active queries being executed through MaxScale. In order for this command to work, MaxScale must be configured with 'retain_last_statements' set to a value greater than 0.Usage: show server <server>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about a server. The `Parameters` field contains the currently configured parameters for this server. See `--help alter server` for more details about altering server parameters.
Field | Description
----- | -----------
Server | Server name
Source | File where the object is stored in
Address | Address where the server listens
Port | The port on which the server listens
State | Server state
Version | Server version
Uptime | Server uptime in seconds
Last Event | The type of the latest event
Triggered At | Time when the latest event was triggered at
Services | Services that use this server
Monitors | Monitors that monitor this server
Master ID | The server ID of the master
Node ID | The node ID of this server
Slave Server IDs | List of slave server IDs
Current Connections | Current connection count
Total Connections | Total cumulative connection count
Max Connections | Maximum number of concurrent connections ever seen
Statistics | Server statistics
Parameters | Server parametersUsage: show servers
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about all servers.
Field | Description
----- | -----------
Server | Server name
Source | File where the object is stored in
Address | Address where the server listens
Port | The port on which the server listens
State | Server state
Version | Server version
Uptime | Server uptime in seconds
Last Event | The type of the latest event
Triggered At | Time when the latest event was triggered at
Services | Services that use this server
Monitors | Monitors that monitor this server
Master ID | The server ID of the master
Node ID | The node ID of this server
Slave Server IDs | List of slave server IDs
Current Connections | Current connection count
Total Connections | Total cumulative connection count
Max Connections | Maximum number of concurrent connections ever seen
Statistics | Server statistics
Parameters | Server parametersUsage: show service <service>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about a service. The `Parameters` field contains the currently configured parameters for this service. See `--help alter service` for more details about altering service parameters.
Field | Description
----- | -----------
Service | Service name
Source | File where the object is stored in
Router | Router that the service uses
State | Service state
Started At | When the service was started
Users Loaded At | When the users for the service were loaded
Current Connections | Current connection count
Total Connections | Total connection count
Max Connections | Historical maximum connection count
Cluster | The cluster that the service uses
Servers | Servers that the service uses
Services | Services that the service uses
Filters | Filters that the service uses
Parameters | Service parameter
Router Diagnostics | Diagnostics provided by the router moduleUsage: show services
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about all services.
Field | Description
----- | -----------
Service | Service name
Source | File where the object is stored in
Router | Router that the service uses
State | Service state
Started At | When the service was started
Users Loaded At | When the users for the service were loaded
Current Connections | Current connection count
Total Connections | Total connection count
Max Connections | Historical maximum connection count
Cluster | The cluster that the service uses
Servers | Servers that the service uses
Services | Services that the service uses
Filters | Filters that the service uses
Parameters | Service parameter
Router Diagnostics | Diagnostics provided by the router moduleUsage: show monitor <monitor>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about a monitor. The `Parameters` field contains the currently configured parameters for this monitor. See `--help alter monitor` for more details about altering monitor parameters.
Field | Description
----- | -----------
Monitor | Monitor name
Source | File where the object is stored in
Module | Monitor module
State | Monitor state
Servers | The servers that this monitor monitors
Parameters | Monitor parameters
Monitor Diagnostics | Diagnostics provided by the monitor moduleUsage: show monitors
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about all monitors.
Field | Description
----- | -----------
Monitor | Monitor name
Source | File where the object is stored in
Module | Monitor module
State | Monitor state
Servers | The servers that this monitor monitors
Parameters | Monitor parameters
Monitor Diagnostics | Diagnostics provided by the monitor moduleUsage: show session <session>
Options:
--rdns Perform a reverse DNS lookup on client IPs [boolean] [default: false]
--version Show version number [boolean]
--help Show help [boolean]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Show detailed information about a single session. The list of sessions can be retrieved with the `list sessions` command. The <session> is the session ID of a particular session.
The `Connections` field lists the servers to which the session is connected and the `Connection IDs` field lists the IDs for those connections.
Field | Description
----- | -----------
Id | Session ID
Service | The service where the session connected
State | Session state
User | Username
Host | Client host address
Port | Client network port
Database | Current default database of the connection
Connected | Time when the session started
Idle | How long the session has been idle, in seconds
Parameters | Session parameters
Client TLS Cipher | Client TLS cipher
Connections | Ordered list of backend connections
Connection IDs | Thread IDs for the backend connections
Queries | Query history
Log | Per-session log messages
Memory | Memory usage (not exhaustive)Usage: show sessions
Options:
--rdns Perform a reverse DNS lookup on client IPs [boolean] [default: false]
--version Show version number [boolean]
--help Show help [boolean]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Show detailed information about all sessions. See `--help show session` for more details.
Field | Description
----- | -----------
Id | Session ID
Service | The service where the session connected
State | Session state
User | Username
Host | Client host address
Port | Client network port
Database | Current default database of the connection
Connected | Time when the session started
Idle | How long the session has been idle, in seconds
Parameters | Session parameters
Client TLS Cipher | Client TLS cipher
Connections | Ordered list of backend connections
Connection IDs | Thread IDs for the backend connections
Queries | Query history
Log | Per-session log messages
Memory | Memory usage (not exhaustive)Usage: show filter <filter>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The list of services that use this filter is show in the `Services` field.
Field | Description
----- | -----------
Filter | Filter name
Source | File where the object is stored in
Module | The module that the filter uses
Services | Services that use the filter
Parameters | Filter parameters
Diagnostics | Filter diagnosticsUsage: show filters
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information of all filters.
Field | Description
----- | -----------
Filter | Filter name
Source | File where the object is stored in
Module | The module that the filter uses
Services | Services that use the filter
Parameters | Filter parameters
Diagnostics | Filter diagnosticsUsage: show listener <listener>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Field | Description
----- | -----------
Name | Listener name
Source | File where the object is stored in
Service | Services that the listener points to
Parameters | Listener parametersUsage: show filters
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information of all filters.
Field | Description
----- | -----------
Filter | Filter name
Source | File where the object is stored in
Module | The module that the filter uses
Services | Services that use the filter
Parameters | Filter parameters
Diagnostics | Filter diagnosticsUsage: show module <module>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command shows all available parameters as well as detailed version information of a loaded module.
Field | Description
----- | -----------
Module | Module name
Type | Module type
Version | Module version
Maturity | Module maturity
Description | Short description about the module
Parameters | All the parameters that the module accepts
Commands | Commands that the module providesUsage: show modules
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Displays detailed information about all modules.
Field | Description
----- | -----------
Module | Module name
Type | Module type
Version | Module version
Maturity | Module maturity
Description | Short description about the module
Parameters | All the parameters that the module accepts
Commands | Commands that the module providesUsage: show maxscale
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
See `--help alter maxscale` for more details about altering MaxScale parameters.
Field | Description
----- | -----------
Version | MaxScale version
Commit | MaxScale commit ID
Started At | Time when MaxScale was started
Activated At | Time when MaxScale left passive mode
Uptime | Time MaxScale has been running
Config Sync | MaxScale configuration synchronization
Parameters | Global MaxScale parameters
System | System InformationUsage: show thread <thread>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show detailed information about a worker thread.
Field | Description
----- | -----------
Id | Thread ID
State | The state of the thread
Accepts | Number of TCP accepts done by this thread
Reads | Number of EPOLLIN events
Writes | Number of EPOLLOUT events
Hangups | Number of EPOLLHUP and EPOLLRDUP events
Errors | Number of EPOLLERR events
Avg event queue length | Average number of events returned by one epoll_wait call
Max event queue length | Maximum number of events returned by one epoll_wait call
Max exec time | The longest time spent processing events returned by a epoll_wait call
Max queue time | The longest time an event had to wait before it was processed
Current FDs | Current number of managed file descriptors
Total FDs | Total number of managed file descriptors
Load (1s) | Load percentage over the last second
Load (1m) | Load percentage over the last minute
Load (1h) | Load percentage over the last hour
QC cache size | Query classifier size
QC cache inserts | Number of times a new query was added into the query classification cache
QC cache hits | How many times a query classification was found in the query classification cache
QC cache misses | How many times a query classification was not found in the query classification cache
QC cache evictions | How many times a query classification result was evicted from the query classification cache
Sessions | The current number of sessions
Zombies | The current number of zombie connections, waiting to be discarded
Memory | The current (partial) memory usageUsage: show threads
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
--kind The kind of threads to display, only the running or all. [string] [choices: "running", "all"] [default: "running"]
Show detailed information about all worker threads.
Field | Description
----- | -----------
Id | Thread ID
State | The state of the thread
Accepts | Number of TCP accepts done by this thread
Reads | Number of EPOLLIN events
Writes | Number of EPOLLOUT events
Hangups | Number of EPOLLHUP and EPOLLRDUP events
Errors | Number of EPOLLERR events
Avg event queue length | Average number of events returned by one epoll_wait call
Max event queue length | Maximum number of events returned by one epoll_wait call
Max exec time | The longest time spent processing events returned by a epoll_wait call
Max queue time | The longest time an event had to wait before it was processed
Current FDs | Current number of managed file descriptors
Total FDs | Total number of managed file descriptors
Load (1s) | Load percentage over the last second
Load (1m) | Load percentage over the last minute
Load (1h) | Load percentage over the last hour
QC cache size | Query classifier size
QC cache inserts | Number of times a new query was added into the query classification cache
QC cache hits | How many times a query classification was found in the query classification cache
QC cache misses | How many times a query classification was not found in the query classification cache
QC cache evictions | How many times a query classification result was evicted from the query classification cache
Sessions | The current number of sessions
Zombies | The current number of zombie connections, waiting to be discarded
Memory | The current (partial) memory usageUsage: show logging
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
See `--help alter logging` for more details about altering logging parameters.
Field | Description
----- | -----------
Current Log File | The current log file MaxScale is logging into
Enabled Log Levels | List of log levels enabled in MaxScale
Parameters | Logging parametersUsage: show commands <module>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command shows the parameters the command expects with the parameter descriptions.
Field | Description
----- | -----------
Command | Command name
Parameters | Parameters the command supports
Descriptions | Parameter descriptionsUsage: show qc_cache
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show contents (statement and hits) of query classifier cache.Usage: show dbusers <service>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Show information about the database users of the service.
Field | Description
----- | -----------
User | The user name of the account
Host | The host of the account
Plugin | Authentication plugin
TLS | Whether TLS is required from this user
Super | Does the user have a SUPER grant
Global | Does the user have global database access
Proxy | Whether this is a proxy user
Role | The default role for this userUsage: set server <server> <state>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Set options:
--force If combined with the `maintenance` state, this forcefully closes all connections to the target server [boolean] [default: false]
Options:
--version Show version number [boolean]
--help Show help [boolean]
If <server> is monitored by a monitor, this command should only be used to set the server into the `maintenance` or the `drain` state. Any other states will be overridden by the monitor on the next monitoring interval. To manually control server states, use the `stop monitor <name>` command to stop the monitor before setting the server states manually.
When a server is set into the `drain` state, no new connections to it are allowed but existing connections are allowed to gracefully close. Servers with the `Master` status cannot be drained or set into maintenance mode. To clear a state set by this command, use the `clear server` command.
To forcefully close all connections to a server, use `set server <name> maintenance --force`Usage: clear server <server> <state>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command clears a server state set by the `set server <server> <state>` commandUsage: enable log-priority <log>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The `debug` log priority is only available for debug builds of MaxScale.Usage: disable log-priority <log>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The `debug` log priority is only available for debug builds of MaxScale.Usage: create server <name> <host|socket> [port] [params...]
Create server options:
--services Link the created server to these services [array]
--monitors Link the created server to these monitors [array]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The created server will not be used by any services or monitors unless the --services or --monitors options are given. The list of servers a service or a monitor uses can be altered with the `link` and `unlink` commands. If the <host|socket> argument is an absolute path, the server will use a local UNIX domain socket connection. In this case the [port] argument is ignored.
The recommended way of declaring parameters is with the new `key=value` syntax added in MaxScale 6.2.0. Note that for some parameters (e.g. `extra_port` and `proxy_protocol`) this is the only way to pass them. The redundant option parameters have been deprecated in MaxScale 22.08.Usage: create monitor <name> <module> [params...]
Create monitor options:
--servers Link the created monitor to these servers. All non-option arguments after --servers are interpreted as server names e.g. `--servers srv1 srv2 srv3`. [array]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The list of servers given with the --servers option should not contain any servers that are already monitored by another monitor. The last argument to this command is a list of key=value parameters given as the monitor parameters. The redundant option parameters have been deprecated in MaxScale 22.08.Usage: service <name> <router> <params...>
Create service options:
--servers Link the created service to these servers. All non-option arguments after --servers are interpreted as server names e.g. `--servers srv1 srv2 srv3`. [array]
--filters Link the created service to these filters. All non-option arguments after --filters are interpreted as filter names e.g. `--filters f1 f2 f3`. [array]
--services Link the created service to these services. All non-option arguments after --services are interpreted as service names e.g. `--services svc1 svc2 svc3`. [array]
--cluster Link the created service to this cluster (i.e. a monitor) [string]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The last argument to this command is a list of key=value parameters given as the service parameters. If the --servers, --services or --filters options are used, they must be defined after the service parameters. The --cluster option is mutually exclusive with the --servers and --services options.
Note that the `user` and `password` parameters must be defined.Usage: filter <name> <module> [params...]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The last argument to this command is a list of key=value parameters given as the filter parameters.Usage: create listener <service> <name> <port> [params...]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The new listener will be taken into use immediately. The last argument to this command is a list of key=value parameters given as the listener parameters. These parameters override any parameters set via command line options: e.g. using `protocol=mariadb` will override the `--protocol=cdc` option. The redundant option parameters have been deprecated in MaxScale 22.08.Usage: create user <name> <password>
Create user options:
--type Type of user to create [string] [choices: "admin", "basic"] [default: "basic"]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
By default the created user will have read-only privileges. To make the user an administrative user, use the `--type=admin` option. Basic users can only perform `list` and `show` commands.Usage: create report <file>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The generated report contains the state of all the objects in MaxScale as well as all other required information needed to diagnose problems.Usage: destroy server <name>
Destroy options:
--force Remove the server from monitors and services before destroying it [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The server must be unlinked from all services and monitor before it can be destroyed.Usage: destroy monitor <name>
Destroy options:
--force Remove monitored servers from the monitor before destroying it [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The monitor must be unlinked from all servers before it can be destroyed.Usage: destroy listener { <listener> | <service> <listener> }
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Destroying a listener closes the listening socket, opening it up for immediate reuse. If only one argument is given and it is the name of a listener, it is unconditionally destroyed. If two arguments are given and they are a service and a listener, the listener is only destroyed if it is for the given service.Usage: destroy service <name>
Destroy options:
--force Remove filters, listeners and servers from service before destroying it [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The service must be unlinked from all servers and filters. All listeners for the service must be destroyed before the service itself can be destroyed.Usage: destroy filter <name>
Destroy options:
--force Automatically remove the filter from all services before destroying it [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The filter must not be used by any service when it is destroyed.Usage: destroy user <name>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The last remaining administrative user cannot be removed. Create a replacement administrative user before attempting to remove the last administrative user.Usage: destroy session <id>
Destroy options:
--ttl Give session this many seconds to gracefully close [number] [default: 0]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This causes the client session with the given ID to be closed. If the --ttl option is used, the session is given that many seconds to gracefully stop. If no TTL value is given, the session is closed immediately.Usage: link service <name> <target...>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command links targets to a service, making them available for any connections that use the service. A target can be a server, another service or a cluster (i.e. a monitor). Before a server is linked to a service, it should be linked to a monitor so that the server state is up to date. Newly linked targets are only available to new connections, existing connections will use the old list of targets. If a monitor (a cluster of servers) is linked to a service, the service must not have any other targets linked to it.Usage: link monitor <name> <server...>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Linking a server to a monitor will add it to the list of servers that are monitored by that monitor. A server can be monitored by only one monitor at a time.Usage: unlink service <name> <target...>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command unlinks targets from a service, removing them from the list of available targets for that service. New connections to the service will not use the unlinked targets but existing connections can still use the targets. A target can be a server, another service or a cluster (a monitor).Usage: unlink monitor <name> <server...>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command unlinks servers from a monitor, removing them from the list of monitored servers. The servers will be left in their current state when they are unlinked from a monitor.Usage: start service <name>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This starts a service stopped by `stop service <name>`Usage: start listener <name>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This starts a listener stopped by `stop listener <name>`Usage: start monitor <name>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This starts a monitor stopped by `stop monitor <name>`Usage: start [services|maxscale]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command will execute the `start service` command for all services in MaxScale.Usage: stop service <name>
Stop options:
--force Close existing connections after stopping the service [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Stopping a service will prevent all the listeners for that service from accepting new connections. Existing connections will still be handled normally until they are closed.Usage: stop listener <name>
Stop options:
--force Close existing connections after stopping the listener [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Stopping a listener will prevent it from accepting new connections. Existing connections will still be handled normally until they are closed.Usage: stop monitor <name>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Stopping a monitor will pause the monitoring of the servers. This can be used to manually control server states with the `set server` command.Usage: stop [services|maxscale]
Stop options:
--force Close existing connections after stopping all services [boolean] [default: false]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command will execute the `stop service` command for all services in MaxScale.Usage: alter server <server> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the server parameters, execute `show server <server>`.
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter monitor <monitor> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the monitor parameters, execute `show monitor <monitor>`
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter service <service> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the service parameters, execute `show service <service
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter service-filters <service> [filters...]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The order of the filters given as the second parameter will also be the order in which queries pass through the filter chain. If no filters are given, all existing filters are removed from the service.
For example, the command `maxctrl alter service-filters my-service A B C` will set the filter chain for the service `my-service` so that A gets the query first after which it is passed to B and finally to C. This behavior is the same as if the `filters=A|B|C` parameter was defined for the service.
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter filter <filter> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the filter parameters, execute `show filter <filter>`. Some filters support runtime configuration changes to all parameters. Refer to the filter documentation for details on whether it supports runtime configuration changes and which parameters can be altered.
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.
Note: To pass options with dashes in them, surround them in both single and double quotes:
maxctrl alter filter my-namedserverfilter target01 '"->master"'Usage: alter listener <listener> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the listener parameters, execute `show listener <listener>`
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter logging <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the logging parameters, execute `show logging`
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter maxscale <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To display the MaxScale parameters, execute `show maxscale`.
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter user <name> <password>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Changes the password for a user. To change the user type, destroy the user and then create it again.Usage: alter session <session> <key=value> ...
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Alter parameters of a session. To get the list of modifiable parameters, use `show session <session>`
The parameters should be given in the `key=value` format. This command also supports the legacy method
of passing parameters as `key value` pairs but the use of this is not recommended.Usage: alter session-filters <session> [filters...]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
The order of the filters given as the second parameter will also be the order in which queries pass through the filter chain. If no filters are given, all existing filters are removed from the session. The syntax is similar to `alter service-filters`.Usage: rotate logs
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command is intended to be used with the `logrotate` command.Usage: reload service <service>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]Usage: reload service <service>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command reloads the TLS certificates for all listeners and servers as well as the REST API in MaxScale. The REST API JWT signature keys are also rotated by this command.Usage: reload session <id>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command reloads the configuration of a session. When a session is reloaded, it internally restarts the MaxScale session. This means that new connections are created and taken into use before the old connections are discarded. The session will use the latest configuration of the service the listener it used pointed to. This means that the behavior of the session can change as a result of a reload if the configuration has changed. If the reloading fails, the old configuration will remain in use. The external session ID of the connection will remain the same as well as any statistics or session level alterations that were done before the reload.Usage: reload sessions
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
This command reloads the configuration of all sessions. When a session is reloaded, it internally restarts the MaxScale session. This means that new connections are created and taken into use before the old connections are discarded. The session will use the latest configuration of the service the listener it used pointed to. This means that the behavior of the session can change as a result of a reload if the configuration has changed. If the reloading fails, the old configuration will remain in use. The external session ID of the connection will remain the same as well as any statistics or session level alterations that were done before the reload.Usage: call command <module> <command> [params...]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
Options:
--version Show version number [boolean]
--help Show help [boolean]
To inspect the list of module commands, execute `list commands`Usage: get <resource> [path]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
API options:
--sum Calculate sum of API result. Only works for arrays of numbers e.g. `api get --sum servers data[].attributes.statistics.connections`. [boolean] [default: false]
--pretty Pretty-print output. [boolean] [default: false]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Perform a raw REST API call. The path definition uses JavaScript syntax to extract values. For example, the following command extracts all server states as an array of JSON values: maxctrl api get servers data[].attributes.stateUsage: post <resource> <value>
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
API options:
--sum Calculate sum of API result. Only works for arrays of numbers e.g. `api get --sum servers data[].attributes.statistics.connections`. [boolean] [default: false]
--pretty Pretty-print output. [boolean] [default: false]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Perform a raw REST API call. The provided value is passed as-is to the REST API after building it with JSON.parseUsage: patch <resource> [path]
Global Options:
-c, --config MaxCtrl configuration file [string] [default: "~/.maxctrl.cnf"]
-u, --user Username to use [string] [default: "admin"]
-p, --password Password for the user. To input the password manually, use -p '' or --password='' [string] [default: "mariadb"]
-h, --hosts List of MaxScale hosts. The hosts must be in HOST:PORT format and each value must be separated by a comma. [string] [default: "127.0.0.1:8989"]
-t, --timeout Request timeout in plain milliseconds, e.g '-t 1000', or as duration with suffix [h|m|s|ms], e.g. '-t 10s' [string] [default: "10000"]
-q, --quiet Silence all output. Ignored while in interactive mode. [boolean] [default: false]
--tsv Print tab separated output [boolean] [default: false]
--skip-sync Disable configuration synchronization for this command [boolean] [default: false]
HTTPS/TLS Options:
-s, --secure Enable HTTPS requests [boolean] [default: false]
--tls-key Path to TLS private key [string]
--tls-passphrase Password for the TLS private key [string]
--tls-cert Path to TLS public certificate [string]
--tls-ca-cert Path to TLS CA certificate [string]
-n, --tls-verify-server-cert Whether to verify server TLS certificates [boolean] [default: true]
API options:
--sum Calculate sum of API result. Only works for arrays of numbers e.g. `api get --sum servers data[].attributes.statistics.connections`. [boolean] [default: false]
--pretty Pretty-print output. [boolean] [default: false]
Options:
--version Show version number [boolean]
--help Show help [boolean]
Perform a raw REST API call. The provided value is passed as-is to the REST API after building it with JSON.parse$ maxkeys$ chown maxscale:maxscale /var/lib/maxscale/.secrets$ maxpasswd plaintextpassword
96F99AA1315BDC3604B006F427DD9484[MariaDB-Service]
type=service
router=readwritesplit
servers=MariaDB1,MariaDB2,MariaDB3
user=maxscale-user
password=96F99AA1315BDC3604B006F427DD9484[maxscale]
admin_host=127.0.0.1
admin_port=2222[maxscale]
admin_host=10.0.0.3
admin_port=2222[maxscale]
admin_secure_gui=true
admin_ssl_key=/certs/maxscale-key.pem
admin_ssl_cert=/certs/maxscale-cert.pem
admin_ssl_ca_cert=/certs/ca-cert.pem$ maxctrl --user=my_user --password=my_password --secure --tls-ca-cert=/certs/ca-cert.pem --tls-verify-server-cert=false show maxscale$ maxctrl create user my_user my_password --type=admin$ maxctrl destroy user admin[maxscale]
admin_audit = true
admin_audit_file = /var/log/maxscale/audit_files/audit.csv$ maxctrl rotate logs[MariaDB-Server1]
type=server
ssl=true
ssl_verify_peer_certificate=trueSecure your MariaDB MaxScale deployment with authenticators. These modules manage client authentication with backend servers, supporting diverse mechanisms for enhanced security.
Explore the connectors available for MariaDB MaxScale 25.01. This section details the MaxScale CDC Connector, a C++ API allowing applications to consume a stream of database change events.
Filters in MariaDB MaxScale intercept and modify database traffic. Use them to transform, block, or log queries, enabling fine-grained control over your database workload and security.
Protocol modules in MariaDB MaxScale interpret client-server communication. This section covers the available protocols, including the MariaDB, NoSQL, and Change Data Capture (CDC) modules.
Manage MariaDB MaxScale programmatically using the REST API. This interface allows for the dynamic administration and monitoring of MaxScale resources like servers, services, and listeners.
Routers are the core of MariaDB MaxScale services, intelligently managing database traffic. This section details available routers, from read-write splitting to sharding and replication.
Get hands-on experience with MariaDB MaxScale 25.01. These tutorials provide step-by-step instructions for common tasks like setting up read-write splitting, failover, and sharding.
Monitors are essential for high availability, tracking the status of backend servers. They detect failures, promote replicas, and enable automatic failover, ensuring service continuity.
This is your starting point for MariaDB MaxScale 25.01. Find essential guides for installation, learn how to configure MaxScale for your needs, and explore tutorials to get up and running.
maxctrl call command cdc add_user <service> <name> <password>CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';
GRANT REPLICATION CLIENT ON *.* TO 'monitor_user'@'%';GRANT SUPER, RELOAD on *.* to 'monitor_user'@'%';maxkeys[MyListener]
type=listener
authenticator=mariadbauth
authenticator_options=clear_pw_passthrough=true
ssl=true
<other options>[PsReuse]
type=filter
module=psreuse
[MyService]
...
filters=PsReusebash$ cdc_users.py [-h] USER PASSWORDbash$ cdc_users.py user1 pass1 >> /var/lib/maxscale/avro-service/cdcusers[MyListener]
type=listener
service=MyService
protocol=mariadbprotocol
mariadbprotocol.allow_replication=false
port=3306[concat-service]
type=service
router=cat
servers=dbserv1,dbserv2,dbserv3
user=maxscale
password=maxscale_pwmaxpasswd plainpassword
96F99AA1315BDC3604B006F427DD9484[My-Service]
type=service
router=readconnroute
router_options=master
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=96F99AA1315BDC3604B006F427DD9484[Splitter-Service]
type=service
router=readwritesplit
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw[Splitter-Listener]
type=listener
service=Splitter-Service
port=3306[MyComment]
type=filter
module=comment
inject="Comment to be injected"
[MyService]
type=service
router=readwritesplit
servers=server1
user=myuser
password=mypasswd
filters=MyComment[IPComment]
type=filter
module=comment
inject="IP=$IP"
[MyService]
type=service
router=readwritesplit
servers=server1
user=myuser
password=mypasswd
filters=IPCommentSELECT user FROM people;/* IP=::ffff:127.0.0.1 */SELECT user FROM people;[Write-Service]
type=service
router=readconnroute
router_options=master
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw
[Read-Service]
type=service
router=readconnroute
router_options=slave
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw[Write-Listener]
type=listener
service=Write-Service
port=3306
[Read-Listener]
type=listener
service=Read-Service
port=3307[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=ed25519authauthenticator_options=ed_mode=sha256authenticator_options=ed_mode=sha256,
ed_rsa_privkey_path=/tmp/sha_private_key.pem,
ed_rsa_pubkey_path=/tmp/sha_public_key.pem[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=ed25519auth,mariadbauth
user_mapping_file=/home/joe/mapping.json{
"user_map": [
{
"original_user": "alpha",
"mapped_user": "beta"
},
{
"original_user": "gamma",
"mapped_user": "gamma"
}
],
"server_credentials": [
{
"mapped_user": "beta",
"password": "hunter2",
"plugin": "mysql_native_password"
},
{
"mapped_user": "gamma",
"password": "letmein",
"plugin": "ed25519"
}
]
}[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=ed25519auth
authenticator_options=ed_mode=sha256
ssl=true
ssl_key=/tmp/my-key.pem
ssl_cert=/tmp/my-cert.pem
ssl_ca=/tmp/myCA.pem[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=ed25519auth
authenticator_options=ed_mode=sha256,
ed_rsa_privkey_path=/tmp/sha_private_key.pem,
ed_rsa_pubkey_path=/tmp/sha_public_key.pemopenssl genrsa -out sha_private_key.pem 2048
openssl rsa -in sha_private_key.pem -pubout -out sha_public_key.pemsudo yum -y install epel-release
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++ gitBEGIN and START TRANSACTION SQL commands withSTART TRANSACTION READ ONLY. If the transaction is fully read-only, the
transaction completes normally. However, if a write happens in the middle of a
transaction, the filter issues a ROLLBACK command and then replays the
read-only part of the transaction, including the original BEGIN statement. If
the results of the replayed read-only part of the transaction is identical to
the one that was returned to the client, the transaction proceeds normally. If
the result checksum does not match, the connection is closed to prevent a write
with the wrong transaction state from happening.[OptimisticTrx]
type=filter
module=optimistictrx
[MyService]
...
filters=OptimisticTrx[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-345maxctrl create filter OptimisticTrx optimistictrx
maxctrl alter service-filter MyService OptimisticTrx[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=4000[Throttle]
type = filter
module = throttlefilter
max_qps = 500
throttling_duration = 60000
...
[Routing-Service]
type = service
filters = Throttlesysctl vm.overcommit_memorycat /proc/sys/vm/overcommit_memorytar -caf maxscale-backup.tar.gz /etc/maxscale.cnf /etc/maxscale.cnf.d/ /var/lib/maxscale/authenticator=GSSAPIAuth
authenticator_options=principal_name=mariadb/localhost.localdomain@EXAMPLE.COMauthenticator_options=principal_name=mymariadb@EXAMPLE.COM,gssapi_keytab_path=/home/user/mymariadb.keytaberrorok2 (0b00010) Reached max_resultset_rows or max_resultset_size is logged.slavesyncedrunning[MaxRows]
type=filter
module=maxrows
[MaxRows-Routing-Service]
type=service
...
filters=MaxRowsmax_resultset_rows=1000max_resultset_size=128KiMariaDB [(test)]> select * from test.t4;
ERROR 1415 (0A000): Row limit/size exceeded for query: select * from test.t4debug=2[MaxRows]
type=filter
module=maxrows
max_resultset_rows=10000
max_resultset_size=256000git 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 ./postinstmake
LD_LIBRARY_PATH=$PWD/server/core/ make packagerouter_options=slave
router_options=master,slave[Read-Service]
type=service
router=readconnroute
servers=replica1,replica2,replica3
router_options=slave[MyFilter]
type=filter
module=xxxfilter[Split-Service]
type=service
router=readwritesplit
servers=dbserver1,dbserver2,dbserver3,dbserver4
user=massi
password=6628C50E07CCE1F0392EDEEB9D1203F3
filters=hints | top10[top30]
type=filter
module=topfilter
count=30
filebase=/var/log/DBSessions/top30[BubbleGame]
type=service
router=readwritesplit
servers=dbbubble1,dbbubble2,dbbubble3,dbbubble4,dbbubble5
user=maxscale
password=6628C50E07CCE1F0392EDEEB9D1203F3[CassandraDB]
type=server
address=192.168.4.28
port=3306
[Cassandra]
type=service
router=readconnroute
router_options=running
servers=CassandraDB
user=maxscale
password=6628C50E07CCE1F0392EDEEB9D1203F3[HighScores]
type=filter
module=teefilter
match=insert.*HighScore.*values
service=Cassandra[BubbleGame]
type=service
router=readwritesplit
servers=dbbubble1,dbbubble2,dbbubble3,dbbubble4,dbbubble5
user=maxscale
password=6628C50E07CCE1F0392EDEEB9D1203F3
filters=HighScoresINSERT INTO departments VALUES ('d1234', 'NewDepartment'); -- maxscale ccr=ignorematch=.*INSERT.*
ignore=.*UPDATE.*
options=case,extended[CCRFilter]
type=filter
module=ccrfilter
time=5[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=CreateTableFilterbinlog_format=row
binlog_row_image=full# The Replication Proxy service
[replication-service]
type=service
router=binlogrouter
server_id=4000
master_id=3000
filestem=binlog
user=maxuser
password=maxpwd
# The Avro conversion service
[avro-service]
type=service
router=avrorouter
source=replication-service
filestem=binlog
start_index=15
# The listener for the replication-service
[replication-listener]
type=listener
service=replication-service
port=3306
# The client listener for the avro-service
[avro-listener]
type=listener
service=avro-service
protocol=CDC
port=4001CHANGE MASTER TO MASTER_HOST='172.18.0.1',
MASTER_PORT=3000,
MASTER_LOG_FILE='binlog.000015',
MASTER_LOG_POS=4,
MASTER_USER='maxuser',
MASTER_PASSWORD='maxpwd';
START SLAVE;CREATE TABLE test.t1 (id INT);
INSERT INTO test.t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);maxctrl call command cdc add_user avro-service maxuser maxpwdcdc.py -u maxuser -p maxpwd -h 127.0.0.1 -P 4001 test.t1{"namespace": "MaxScaleChangeDataSchema.avro", "type": "record", "name": "ChangeRecord", "fields": [{"name": "domain", "type": "int"}, {"name": "server_id", "type": "int"}, {"name": "sequence", "type": "int"}, {"name": "event_number", "type": "int"}, {"name": "timestamp", "type": "int"}, {"name": "event_type", "type": {"type": "enum", "name": "EVENT_TYPES", "symbols": ["insert", "update_before", "update_after", "delete"]}}, {"name": "id", "type": "int", "real_type": "int", "length": -1}]}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 1, "timestamp": 1537429419, "event_type": "insert", "id": 1}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 2, "timestamp": 1537429419, "event_type": "insert", "id": 2}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 3, "timestamp": 1537429419, "event_type": "insert", "id": 3}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 4, "timestamp": 1537429419, "event_type": "insert", "id": 4}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 5, "timestamp": 1537429419, "event_type": "insert", "id": 5}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 6, "timestamp": 1537429419, "event_type": "insert", "id": 6}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 7, "timestamp": 1537429419, "event_type": "insert", "id": 7}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 8, "timestamp": 1537429419, "event_type": "insert", "id": 8}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 9, "timestamp": 1537429419, "event_type": "insert", "id": 9}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 10, "timestamp": 1537429419, "event_type": "insert", "id": 10}
CREATE USER 'maxscale'@'%' IDENTIFIED BY 'maxscale_pw';
GRANT SELECT ON mysql.user TO 'maxscale'@'%';
GRANT SELECT ON mysql.db TO 'maxscale'@'%';
GRANT SELECT ON mysql.tables_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.columns_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.procs_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.proxies_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.roles_mapping TO 'maxscale'@'%';
GRANT SHOW DATABASES ON *.* TO 'maxscale'@'%';CREATE USER 'jdoe'@'maxscale-host' IDENTIFIED BY 'my_secret_password';MariaDB [(none)]> SHOW GRANTS FOR 'jdoe'@'client-host';
+-----------------------------------------------------------------------+
| Grants for jdoe@client-host |
+-----------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'jdoe'@'client-host' |
+-----------------------------------------------------------------------+
1 row in set (0.01 sec)GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'jdoe'@'maxscale-host';[maxscale]
threads=autosudo systemctl start maxscalesudo service maxscale start% sudo maxctrl list services
┌──────────────────┬────────────────┬─────────────┬───────────────────┬───────────────────────────┐
│ Service │ Router │ Connections │ Total Connections │ Servers │
├──────────────────┼────────────────┼─────────────┼───────────────────┼───────────────────────────┤
│ Splitter-Service │ readwritesplit │ 1 │ 1 │ dbserv1, dbserv2, dbserv3 │
└──────────────────┴────────────────┴─────────────┴───────────────────┴───────────────────────────┘
% sudo maxctrl list servers
┌─────────┬─────────────┬──────┬─────────────┬─────────────────┬───────────┐
│ Server │ Address │ Port │ Connections │ State │ GTID │
├─────────┼─────────────┼──────┼─────────────┼─────────────────┼───────────┤
│ dbserv1 │ 192.168.2.1 │ 3306 │ 0 │ Master, Running │ 0-3000-62 │
├─────────┼─────────────┼──────┼─────────────┼─────────────────┼───────────┤
│ dbserv2 │ 192.168.2.2 │ 3306 │ 0 │ Slave, Running │ 0-3000-62 │
├─────────┼─────────────┼──────┼─────────────┼─────────────────┼───────────┤
│ dbserv3 │ 192.168.2.3 │ 3306 │ 0 │ Slave, Running │ 0-3000-62 │
└─────────┴─────────────┴──────┴─────────────┴─────────────────┴───────────┘
% sudo maxctrl list listeners Splitter-Service
┌───────────────────┬──────┬──────┬─────────┐
│ Name │ Port │ Host │ State │
├───────────────────┼──────┼──────┼─────────┤
│ Splitter-Listener │ 3306 │ │ Running │
└───────────────────┴──────┴──────┴─────────┘routeQuerycaseextendedserver4server1# 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 masterfunction createInstance(name)
end
function newSession(user, host)
end
function closeSession()
end
function routeQuery()
end
function clientReply()
end
function diagnostic()
end[MyLuaFilter]
type=filter
module=luafilter
global_script=/path/to/script.luaf = io.open("/tmp/test.log", "a+")
function createInstance(name)
f:write("createInstance for " .. name .. "\n")
end
function newSession(user, host)
f:write("newSession for: " .. user .. "@" .. host .. "\n")
end
function closeSession()
f:write("closeSession\n")
end
function routeQuery()
f:write("routeQuery: " .. mxs_get_sql() .. " -- type: " .. mxs_qc_get_type_mask() .. " operation: " .. mxs_qc_get_operation() .. "\n")
end
function clientReply()
f:write("clientReply: " .. mxs_get_replier() .. "\n")
end
function diagnostic()
f:write("diagnostics\n")
return "Hello from Lua!"
end[NamedServerFilter]
type=filter
module=namedserverfilter
match01=^Select.*TableOne$
target01=server2,server3
match22=^SELECT.*TableTwo$
target22=->master
[MyService]
type=service
router=readwritesplit
servers=server1,server2,server3
user=myuser
password=mypasswd
filters=NamedServerFiltermatch01=^SELECT
options=case,extendedtarget01=MyServer2source=127.0.0.1source=192.%.%.%
source=192.168.%.%
source=192.168.10.%source=192.168.21.3,192.168.10.%user=john[NamedServerFilter]
type=filter
module=namedserverfilter
match02= *from *users
target02=server2
[MyService]
type=service
router=readwritesplit
servers=server1,server2
user=myuser
password=mypasswd
filters=NamedServerFilter[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
...[RWS-Row]
type=service
router=readwritesplit
servers = row_server_1, row_server_2, ...[RWS-Row-Listener]
type=listener
service=RWS-Row
socket=/tmp/rws-row.sock[RWS-Column]
type = service
router = readwritesplit
servers = column_server_1, column_server_2, ...
[RWS-Column-Listener]
type = listener
service = RWS-Column
socket = /tmp/rws-col.sock[SmartQuery]
type = service
router = smartrouter
targets = RWS-Row, RWS-Column
master = RWS-Row
[SmartQuery-Listener]
type = listener
service = SmartQuery
port = <port>[maxscale]
[row_server_1]
type = server
address = <ip>
port = <port>
[row_server_2]
type = server
address = <ip>
port = <port>
[Row-Monitor]
type = monitor
module = mariadbmon
servers = row_server_1, row_server_2
user = <user>
password = <password>
monitor_interval = 2000ms
[column_server_1]
type = server
address = <ip>
port = <port>
[Column-Monitor]
type = monitor
module = csmon
servers = column_server_1
user = <user>
password = <password>
monitor_interval = 2000ms
# Row Read write split
[RWS-Row]
type = service
router = readwritesplit
servers = row_server_1, row_server_2
user = <user>
password = <password>
[RWS-Row-Listener]
type = listener
service = RWS-Row
socket = /tmp/rws-row.sock
# Columnstore Read write split
[RWS-Column]
type = service
router = readwritesplit
servers = column_server_1
user = <user>
password = <password>
[RWS-Column-Listener]
type = listener
service = RWS-Column
socket = /tmp/rws-col.sock
# Smart Query router
[SmartQuery]
type = service
router = smartrouter
targets = RWS-Row, RWS-Column
master = RWS-Row
user = <user>
password = <password>
[SmartQuery-Listener]
type = listener
service = SmartQuery
port = <port>[server1]
type=server
address=192.168.121.51
port=3306
[server2]
...
[server3]
...
[server4]
...
[TheMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3,server4
...$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Down │
├─────────┼─────────────────┼──────┼─────────────┼────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴────────────────┘$ maxctrl call command mariadbmon failover TheMonitor
OK$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Down │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘[TheMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3,server4
auto_failover=true
...$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬────────────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼────────────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Down │
├─────────┼─────────────────┼──────┼─────────────┼────────────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Master, Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼────────────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼────────────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴────────────────────────┘[TheMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3,server4
auto_rejoin=true
...$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Down │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘$ maxctrl call command mariadbmon switchover TheMonitor server1 server2
OK$ maxctrl list servers
┌─────────┬─────────────────┬──────┬─────────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Master, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Slave, Running │
├─────────┼─────────────────┼──────┼─────────────┼─────────────────┤
│ server4 │ 192.168.121.201 │ 3306 │ 0 │ Slave, Running │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘LOAD DATA INFILE 'S3://my-bucket/my-data.csv' INTO TABLE t1
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';[LDI-Filter]
type=filter
module=ldi
host=s3.amazonaws.com
region=us-east-1SET @maxscale.ldi.s3_key='<my-access-key>', @maxscale.ldi.s3_secret='<my-secret-key>';LOAD DATA INFILE 'S3://my-bucket/my-data.csv' INTO TABLE t1;GET /v1/users/inet/:name{
"data": {
"attributes": {
"account": "admin",
"created": "Fri, 05 Jan 2024 07:23:54 GMT",
"last_login": "Fri, 05 Jan 2024 07:24:11 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
},
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
}
}GET /v1/users/inet{
"data": [
{
"attributes": {
"account": "admin",
"created": "Fri, 05 Jan 2024 07:23:54 GMT",
"last_login": "Fri, 05 Jan 2024 07:24:11 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}GET /v1/users/unix/:nameGET /v1/users/unixGET /v1/users{
"data": [
{
"attributes": {
"account": "admin",
"created": "Fri, 05 Jan 2024 07:23:54 GMT",
"last_login": "Fri, 05 Jan 2024 07:24:11 GMT",
"last_update": null,
"name": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}POST /v1/users/inet{
"data": {
"id": "my-user", // The user to create
"type": "inet", // The type of the user
"attributes": {
"password": "my-password", // The password to use for the user
"account": "basic" // The type of the account
}
}
}Status: 204 No ContentPOST /v1/users/unix{
"data": {
"id": "jdoe", // Account name
"type": "unix" // Account type
"attributes": {
"account": "basic" // Type of the user account in MaxScale
}
}
}Status: 204 No ContentDELETE /v1/users/inet/:nameStatus: 204 No ContentDELETE /v1/users/unix/:nameStatus: 204 No ContentPATCH /v1/users/inet/:name{
"data": {
"attributes": {
"password": "new-password"
}
}
}Status: 204 No Content# Install MaxScale
apt update
apt -y install sudo curl
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
apt -y install maxscale-- Create the user for the service
--https://app.gitbook.com/o/diTpXxF5WsbHqTReoBsS/s/0pSbu5DcMSW4KwAkUcmX/maxscale-archive/archive-of-2x.xx-versions/mariadb-maxscale-23.08/mariadb-maxscale-23-08-authenticators/mariadb-maxscale-2308-authentication-modules#required-grants
CREATE USER 'service_user'@'%' IDENTIFIED BY 'secret';
GRANT SELECT ON mysql.* TO 'service_user'@'%';
GRANT SHOW DATABASES ON *.* TO 'service_user'@'%';
-- Create the user for the monitor
-- https://app.gitbook.com/o/diTpXxF5WsbHqTReoBsS/s/0pSbu5DcMSW4KwAkUcmX/maxscale-archive/archive-of-2x.xx-versions/mariadb-maxscale-23.08/mariadb-maxscale-23-08-authenticators/mariadb-maxscale-2308-authentication-modules#required-grants
CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'secret';
GRANT REPLICATION CLIENT ON *.* TO 'monitor_user'@'%';
-- Create the application user
-- https://app.gitbook.com/o/diTpXxF5WsbHqTReoBsS/s/0pSbu5DcMSW4KwAkUcmX/maxscale-archive/archive-of-2x.xx-versions/mariadb-maxscale-23.08/mariadb-maxscale-23-08-authenticators/mariadb-maxscale-2308-authentication-modules#limitations-and-troubleshooting
CREATE USER app_user@'%' IDENTIFIED BY 'secret';
GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO app_user@'%';CREATE DATABASE IF NOT EXISTS customer_01;
CREATE TABLE IF NOT EXISTS customer_01.accounts(id INT, account_type INT, account_name VARCHAR(255));
INSERT INTO customer_01.accounts VALUES (1, 1, 'foo');
-- The shared schema that's on all shards
CREATE DATABASE IF NOT EXISTS shared_info;
CREATE TABLE IF NOT EXISTS shared_info.account_types(account_type INT, type_name VARCHAR(255));
INSERT INTO shared_info.account_types VALUES (1, 'admin'), (2, 'user');CREATE DATABASE IF NOT EXISTS customer_02;
CREATE TABLE IF NOT EXISTS customer_02.accounts(id INT, account_type INT, account_name VARCHAR(255));
INSERT INTO customer_02.accounts VALUES (2, 2, 'bar');
-- The shared schema that's on all shards
CREATE DATABASE IF NOT EXISTS shared_info;
CREATE TABLE IF NOT EXISTS shared_info.account_types(account_type INT, type_name VARCHAR(255));
INSERT INTO shared_info.account_types VALUES (1, 'admin'), (2, 'user');[db-01]
type=server
address=192.168.0.102
port=3306
[db-02]
type=server
address=192.168.0.103
port=3306[Sharded-Service]
type=service
router=schemarouter
targets=db-02,db-01
user=service_user
password=secret
ignore_tables_regex=.*[Sharded-Service-Listener]
type=listener
service=Sharded-Service
port=4000[Shard-Monitor]
type=monitor
module=galeramon
servers=db-02,db-01
user=monitor_user
password=secret[db-01]
type=server
address=192.168.0.102
port=3306
[db-02]
type=server
address=192.168.0.103
port=3306
[Sharded-Service]
type=service
router=schemarouter
targets=db-02,db-01
user=service_user
password=secret
ignore_tables_regex=.*
[Sharded-Service-Listener]
type=listener
service=Sharded-Service
protocol=MariaDBClient
port=4000
[Shard-Monitor]
type=monitor
module=galeramon
servers=db-02,db-01
user=monitor_user
password=secretsystemctl start maxscale.service$ mariadb -A -u app_user -psecret -h 127.0.0.1 -P 4000
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.11.7-MariaDB-1:10.11.7+maria~ubu2004-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> USE customer_01;
Database changed
MariaDB [customer_01]> SELECT c.account_name, c.account_type, s.type_name FROM accounts c
-> JOIN shared_info.account_types s ON (c.account_type = s.account_type);
+--------------+--------------+-----------+
| account_name | account_type | type_name |
+--------------+--------------+-----------+
| foo | 1 | admin |
+--------------+--------------+-----------+
1 row in set (0.001 sec)
MariaDB [customer_01]> USE customer_02;
Database changed
MariaDB [customer_02]> SELECT c.account_name, c.account_type, s.type_name FROM accounts c
-> JOIN shared_info.account_types s ON (c.account_type = s.account_type);
+--------------+--------------+-----------+
| account_name | account_type | type_name |
+--------------+--------------+-----------+
| bar | 2 | user |
+--------------+--------------+-----------+
1 row in set (0.000 sec)MariaDB [(none)]> SELECT c.account_name, c.account_type, s.type_name FROM customer_01.accounts c
-> JOIN shared_info.account_types s ON (c.account_type = s.account_type);
+--------------+--------------+-----------+
| account_name | account_type | type_name |
+--------------+--------------+-----------+
| foo | 1 | admin |
+--------------+--------------+-----------+
1 row in set (0.001 sec)
MariaDB [(none)]> SELECT c.account_name, c.account_type, s.type_name FROM customer_02.accounts c
-> JOIN shared_info.account_types s ON (c.account_type = s.account_type);
+--------------+--------------+-----------+
| account_name | account_type | type_name |
+--------------+--------------+-----------+
| bar | 2 | user |
+--------------+--------------+-----------+
1 row in set (0.001 sec)MariaDB [(none)]> SELECT * FROM customer_01.accounts UNION SELECT * FROM customer_02.accounts;
ERROR 1146 (42S02): Table 'customer_01.accounts' doesn't exist
MariaDB [(none)]> USE customer_01;
Database changed
MariaDB [customer_01]> SELECT * FROM customer_01.accounts UNION SELECT * FROM customer_02.accounts;
ERROR 1146 (42S02): Table 'customer_02.accounts' doesn't exist
MariaDB [customer_01]> USE customer_02;
Database changed
MariaDB [customer_02]> SELECT * FROM customer_01.accounts UNION SELECT * FROM customer_02.accounts;
ERROR 1146 (42S02): Table 'customer_01.accounts' doesn't existcaseextendedfiltersSCRAM-SHA-256SCRAM-SHA-512keyfilekafka[DataMartFilter]
type=filter
module=tee
target=DataMart
[Data-Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=DataMartFiltermatch=/insert.*into.*order*/exclude=/select.*from.*t1/options=case,extendedsource=127.0.0.1user=john[Orders]
type=service
router=readconnroute
servers=server1, server2, server3, server4
user=massi
password=6628C50E07CCE1F0392EDEEB9D1203F3
filters=ReplicateOrders
[ReplicateOrders]
type=filter
module=tee
target=DataMart
match=insert[ ]*into[ ]*orders
[DataMart]
type=service
router=readconnroute
servers=datamartserver
user=massi
password=6628C50E07CCE1F0392EDEEB9D1203F3
filters=QLA-DataMart
[QLA-DataMart]
type=filter
module=qlafilter
options=/var/log/DataMart/InsertsLog
[Orders-Listener]
type=listener
target=Orders
port=4011
[DataMart-Listener]
type=listener
target=DataMart
port=4012GET /v1/filters/:name{
"data": {
"attributes": {
"filter_diagnostics": null,
"module": "qlafilter",
"parameters": {
"append": false,
"duration_unit": "ms",
"exclude": null,
"filebase": "/tmp/qla.log",
"flush": true,
"log_data": "date,user,query",
"log_type": "unified",
"match": null,
"module": "qlafilter",
"newline_replacement": " ",
"options": "",
"separator": ",",
"source": null,
"source_exclude": null,
"source_match": null,
"use_canonical_form": false,
"user": null,
"user_exclude": null,
"user_match": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "QLA",
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/QLA/relationships/services/"
}
}
},
"type": "filters"
},
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
}
}GET /v1/filters{
"data": [
{
"attributes": {
"filter_diagnostics": null,
"module": "qlafilter",
"parameters": {
"append": false,
"duration_unit": "ms",
"exclude": null,
"filebase": "/tmp/qla.log",
"flush": true,
"log_data": "date,user,query",
"log_type": "unified",
"match": null,
"module": "qlafilter",
"newline_replacement": " ",
"options": "",
"separator": ",",
"source": null,
"source_exclude": null,
"source_match": null,
"use_canonical_form": false,
"user": null,
"user_exclude": null,
"user_match": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "QLA",
"links": {
"self": "http://localhost:8989/v1/filters/QLA/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/QLA/relationships/services/"
}
}
},
"type": "filters"
},
{
"attributes": {
"module": "hintfilter",
"parameters": {
"module": "hintfilter"
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
}
},
"id": "Hint",
"links": {
"self": "http://localhost:8989/v1/filters/Hint/"
},
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/filters/Hint/relationships/services/"
}
}
},
"type": "filters"
}
],
"links": {
"self": "http://localhost:8989/v1/filters/"
}
}POST /v1/filters{
"data": {
"id": "test-filter", // Name of the filter
"type": "filters",
"attributes": {
"module": "qlafilter", // The filter uses the qlafilter module
"parameters": { // Filter parameters
"filebase": "/tmp/qla.log"
}
}
}
}PATCH /v1/filters/:name{
"data": {
"attributes": {
"parameters": {
"match": ".*users.*"
}
}
}
}DELETE /v1/filters/:filterCREATE TABLE IF NOT EXISTS my_table (
data JSON NOT NULL,
id VARCHAR(1024) AS (JSON_EXTRACT(data, '$._id')) UNIQUE KEY
);CREATE TABLE IF NOT EXISTS my_table (
data LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
id VARCHAR(1024) AS (JSON_EXTRACT(data, '$._id')) UNIQUE KEY,
CONSTRAINT data_is_json CHECK(JSON_VALID(data)),
CONSTRAINT id_is_not_null CHECK(JSON_EXTRACT(data, '$._id') IS NOT NULL)
);`my database`.`my table`CREATE TABLE IF NOT EXISTS my_table (data JSON NOT NULL);[server1]
type=server
address=127.0.0.1
port=3000
[server2]
type=server
address=127.0.0.1
port=3001
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2
user=maxuser
password=maxpwd
monitor_interval=2s
[Mirror-Router]
type=service
router=mirror
user=maxuser
password=maxpwd
targets=server1,server2
main=server1
exporter=file
file=/tmp/Mirror-Router.log
[Mirror-Listener]
type=listener
service=Mirror-Router
port=3306CREATE USER 'maxscale'@'maxscalehost' IDENTIFIED BY 'maxscale-password';
GRANT REPLICA MONITOR ON *.* TO 'maxscale-user'@'maxscalehost';GRANT REPLICATION CLIENT ON *.* TO 'maxscale-user'@'maxscalehost';GRANT SUPER ON *.* TO 'maxscale'@'maxscalehost';[Galera-Monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
user=myuser
password=mypwdSET GLOBAL wsrep_sst_donor = "galera001,galera000"[node-1]
type=server
address=192.168.122.101
port=3306
priority=1
[node-2]
type=server
address=192.168.122.102
port=3306
priority=3
[node-3]
type=server
address=192.168.122.103
port=3306
priority=2
[node-4]
type=server
address=192.168.122.104
port=3306
priority=-1%%
# options
regex_grammar: Native
case_sensitive: true
what_if: false
continue_if_matched: false
ignore_whitespace: true
%
# match template
@{1:^}select @{2} from my_table where id = @{3}
%
# replace template
select @{2} from my_table where id = @{3}%%
# use default options by leaving this blank
%
@{1:^}select count(distinct @{2}) from @{3}
%
select count(*) from (select distinct @{1} from @{2}) as t123
Input: select count(distinct author) from books where entity != "AI"
Rewritten: select count(*) from (select distinct author from books where entity != "AI") as t123%%
%
from mytable
%
from mytable force index (myindex)
Input: select name from mytable where id=42
Rewritten: select name from mytable force index (myindex) where id=42%%
%
@{1:^}select @{2} from mytable
%
select @{2} from mytable force index (myindex)%%
%
@{1:^}select zip_code from address_book where str_id = @{1:["]}@{2:[[:digit:]]+}@{3:["]}
%
select zip_code from address_book where id = @{2}
Input: select zip_code from address_book where str_id = "1234"
Rewritten: select zip_code from address_book where id = 1234%%
regex_grammar: EPosix
continue_if_matched: true
%
wrong_table_name
%
correct_table_name
%%
regex_grammar: EPosix
%
wrong_column_name
%
correct_column_name[Rewrite]
type = filter
module = rewritefilter
template_file = /path/to/template_file.rf
...
[Router]
type=service
...
filters=Rewrite%%
options
%
match template
%
replace templatecase_sensitive: true%%
case_sensitive: false
%
@{1:^}select @{2}
from mytable
where user = @{3}
%
select @{2} from mytable where user = @{3}
and @{3} in (select user from approved_users){ "templates" :
[
{
"case_sensitive" : false,
"match_template" : "@{1:^}select @{2} from mytable where user = @{3}",
"replace_template" : "select @{2} from mytable where user = @{3}
and @{3} in (select user from approved_users)"
}
]
}maxctrl alter filter Rewrite log_replacement=falsemaxctrl create user my_user my_password --type=admin
maxctrl destroy user adminadmin_ssl_key=/certs/server-key.pem
admin_ssl_cert=/certs/server-cert.pem
admin_ssl_ca_cert=/certs/ca-cert.pemmaxctrl --user=my_user --password=my_password --secure --tls-ca-cert=/certs/ca-cert.pem --tls-verify-server-cert=false show maxscaleHTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 0
Last-Modified: Mon, 04 Mar 2019 08:23:09 GMT
ETag: "0"
Date: Mon, 04 Mar 19 08:29:41 GMT{
"links": {
"self": "http://127.0.0.1:8989/v1/filters/"
},
"data": [
{
"id": "Hint",
"type": "filters",
"relationships": {
"services": {
"links": {
"self": "http://127.0.0.1:8989/v1/services/"
},
"data": [
{
"id": "RW-Split-Hint-Router",
"type": "services"
}
]
}
},
"attributes": {
"module": "hintfilter",
"parameters": {}
},
"links": {
"self": "http://127.0.0.1:8989/v1/filters/Hint"
}
},
{
"id": "Logger",
"type": "filters",
"relationships": {
"services": {
"links": {
"self": "http://127.0.0.1:8989/v1/services/"
},
"data": []
}
},
"attributes": {
"module": "qlafilter",
"parameters": {
"match": null,
"exclude": null,
"user": null,
"source": null,
"filebase": "/tmp/log",
"options": "ignorecase",
"log_type": "session",
"log_data": "date,user,query",
"newline_replacement": "\" \"",
"separator": ",",
"flush": false,
"append": false
},
"filter_diagnostics": {
"separator": ",",
"newline_replacement": "\" \""
}
},
"links": {
"self": "http://127.0.0.1:8989/v1/filters/Logger"
}
}
]
}{
"links": {
"self": "http://127.0.0.1:8989/v1/filters/Logger"
},
"data": {
"id": "Logger",
"type": "filters",
"relationships": {
"services": {
"links": {
"self": "http://127.0.0.1:8989/v1/services/"
},
"data": []
}
},
"attributes": {
"module": "qlafilter",
"parameters": {
"match": null,
"exclude": null,
"user": null,
"source": null,
"filebase": "/tmp/log",
"options": "ignorecase",
"log_type": "session",
"log_data": "date,user,query",
"newline_replacement": "\" \"",
"separator": ",",
"flush": false,
"append": false
},
"filter_diagnostics": {
"separator": ",",
"newline_replacement": "\" \""
}
},
"links": {
"self": "http://127.0.0.1:8989/v1/filters/Logger"
}
}
}{
"data": {
"id": "server1",
"type": "servers",
"attributes": {
"parameters": {
"address": "127.0.0.1",
"port": 3003
}
}
}
}curl -X POST -d @new_server.txt 127.0.0.1:8989/v1/serverscurl 127.0.0.1:8989/v1/servers/server1curl 127.0.0.1:8989/v1/servers/server1 > server1.txtcurl -X PATCH -d @server1.txt 127.0.0.1:8989/v1/servers/server1curl 127.0.0.1:8989/v1/servers/server1{
"data": {
"id": "server1",
"type": "servers",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
]
}
},
"attributes": ...
}
}{
"data": {
"relationships": {
"services": {
"data": []
},
"monitors": {
"data": []
}
}
}
}curl -X DELETE 127.0.0.1:8989/v1/servers/server1[MyLogFilter]
type=filter
module=topfilter
[Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=MyLogFilterfilebase=/tmp/SqlQueryLogcount=30match=select.*from.*customer.*where
exclude=where
options=case,extendedsource=127.0.0.1user=john[ProductsUpdateTop20]
type=filter
module=topfilter
count=20
match=UPDATE.*PRODUCTS.*WHERE
exclude=UPDATE.*PRODUCTS_STOCK.*WHERE
filebase=/var/logs/top/ProductsUpdate[SlowAppServer]
type=filter
module=topfilter
count=20
source=192.168.0.32
filebase=/var/logs/top/SlowAppServer[ControlAppServer]
type=filter
module=topfilter
count=20
source=192.168.0.42
filebase=/var/logs/top/ControlAppServer[App-Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=SlowAppServer | ControlAppServer-bash-4.1$ cat /var/logs/top/Employees-top-10.137
Top 10 longest running queries in session.
==========================================
Time (sec) | Query
-----------+-----------------------------------------------------------------
22.985 | select sum(salary), year(from_date) from salaries s, (select distinct year(from_date) as y1 from salaries) y where (makedate(y.y1, 1) between s.from_date and s.to_date) group by y.y1
5.304 | select d.dept_name as "Department", y.y1 as "Year", count(*) as "Count" from departments d, dept_emp de, (select distinct year(from_date) as y1 from dept_emp order by 1) y where d.dept_no = de.dept_no and (makedate(y.y1, 1) between de.from_date and de.to_date) group by y.y1, d.dept_name order by 1, 2
2.896 | select year(now()) - year(birth_date) as age, gender, avg(salary) as "Average Salary" from employees e, salaries s where e.emp_no = s.emp_no and ("1988-08-01" between from_date AND to_date) group by year(now()) - year(birth_date), gender order by 1,2
2.160 | select dept_name as "Department", sum(salary) / 12 as "Salary Bill" from employees e, departments d, dept_emp de, salaries s where e.emp_no = de.emp_no and de.dept_no = d.dept_no and ("1988-08-01" between de.from_date AND de.to_date) and ("1988-08-01" between s.from_date AND s.to_date) and s.emp_no = e.emp_no group by dept_name order by 1
0.845 | select dept_name as "Department", avg(year(now()) - year(birth_date)) as "Average Age", gender from employees e, departments d, dept_emp de where e.emp_no = de.emp_no and de.dept_no = d.dept_no and ("1988-08-01" between from_date AND to_date) group by dept_name, gender
0.668 | select year(hire_date) as "Hired", d.dept_name, count(*) as "Count" from employees e, departments d, dept_emp de where de.emp_no = e.emp_no and de.dept_no = d.dept_no group by d.dept_name, year(hire_date)
0.249 | select moves.n_depts As "No. of Departments", count(moves.emp_no) as "No. of Employees" from (select de1.emp_no as emp_no, count(de1.emp_no) as n_depts from dept_emp de1 group by de1.emp_no) as moves group by moves.n_depts order by 1
0.245 | select year(now()) - year(birth_date) as age, gender, count(*) as "Count" from employees group by year(now()) - year(birth_date), gender order by 1,2
0.179 | select year(hire_date) as "Hired", count(*) as "Count" from employees group by year(hire_date)
0.160 | select year(hire_date) - year(birth_date) as "Age", count(*) as Count from employees group by year(hire_date) - year(birth_date) order by 1
-----------+-----------------------------------------------------------------
Session started Wed Jun 18 18:41:03 2014
Connection from 127.0.0.1
Username massi
Total of 24 statements executed.
Total statement execution time 35.701 seconds
Average statement execution time 1.488 seconds
Total connection time 46.500 seconds
-bash-4.1$GET /v1/sessions/:id{
"data": {
"attributes": {
"client": {
"cipher": "",
"connection_attributes": {
"_client_name": "libmariadb",
"_client_version": "3.3.4",
"_os": "Linux",
"_pid": "502300",
"_platform": "x86_64",
"_server_host": "127.0.0.1"
},
"sescmd_history_len": 1,
"sescmd_history_stored_metadata": 0,
"sescmd_history_stored_responses": 1
},
"connected": "Fri, 05 Jan 2024 07:24:06 GMT",
"connections": [
{
"cipher": "",
"connection_id": 129,
"server": "server1"
}
],
"idle": 5.2000000000000002,
"io_activity": 16,
"log": [],
"memory": {
"connection_buffers": {
"backends": {
"server1": {
"misc": 662,
"readq": 0,
"total": 662,
"writeq": 0
}
},
"client": {
"misc": 654,
"readq": 65536,
"total": 66190,
"writeq": 0
},
"total": 66852
},
"exec_metadata": 0,
"last_queries": 0,
"sescmd_history": 485,
"total": 67337,
"variables": 0
},
"parameters": {
"log_debug": false,
"log_error": false,
"log_info": false,
"log_notice": false,
"log_warning": false
},
"port": 40664,
"queries": [],
"remote": "127.0.0.1",
"seconds_alive": 5.209291554,
"state": "Session started",
"thread": 2,
"user": "maxuser"
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/sessions/1/relationships/services/"
}
}
},
"type": "sessions"
},
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
}
}GET /v1/sessions{
"data": [
{
"attributes": {
"client": {
"cipher": "",
"connection_attributes": {
"_client_name": "libmariadb",
"_client_version": "3.3.4",
"_os": "Linux",
"_pid": "502300",
"_platform": "x86_64",
"_server_host": "127.0.0.1"
},
"sescmd_history_len": 1,
"sescmd_history_stored_metadata": 0,
"sescmd_history_stored_responses": 1
},
"connected": "Fri, 05 Jan 2024 07:24:06 GMT",
"connections": [
{
"cipher": "",
"connection_id": 129,
"server": "server1"
}
],
"idle": 5.2000000000000002,
"io_activity": 16,
"log": [],
"memory": {
"connection_buffers": {
"backends": {
"server1": {
"misc": 662,
"readq": 0,
"total": 662,
"writeq": 0
}
},
"client": {
"misc": 654,
"readq": 65536,
"total": 66190,
"writeq": 0
},
"total": 66852
},
"exec_metadata": 0,
"last_queries": 0,
"sescmd_history": 485,
"total": 67337,
"variables": 0
},
"parameters": {
"log_debug": false,
"log_error": false,
"log_info": false,
"log_notice": false,
"log_warning": false
},
"port": 40664,
"queries": [],
"remote": "127.0.0.1",
"seconds_alive": 5.2105843680000001,
"state": "Session started",
"thread": 2,
"user": "maxuser"
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/sessions/1/"
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/sessions/1/relationships/services/"
}
}
},
"type": "sessions"
}
],
"links": {
"self": "http://localhost:8989/v1/sessions/"
}
}PATCH /v1/sessions/:id{
"data": {
"attributes": {
"parameters": {
"log_info": true
}
}
}
}{
"data": {
"attributes": {
"relationships": {
"filters": {
"data": [
{ "id": "my-cache-filter" },
{ "id": "my-log-filter" }
]
}
}
}
}
}POST /v1/sessions/:id/restartPOST /v1/sessions/restartDELETE /v1/sessions/:idGET /v1/listeners/:name{
"data": {
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4006,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
},
"links": {
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/"
}
}GET /v1/listeners{
"data": [
{
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4006,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
},
{
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4008,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"links": {
"self": "http://localhost:8989/v1/listeners/"
}
}POST /v1/listeners{
"data": {
"id": "my-listener",
"type": "listeners",
"attributes": {
"parameters": {
"port": 3306
}
},
"relationships": {
"services": {
"data": [
{"id": "RW-Split-Router", "type": "services"}
]
}
}
}
}PATCH /v1/listeners/:nameDELETE /v1/listeners/:namePUT /v1/listeners/:name/stopPUT /v1/listeners/:name/startinformation_schemaperformance_schemasysERROR 5000 (DUPDB): Error: duplicate tables found on two different shards.show shards;
Database |Server |
---------|-------------|
db1.t1 |MyServer1 |
db1.t2 |MyServer1 |
db2.t1 |MyServer2 |[Shard-Router]
type=service
router=schemarouter
servers=server1,server2
user=myuser
password=mypwd# Execute this on both servers
CREATE USER 'john'@'%' IDENTIFIED BY 'password';
# Execute this only on the server where you want the queries to go
GRANT SELECT,USAGE ON shard.* TO 'john'@'%';[Shard-Router]
type=service
router=schemarouter
servers=server1,server2
user=myuser
password=mypwd
ignore_tables_regex=^db1|^db2|^db3\.tUSE db;
SELECT * FROM tbl1; // May be routed to an incorrect backend if using table sharding.[MyLogFilter]
type=filter
module=qlafilter
filebase=/tmp/SqlQueryLog
[MyService]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=MyLogFilterfilebase=/tmp/SqlQueryLoguser_match=/(^alice$)|(^bob$)/user_exclude=/(^alice$)|(^bob$)/source_match=/(^127[.]0[.]0[.]1)|(^192[.]168[.]0[.]109)/source_exclude=/(^127[.]0[.]0[.]1)|(^192[.]168[.]0[.]109)/MariaDB [test]> select secret from T where x password="clear text pwd";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MariaDB server version for the right syntax to
use near 'password="clear text pwd"' at line 1newline_replacement=" NL "[ProductsSelectLogger]
type=filter
module=qlafilter
match=SELECT.*from.*PRODUCTS .*
exclude=WHERE.*PRODUCT_ID.*
filebase=/var/logs/qla/SelectProducts
[Product-Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=ProductsSelectLogger07:12:56.324 7/01/2016, SELECT * FROM PRODUCTSpassword_2FAsuidmariadbGRANT PROXY ON ...[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=PAMAuth
[Primary-Server]
type=server
address=123.456.789.10
port=12345auth required pam_unix.so
account required pam_unix.soauthenticator_options=pam_use_cleartext_plugin=1authenticator_options=pam_mode=password_2FAauthenticator_options=pam_backend_mapping=mariadbauthenticator_options=pam_mapped_pw_file=/home/root/passwords.json,pam_backend_mapping=mariadb{
"users_and_passwords": [
{
"user": "my_mapped_user1",
"password": "my_mapped_pw1"
},
{
"user": "my_mapped_user2",
"password": "A6D4C53619FFFF4DF252A0E595EDB0A12CA44E16AF154D0ED08F687E81604BFF42218B4EBA9F3EF8D907CF35E74ABDAA"
}
]
}maxctrl create filter CAPTURE_FLTR wcar
maxctrl link service RWS-Router CAPTURE_FLTRmaxctrl call command wcar start CAPTURE_FLTR <options>maxctrl call command wcar stop CAPTURE_FLTRmaxctrl unlink service RWS-Router CAPTURE_FLTR
maxctrl destroy filter CAPTURE_FLTR[CAPTURE_FLTR]
type=filter
module=wcar
capture_duration=1h # Limit capture duration to one hour
capture_size=1Gi # Limit capture size to 1GiB
start_capture=true # Start capturing immediately after starting MaxScale[server1]
type=server
address=127.0.0.1
port=3306
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1
user=maxuser
password=maxpwd
[CAPTURE_FLTR]
type=filter
module=wcar
capture_duration=1h # Limit capture duration to one hour
capture_size=1Gi # Limit capture size to 1GiB
start_capture=true # Start capturing immediately after starting MaxScale
[RWS-Router]
type=service
router=readwritesplit
cluster=MariaDB-Monitor
user=maxuser
password=maxpwd
filters=CAPTURE_FLTR
[RWS-Listener]
type=listener
service=RWS-Router
protocol=MariaDBClient
port=4006maxctrl call command wcar stop CAPTURE_FLTRtar -caf captures.tar.gz -C /var/lib/maxscale wcarmaxctrl call command wcar <command> <filter> [options]maxctrl call command wcar start CAPTURE_FLTR prefix=Scenario1 size=10Gmaxctrl call command wcar stop CAPTURE_FLTRmaxplayer summary /path/to/capture.cxCREATE USER 'maxreplay'@'%' IDENTIFIED BY 'replay-pw';
GRANT ALL ON *.* TO 'maxreplay'@'%';cd /path/to/capture-dir
tar -xaf captures.tar.gzmaxplayer replay --user maxreplay --password replay-pw --host <host:port> --output baseline-result.csv /path/to/capture.cxmaxplayer replay --user maxreplay --password replay-pw --host <host:port> --output comparison-result.csv /path/to/capture.cxmaxplayer canonicals /path/to/capture.cx > canonicals.csvmaxpostprocess canonicals.csv baseline-result.csv -o baseline-summary.json
maxpostprocess canonicals.csv comparison-result.csv -o comparison-summary.jsonmaxvisualize baseline-summary.json comparison-summary.jsonmaxplayer -u user -p pwd --speed 1.5 -i 5s -o baseline.csv capture_2024-09-06_090002.cx --help
Usage: maxplayer [OPTION]... [COMMAND] FILE
Commands: (default: replay)
summary Show a summary of the capture.
replay Replay the capture.
convert Converts the input file (either .cx or .rx) to a replay file (.rx or .csv).
canonicals List the canonical forms of the captured SQL as CSV.
dump-data Dump capture data as SQL.
show Show the SQL of one or more events.
Options:
--user User name for login to the replay server.
-u This version does not support using the actual user names
that were used during capture.
--password Only clear text passwords are supported as of yet.
-p
--host The address of the replay server in <IP>:<port> format.
-h E.g. 127.0.0.1:4006
--output The name of the output file: e.g. baseline.csv.
-o
--report Periodically report statistics of ongoing operations.
-r The option takes a duration, such as 10s.
--report-file The --report option by default writes to stdout.
-R Provide the name of the file to write to. The file will
be truncated every time it is written to, allowing for a
simple status window by running 'watch cat <path-to-file>'
in a terminal.
--speed The value is a multiplier. 2.5 is 2.5x speed and 0.5 is half speed.
-s A value of zero means no limit, or replay as fast as possible.
A multiplier of 2.5 might not have any effect as the actual time spent
depends on many factors, such as the captured volume and replay server.
--idle-wait Relates to playback speed, and can be used together with --speed.
-i During capture there can be long delays where there is no traffic.
One hour of no capture traffic would mean replay waits for one hour.
idle-wait allows to move simulation time forwards when such gaps
occure. A 'gap' starts when all prior queries have fully executed.
--idle-wait takes a duration value. A negative value turns the feature off,
i.e. the one hour wait would happen.
--idle-wait 0s means time moves to the event start-time immediately
when a gap is detected, i.e., all gaps are skipped over.
--idle-wait 10s means time moves to the event start-time 10 seconds
(wall time) after the gap was detected. Shorter
gaps than 10 seconds will thus be fully waited for.
--idle-wait has a default value of 1 second.
Examples: 1h, 60m, 3600s, 3600000ms, which all define the same duration.
--query-filter Options: none, write-only, read-only. Default: none.
-f Replay can optionally apply only writes or only reads. This option is useful
once the databases to be tested have been prepared (see full documentation)
and optionally either a write-only run, or a full replay has been run.
Now multiple read-only runs against the server(s) are simple as no further
data syncronization is needed.
Note that this mode has its limitations as the query results may
be very different than what they were during capture.
--analyze Enabling this option will track the server Rows_read statistic for each query.
-A This will slow down the overall replay time. The query time measurements
are still valid, but currently this option should only be used when
it is of real value to know how many rows the server read for each query.
--verbose Verbose output. The option can be repeated for more verbosity: -vvv
-v
--version Display the version number and copyrights.
-V
input file: capture_2024-09-06_090002.cx
-h --help true
-u --user user
-p --password pwd
-H --host 127.1.1.0:3306
-o --output baseline.csv
-r --report 0ns
-R --report-file
-s --speed 1.5
-i --idle-wait 5s
-f --query-filter none
-A --analyze false
-v --verbose 0
-V --version 0.2{
"namespace": "MaxScaleChangeDataSchema.avro",
"type": "record",
"name": "ChangeRecord",
"table": "t2", // name of the table
"database": "test", // the database the table is in
"version": 1, // schema version, incremented when the table format changes
"gtid": "0-3000-14", // GTID that created the current version of the table
"fields": [
{
"name": "domain", // First part of the GTID
"type": "int"
},
{
"name": "server_id", // Second part of the GTID
"type": "int"
},
{
"name": "sequence", // Third part of the GTID
"type": "int"
},
{
"name": "event_number", // Sequence number of the event inside the GTID
"type": "int"
},
{
"name": "timestamp", // UNIX timestamp when the event was created
"type": "int"
},
{
"name": "event_type", // Event type
"type": {
"type": "enum",
"name": "EVENT_TYPES",
"symbols": [
"insert", // The row that was inserted
"update_before", // The row before it was updated
"update_after", // The row after it was updated
"delete" // The row that was deleted
]
}
},
{
"name": "id", // Field name
"type": [
"null",
"long"
],
"real_type": "int", // Field type
"length": -1, // Field length, if found
"unsigned": false // Whether the field is unsigned
}
]
}{
"domain": 0,
"server_id": 3000,
"sequence": 20,
"event_number": 1,
"timestamp": 1580485945,
"event_type": "insert",
"id": 1,
"table_name": "t2",
"table_schema": "test"
}[Kafka-CDC]
type=service
router=kafkacdc
servers=server1
user=maxuser
password=maxpwd
bootstrap_servers=127.0.0.1:9092
topic=my-cdc-topic
match=db1[.]
exclude=db1 [.](accounts|users)# The server we're replicating from
[server1]
type=server
address=127.0.0.1
port=3306
# The monitor for the server
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1
user=maxuser
password=maxpwd
monitor_interval=5s
# The MariaDB-to-Kafka CDC service
[Kafka-CDC]
type=service
router=kafkacdc
servers=server1
user=maxuser
password=maxpwd
bootstrap_servers=127.0.0.1:9092
topic=my-cdc-topicruleswarn_type_mismatchlarge_payloadprevent_function_usagerequire_fully_parsedtreat_string_arg_as_fieldcheck_user_variablescheck_unionscheck_subqueriesreplaceobfuscatewithapplies_toexemptedreloadmasking_rules.jsonENUMSETalwaysabort> SELECT name, ssn FROM person;+-------+-------------+
+ name | ssn |
+-------+-------------+
| Alice | 721-07-4426 |
| Bob | 435-22-3267 |
...+-------+-------------+
+ name | ssn |
+-------+-------------+
| Alice | XXX-XX-XXXX |
| Bob | XXX-XX-XXXX |
...CREATE TABLE cheat (revealed_ssn TEXT);
INSERT INTO cheat SELECT ssn FROM users;
SELECT revealed_ssn FROM cheat;mysql> set @@sql_mode = 'ANSI_QUOTES';
mysql> select concat("ssn") from managers;[Mask-SSN]
type=filter
module=masking
rules=...
[SomeService]
type=service
...
filters=Mask-SSNrules=/path/to/rules-filewarn_type_mismatch=alwayslarge_payload=ignoreSELECT CONCAT(masked_column) FROM tbl;prevent_function_usage=falserequire_fully_parsed=falsetreat_string_arg_as_field=falseset @a = (select ssn from customer where id = 1);check_user_variables=falseSELECT a FROM t1 UNION SELECT b FROM t2;check_unions=falseSELECT * FROM (SELECT a AS b FROM t1) AS t2;check_subqueries=false{
"rules": [ ... ]
}{
"rules": [
{
"replace": { ... },
"with": { ... },
"applies_to": [ ... ],
"exempted": [ ... ]
}
]
}{
"rules": [
{
"replace": {
"database": "db1",
"table": "person",
"column": "ssn"
},
"with": { ... },
"applies_to": [ ... ],
"exempted": [ ... ]
}
]
}SELECT ssn FROM person2;SELECT ssn FROM person UNION SELECT ssn FROM person2;SELECT ssn FROM person2 UNION SELECT ssn FROM person2;SELECT ssn FROM person UNION SELECT ssn FROM person;"replace": {
"column": "ssn",
"match": "(123)"
},
"with": {
"fill": "X#"
}"obfuscate": {
"column": "name"
}SELECT name from db1.tbl1;`
+------+
| name |
+------+
| $-~) |
+------+{
"rules": [
{
"replace": {
"column": "ssn"
},
"with": {
"value": "XXX-XX-XXXX"
},
"applies_to": [ ... ],
"exempted": [ ... ]
},
{
"replace": {
"column": "age"
},
"with": {
"fill": "*"
},
"applies_to": [ ... ],
"exempted": [ ... ]
},
{
"replace": {
"column": "creditcard"
},
"with": {
"value": "1234123412341234",
"fill": "0"
},
"applies_to": [ ... ],
"exempted": [ ... ]
},
]
}{
"rules": [
{
"replace": { ... },
"with": { ... },
"applies_to": [ "'alice'@'host'", "'bob'@'%'" ],
"exempted": [ ... ]
}
]
}{
"rules": [
{
"replace": { ... },
"with": { ... },
"applies_to": [ ... ],
"exempted": [ "'admin'" ]
}
]
}MaxScale> call command masking reload MyMaskingFilter[MyMasking]
type=filter
module=masking
warn_type_mismatch=always
large_payload=abort
rules=masking_rules.json
[MyService]
type=service
...
filters=MyMasking{
"rules": [
{
"replace": {
"column": "ssn"
},
"with": {
"value": "012345-ABCD",
"fill": "X"
}
}
]
}monitorsGET /v1/monitors/:name{
"data": {
"attributes": {
"module": "mariadbmon",
"monitor_diagnostics": {
"master": "server1",
"master_gtid_domain_id": 0,
"primary": null,
"server_info": [
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server1",
"read_only": false,
"server_id": 3000,
"slave_connections": [],
"state_details": null
},
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server2",
"read_only": false,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"master_server_name": "server1",
"seconds_behind_master": 0,
"slave_io_running": "Yes",
"slave_sql_running": "Yes",
"using_gtid": "No"
}
],
"state_details": null
}
],
"state": "Idle"
},
"parameters": {
"assume_unique_hostnames": true,
"auto_failover": false,
"auto_rejoin": false,
"backend_connect_attempts": 1,
"backend_connect_timeout": "3000ms",
"backend_read_timeout": "3000ms",
"backend_write_timeout": "3000ms",
"backup_storage_address": null,
"backup_storage_path": null,
"cooperative_monitoring_locks": "none",
"cs_admin_api_key": null,
"cs_admin_base_path": "/cmapi/0.4.0",
"cs_admin_port": 8640,
"demotion_sql_file": null,
"disk_space_check_interval": "0ms",
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"failcount": 5,
"failover_timeout": "90000ms",
"handle_events": true,
"journal_max_age": "28800000ms",
"maintenance_on_low_disk_space": true,
"mariadb-backup_parallel": 1,
"mariadb-backup_use_memory": "1G",
"master_conditions": "primary_monitor_master",
"master_failure_timeout": "10000ms",
"module": "mariadbmon",
"monitor_interval": "1000ms",
"password": "*****",
"promotion_sql_file": null,
"rebuild_port": 4444,
"replication_custom_options": null,
"replication_master_ssl": false,
"replication_password": "*****",
"replication_user": "maxuser",
"script": null,
"script_max_replication_lag": -1,
"script_timeout": "90000ms",
"servers_no_promotion": null,
"slave_conditions": "",
"ssh_check_host_key": true,
"ssh_keyfile": null,
"ssh_port": 22,
"ssh_timeout": "10000ms",
"ssh_user": null,
"switchover_on_low_disk_space": false,
"switchover_timeout": "90000ms",
"type": "monitor",
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 12
},
"id": "MariaDB-Monitor",
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
},
"relationships": {
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/servers/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/services/"
}
}
},
"type": "monitors"
},
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
}
}GET /v1/monitors{
"data": [
{
"attributes": {
"module": "mariadbmon",
"monitor_diagnostics": {
"master": "server1",
"master_gtid_domain_id": 0,
"primary": null,
"server_info": [
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server1",
"read_only": false,
"server_id": 3000,
"slave_connections": [],
"state_details": null
},
{
"gtid_binlog_pos": "0-3000-5",
"gtid_current_pos": "0-3000-5",
"lock_held": null,
"master_group": null,
"name": "server2",
"read_only": false,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"master_server_name": "server1",
"seconds_behind_master": 0,
"slave_io_running": "Yes",
"slave_sql_running": "Yes",
"using_gtid": "No"
}
],
"state_details": null
}
],
"state": "Idle"
},
"parameters": {
"assume_unique_hostnames": true,
"auto_failover": false,
"auto_rejoin": false,
"backend_connect_attempts": 1,
"backend_connect_timeout": "3000ms",
"backend_read_timeout": "3000ms",
"backend_write_timeout": "3000ms",
"backup_storage_address": null,
"backup_storage_path": null,
"cooperative_monitoring_locks": "none",
"cs_admin_api_key": null,
"cs_admin_base_path": "/cmapi/0.4.0",
"cs_admin_port": 8640,
"demotion_sql_file": null,
"disk_space_check_interval": "0ms",
"disk_space_threshold": null,
"enforce_read_only_slaves": false,
"enforce_simple_topology": false,
"enforce_writable_master": false,
"events": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"failcount": 5,
"failover_timeout": "90000ms",
"handle_events": true,
"journal_max_age": "28800000ms",
"maintenance_on_low_disk_space": true,
"mariadb-backup_parallel": 1,
"mariadb-backup_use_memory": "1G",
"master_conditions": "primary_monitor_master",
"master_failure_timeout": "10000ms",
"module": "mariadbmon",
"monitor_interval": "1000ms",
"password": "*****",
"promotion_sql_file": null,
"rebuild_port": 4444,
"replication_custom_options": null,
"replication_master_ssl": false,
"replication_password": "*****",
"replication_user": "maxuser",
"script": null,
"script_max_replication_lag": -1,
"script_timeout": "90000ms",
"servers_no_promotion": null,
"slave_conditions": "",
"ssh_check_host_key": true,
"ssh_keyfile": null,
"ssh_port": 22,
"ssh_timeout": "10000ms",
"ssh_user": null,
"switchover_on_low_disk_space": false,
"switchover_timeout": "90000ms",
"type": "monitor",
"user": "maxuser",
"verify_master_failure": true
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"ticks": 12
},
"id": "MariaDB-Monitor",
"links": {
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/"
},
"relationships": {
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/servers/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/monitors/MariaDB-Monitor/relationships/services/"
}
}
},
"type": "monitors"
}
],
"links": {
"self": "http://localhost:8989/v1/monitors/"
}
}POST /v1/monitors{
data: {
"id": "test-monitor", // Name of the monitor
"type": "monitors",
"attributes": {
"module": "mariadbmon", // The monitor uses the mariadbmon module
"parameters": { // Monitor parameters
"monitor_interval": 1000,
"user": "maxuser,
"password": "maxpwd"
}
},
"relationships": { // List of server relationships that this monitor uses
"servers": {
"data": [ // This monitor uses two servers
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
]
}
}
}
}PATCH /v1/monitors/:namePATCH /v1/monitors/:name/relationships/serversPATCH /v1/monitors/my-monitor/relationships/servers
{
data: [
{ "id": "my-server", "type": "servers" }
]
}PATCH /v1/monitors/my-monitor/relationships/servers
{
data: []
}DELETE /v1/monitors/:namePUT /v1/monitors/:name/stopPUT /v1/monitors/:name/startgtid_start_posserver_idcodecmatchexcludebinlogdiravrodirfilestemstart_indexcooperative_replicationgroup_trxgroup_rowsblock_sizemax_file_sizemax_data_ageavrorouter::convert SERVICE {start | stop}avrorouter::purge SERVICEdeflate[maxscale]
threads=auto
[server1]
type=server
address=127.0.0.1
port=3306
[cdc-service]
type=service
router=avrorouter
servers=server1
user=maxuser
password=maxpwd
[cdc-listener]
type=listener
service=cdc-service
protocol=CDC
port=4001filestem=mybin
binlogdir=/var/lib/mysql/binlogs/[replication-router]
type=service
router=binlogrouter
router_options=server-id=4000,binlogdir=/var/lib/mysql,filestem=binlog
user=maxuser
password=maxpwd
[avro-router]
type=service
router=avrorouter
binlogdir=/var/lib/mysql
filestem=binlog
avrodir=/var/lib/maxscalemysql -ss -u <user> -p -h <host> -P <port> -e 'DESCRIBE `<database>`.`<table>`'|./cdc_one_schema.py <database> <table># On the database server
mysql -ss -u <user> -p -h <host> -P <port> -e 'DESCRIBE `<database>`.`<table>`' > schema.tsv
# On the MaxScale server
./cdc_one_schema.py <database> <table> < schema.tsvusage: cdc_schema.py [--help] [-h HOST] [-P PORT] [-u USER] [-p PASSWORD] DATABASE[avro-converter]
type=service
router=avrorouter
user=myuser
password=mypasswd
router_options=binlogdir=/var/lib/mysql/,
filestem=binlog,
avrodir=/var/lib/maxscale/avro/
[avro-listener]
type=listener
service=avro-converter
protocol=CDC
port=4001cdc.py --user=myuser --password=mypasswd --host=127.0.0.1 --port=4001 test.mytablecdc.py --user=myuser --password=mypasswd --host=127.0.0.1 --port=4001 test.mytable |
cdc_kafka_producer.py --kafka-broker 127.0.0.1:9092 --kafka-topic test.mytable-DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC
moduleuserpasswordserversmonitor_intervalbackend_connect_timeoutbackend_write_timeoutbackend_read_timeoutbackend_connect_attemptsdisk_space_thresholddisk_space_check_intervalscriptscript_timeouteventsjournal_max_age




















master_upslave_downslave_upserver_downserver_uplost_masterlost_slavenew_masternew_slaveservers=MyServer1,MyServer2monitor_interval=2sbackend_connect_timeout=3sbackend_write_timeout=3sbackend_read_timeout=3sbackend_connect_attempts=1[server1]
type=server
...
[server2]
type=server
...
[server3]
type=server
...
[monitor]
type=monitor
servers=server1,server2,server3
disk_space_threshold=/data:80
...[server1]
type=server
disk_space_threshold=/data:80
...
[server2]
type=server
disk_space_threshold=/Data:80
...
[server3]
type=server
disk_space_threshold=/DBData:80
...
[monitor]
type=monitor
servers=server1,server2,server3
...[server1]
type=server
disk_space_threshold=/DbData:80
...
[server2]
type=server
...
[server3]
type=server
...
[monitor]
type=monitor
servers=server1,server2,server3
disk_space_threshold=/data:80
...script=/home/user/myscript.sh initiator=$INITIATOR event=$EVENT live_nodes=$NODELIST/home/user/myscript.sh initiator=[192.168.0.10]:3306 event=master_down live_nodes=[192.168.0.201]:3306,[192.168.0.121]:3306events=master_down,slave_down[MyMonitor]
type=monitor
module=mariadbmon
servers=C1N1,C1N2,C1N3
user=maxscale
password=password
monitor_interval=10s
script=/path/to/maxscale_monitor_alert_script.sh --initiator=$INITIATOR --parent=$PARENT --children=$CHILDREN --event=$EVENT --node_list=$NODELIST --list=$LIST --master_list=$MASTERLIST --slave_list=$SLAVELIST --synced_list=$SYNCEDLISTGET /v1/auth{
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50IjoiYWRtaW4iLCJhdWQiOiJhZG1pbiIsImV4cCI6MTY4OTk1MDgwNCwiaWF0IjoxNjg5OTIyMDA0LCJpc3MiOiJtYXhzY2FsZSIsInN1YiI6ImFkbWluIn0.LRFeXaFAhYNBm7kLIosUpR2nOgd5H-gv3MpuLaCpPvk"
}
}GET /v1/auth?persist=yesGET /v1/auth?max-age=28800Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqwfilter=id=and(ge(50),le(100))filter=id=or(eq(1),eq(5),eq(10))filter=id=not(eq(1),eq(5),eq(10)){
"error": {
"detail" : "The new `/servers/` resource is missing the `port` parameter"
}
}expiration_mode=archive
archivedir = /mnt/binlog-s3
expire_log_minimum_files=3
expire_log_duration=24h
compression_algorithm=zstandard
number_of_noncompressed_files=2zstd --rm -z binlog.001234s3fs my-bucket /home/joe/S3_bucket_mount/ -o umask=0077mariadb -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
CHANGE MASTER TO master_host="primary-IP", master_port=PRIMARY-PORT, master_user=USER, master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;mariadb -u USER -pPASSWORD -h replica-IP -P replica-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="maxscale-IP", master_port=binlog-PORT,
master_user="USER", master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \Gmariadb -u USER -pPASSWORD -h replica-IP -P replica-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="master-IP", master_port=master-PORT,
master_user="USER", master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \Gmariadb -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
CHANGE MASTER TO master_host="primary-IP", master_port=primary-PORT,
master_user=USER,master_password="PASSWORD", master_use_gtid=slave_pos;STOP SLAVE
SET @@global.gtid_slave_pos = "0-1000-1234,1-1001-5678";
START SLAVEmariadb -u USER -pPASSWORD -h replica-IP -P replica-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="maxscale-IP", master_port=binlog-PORT,
master_user="USER", master_password="PASSWORD",
master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \Gmariadb -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
STOP SLAVE;
SET @@global.gtid_slave_pos = "gtid_state";
START SLAVE;mariadb -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
CHANGE MASTER TO master_host="primary-IP", master_port=PRIMARY-PORT, master_user=USER, master_password="PASSWORD", master_use_gtid=slave_pos;
SET @@global.gtid_slave_pos = "gtid_state";
START SLAVE;[mariadb]
log_slave_updates = ON
log_bin = pinloki # binlog file base name. Must be the same on all servers
gtid_domain_id = 1001 # Must be different for each galera server
binlog_format = ROW
[galera]
wsrep_on = ON
wsrep_gtid_mode = ON
wsrep_gtid_domain_id = 42 # Must be the same for all servers[server1]
type=server
address=192.168.0.1
port=3306
[server2]
type=server
address=192.168.0.2
port=3306
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1, server2
user=maxuser
password=maxpwd
monitor_interval=10s
[Replication-Proxy]
type=service
router=binlogrouter
cluster=MariaDB-Monitor
select_master=true
expiration_mode=archive
archivedir=/mnt/somedir
expire_log_minimum_files=3
expire_log_duration=24h
compression_algorithm=zstandard
number_of_noncompressed_files=2
user=maxuser
password=maxpwd
[Replication-Listener]
type=listener
service=Replication-Proxy
port=3306$ 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 │
└────────────────────────┴────────────────┴─────────────┴───────────────────┴────────────────────────────────────┘$ 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 │
└────┴─────────┴──────────────────┴──────────────────────────┴──────┴─────────────────┘maxctrl rotate logs/var/log/maxscale/maxscale.log {
monthly
rotate 5
missingok
nocompress
sharedscripts
postrotate
\# run if maxscale is running
if test -n "`ps acx|grep maxscale`"; then
/usr/bin/maxctrl rotate logs
fi
endscript
}/var/log/maxscale/maxscale.log {
monthly
rotate 5
missingok
nocompress
sharedscripts
postrotate
kill -USR1 `cat /run/maxscale/maxscale.pid`
endscript
}maxctrl set server db-server-3 maintenancemaxctrl clear server db-server-3 maintenancemaxctrl stop service db-servicemaxctrl start service db-servicemaxctrl stop monitor db-monitormaxctrl start monitor db-monitormaxctrl alter maxscale auth_connect_timeout 5smaxctrl create server db-server-1 192.168.0.100 3306maxctrl alter server db-server-1 port 3307maxctrl destroy server db-server-1maxctrl set server db-server-1 drainmaxctrl clear server db-server-1 drainmaxctrl create monitor db-monitor mariadbmon user=db-user password=db-passwordmaxctrl alter monitor db-monitor monitor_interval 1000maxctrl link monitor db-monitor db-server-1maxctrl unlink monitor db-monitor db-server-1maxctrl destroy monitor db-monitormaxctrl create service db-service readwritesplit user=db-user password=db-passwordmaxctrl alter service db-service user new-db-usermaxctrl link service db-service db-server1maxctrl unlink service db-service db-server1maxctrl alter service-filters my-regexfilter my-qlafiltermaxctrl destroy service db-servicemaxctrl create filter regexfilter match=ENGINE=MyISAM replace=ENGINE=InnoDBmaxctrl destroy filter my-regexfiltermaxctrl create listener db-listener db-service 4006maxctrl destroy listener db-listenermaxctrl create user basic-user basic-passwordmaxctrl create user admin-user admin-password --type=adminmaxctrl alter user admin-user new-admin-passwordmaxctrl destroy user basic-userfields[servers]=statedata.attributes.statedata.attributes.statistics.connectionsfields[servers]=statistics/connections$['store']['book']version() or @@version: The version string returned by MaxScale when
a client connects to it.POST /v1/sql/query?token=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqwGET /v1/sql/:id{
"data": {
"attributes": {
"seconds_idle": 0.0013705639999999999,
"sql": null,
"target": "server1",
"thread_id": 10
},
"id": "96be0ffe-10fb-4ed1-8e66-a17ef1eea0fe",
"links": {
"related": "http://localhost:8989/v1/sql/96be0ffe-10fb-4ed1-8e66-a17ef1eea0fe/queries/",
"self": "http://localhost:8989/v1/sql/96be0ffe-10fb-4ed1-8e66-a17ef1eea0fe/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/96be0ffe-10fb-4ed1-8e66-a17ef1eea0fe/"
}
}GET /v1/sql{
"data": [
{
"attributes": {
"seconds_idle": 0.0010341230000000001,
"sql": null,
"target": "server1",
"thread_id": 12
},
"id": "90761656-3352-420b-83e7-0dcef691552a",
"links": {
"related": "http://localhost:8989/v1/sql/90761656-3352-420b-83e7-0dcef691552a/queries/",
"self": "http://localhost:8989/v1/sql/90761656-3352-420b-83e7-0dcef691552a/"
},
"type": "sql"
},
{
"attributes": {
"seconds_idle": 0.002397377,
"sql": null,
"target": "server1",
"thread_id": 11
},
"id": "98a8b5c5-3632-4f0f-98bb-0dc440a3409a",
"links": {
"related": "http://localhost:8989/v1/sql/98a8b5c5-3632-4f0f-98bb-0dc440a3409a/queries/",
"self": "http://localhost:8989/v1/sql/98a8b5c5-3632-4f0f-98bb-0dc440a3409a/"
},
"type": "sql"
}
],
"links": {
"self": "http://localhost:8989/v1/sql/"
}
}POST /v1/sql{
"user": "jdoe",
"password": "my-s3cret",
"target": "server1",
"db": "test",
"timeout": 15
}{
"target": "odbc",
"connection_string": "Driver=MariaDB;SERVER=127.0.0.1;UID=maxuser;PWD=maxpwd"
}{
"data": {
"attributes": {
"seconds_idle": 7.6394000000000001e-5,
"sql": null,
"target": "server1",
"thread_id": 13
},
"id": "f4e38d96-99b4-479e-ac36-5f3b437aff99",
"links": {
"related": "http://localhost:8989/v1/sql/f4e38d96-99b4-479e-ac36-5f3b437aff99/queries/",
"self": "http://localhost:8989/v1/sql/f4e38d96-99b4-479e-ac36-5f3b437aff99/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/f4e38d96-99b4-479e-ac36-5f3b437aff99/"
},
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJmNGUzOGQ5Ni05OWI0LTQ3OWUtYWMzNi01ZjNiNDM3YWZmOTkiLCJleHAiOjE2ODk5NTA4MDQsImlhdCI6MTY4OTkyMjAwNCwiaXNzIjoibXhzLXF1ZXJ5Iiwic3ViIjoiZjRlMzhkOTYtOTliNC00NzllLWFjMzYtNWYzYjQzN2FmZjk5In0.gCKYl7XwwnMLjJbQT6UShDuK8aJ6gessmredQ1i0On4"
}
}DELETE /v1/sql/:idPOST /v1/sql/:id/reconnectPOST /v1/sql/:id/clonePOST /v1/sql/:id/queries{
"sql": "SELECT * FROM test.t1",
"max_rows": 1000
}{
"data": {
"attributes": {
"execution_time": 0.00028492799999999999,
"results": [
{
"complete": true,
"data": [
[
1
],
[
2
],
[
3
]
],
"fields": [
"id"
],
"metadata": [
{
"catalog": "def",
"decimals": 0,
"length": 11,
"name": "id",
"schema": "test",
"table": "t1",
"type": "LONG"
}
]
}
],
"sql": "SELECT id FROM test.t1"
},
"id": "b7243d92-5bc6-4814-80fb-6772831ead4b.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/b7243d92-5bc6-4814-80fb-6772831ead4b/queries/b7243d92-5bc6-4814-80fb-6772831ead4b.1/"
}
}{
"data": {
"attributes": {
"execution_time": 0.00012686699999999999,
"results": [
{
"errno": 1064,
"message": "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TABLE test.t1' at line 1",
"sqlstate": "42000"
}
],
"sql": "SELECT syntax_error FROM TABLE test.t1"
},
"id": "621bacd9-48fd-436c-afda-b4e4d0d7b228.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/621bacd9-48fd-436c-afda-b4e4d0d7b228/queries/621bacd9-48fd-436c-afda-b4e4d0d7b228.1/"
}
}{
"data": {
"attributes": {
"execution_time": 0.000474659,
"results": [
{
"affected_rows": 0,
"last_insert_id": 0,
"warnings": 0
}
],
"sql": "CREATE TABLE test.my_table(id INT)"
},
"id": "60005d40-c034-4aa3-94de-b15c14d9c91c.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/60005d40-c034-4aa3-94de-b15c14d9c91c/queries/60005d40-c034-4aa3-94de-b15c14d9c91c.1/"
}
}{
"data": {
"attributes": {
"execution_time": 0.00014767200000000001,
"results": [
{
"complete": true,
"data": [
[
1
]
],
"fields": [
"1"
],
"metadata": [
{
"catalog": "def",
"decimals": 0,
"length": 1,
"name": "1",
"schema": "",
"table": "",
"type": "LONG"
}
]
}
],
"sql": "SELECT 1"
},
"id": "5999b711-d190-4f0e-8322-db3ce3bd97a2.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/5999b711-d190-4f0e-8322-db3ce3bd97a2/queries/5999b711-d190-4f0e-8322-db3ce3bd97a2.1/"
}
}{
"data": {
"attributes": {
"execution_time": 0.0,
"sql": "SELECT 1"
},
"id": "3d23f7e0-6a83-4282-94a5-8a1089d56f72.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/3d23f7e0-6a83-4282-94a5-8a1089d56f72/queries/3d23f7e0-6a83-4282-94a5-8a1089d56f72.1/"
}
}GET /v1/sql/:id/queries/:query_id{
"data": {
"attributes": {
"execution_time": 0.00011945,
"results": [
{
"complete": true,
"data": [
[
1
]
],
"fields": [
"1"
],
"metadata": [
{
"catalog": "def",
"decimals": 0,
"length": 1,
"name": "1",
"schema": "",
"table": "",
"type": "LONG"
}
]
}
],
"sql": "SELECT 1"
},
"id": "63ec5e96-2bfa-40a9-b631-425b4e3e993c.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/63ec5e96-2bfa-40a9-b631-425b4e3e993c/queries/63ec5e96-2bfa-40a9-b631-425b4e3e993c.1/"
}
}DELETE /v1/sql/:id/queries/:query_idPOST /v1/sql/:id/cancelGET /v1/sql/odbc/drivers{
"data": [
{
"attributes": {
"description": "ODBC for MariaDB",
"driver": "/usr/lib/libmaodbc.so",
"driver64": "/usr/lib64/libmaodbc.so",
"fileusage": "1"
},
"id": "MariaDB",
"type": "drivers"
}
],
"links": {
"self": "http://localhost:8989/v1/sql/odbc/drivers/"
}
}POST /v1/sql/:id/etl/prepare- `mariadb`
Extract data from a MariaDB database.
- `postgresql`
Extract data from a PostgreSQL database. This requires that the PostgreSQL
ODBC driver is installed on the MaxScale server. This driver is often
available in the package manager of your operating system.
- `generic`
Extract data from a generic ODBC source. This uses the ODBC catalog
functions to determine the table layout. The results provided by this are
not as accurate as the specialized versions but it can serve as a good
starting point from which manual modifications to the SQL can be done.
This ETL type requires that the table catalog is provided at the top level
with the `catalog` field. The meaning of the catalog differs between
database implementations.{
"type": "mariadb",
"target": "e2a56d2f-6514-4926-8dba-dca0c4ae3a86",
"tables": [
{
"table": "t1",
"schema": "test"
}
]
}{
"data": {
"attributes": {
"execution_time": 0.0062226729999999997,
"results": {
"ok": true,
"stage": "prepare",
"tables": [
{
"create": "CREATE DATABASE IF NOT EXISTS `test`;\nUSE `test`;\nCREATE TABLE `t1` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `data` varchar(255) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci",
"insert": "INSERT INTO `test`.`t1` (`id`,`data`) VALUES (?,?)",
"schema": "test",
"select": "SELECT `id`,`data` FROM `test`.`t1`",
"table": "t1"
}
]
},
"sql": "ETL"
},
"id": "31dc09b7-ec09-4e6d-b098-e925f706233c.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/31dc09b7-ec09-4e6d-b098-e925f706233c/queries/31dc09b7-ec09-4e6d-b098-e925f706233c.1/"
}
}POST /v1/sql/:id/etl/start{
"data": {
"attributes": {
"execution_time": 0.0094386039999999997,
"results": {
"ok": true,
"stage": "load",
"tables": [
{
"create": "CREATE DATABASE IF NOT EXISTS `test`;\nUSE `test`;\nCREATE TABLE `t1` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `data` varchar(255) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci",
"execution_time": 0.0033923809999999999,
"insert": "INSERT INTO `test`.`t1` (`id`,`data`) VALUES (?,?)",
"rows": 1,
"schema": "test",
"select": "SELECT `id`,`data` FROM `test`.`t1`",
"table": "t1"
}
]
},
"sql": "ETL"
},
"id": "1391b67e-58a7-4be3-b686-2498cb3a0e06.1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/1391b67e-58a7-4be3-b686-2498cb3a0e06/queries/1391b67e-58a7-4be3-b686-2498cb3a0e06.1/"
}
}serversGET /v1/servers/:name{
"data": {
"attributes": {
"gtid_binlog_pos": "0-3000-8",
"gtid_current_pos": "0-3000-8",
"last_event": "master_up",
"lock_held": null,
"master_group": null,
"master_id": -1,
"name": "server1",
"node_id": 3000,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3000,
"priority": 0,
"private_address": null,
"proxy_protocol": false,
"rank": "primary",
"replication_custom_options": null,
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": 0,
"server_id": 3000,
"slave_connections": [],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Master, Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 1,
"time": "0.000100",
"total": 9.0147000000000003e-5
},
{
"count": 3,
"time": "0.001000",
"total": 0.00131908
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 4,
"total_connections": 1
},
"triggered_at": "Fri, 05 Jan 2024 07:23:54 GMT",
"uptime": 2372,
"version_string": "10.6.15-MariaDB-1:10.6.15+maria~ubu2004-log"
},
"id": "server1",
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server1/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server1/relationships/services/"
}
}
},
"type": "servers"
},
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
}
}GET /v1/servers{
"data": [
{
"attributes": {
"gtid_binlog_pos": "0-3000-8",
"gtid_current_pos": "0-3000-8",
"last_event": "master_up",
"lock_held": null,
"master_group": null,
"master_id": -1,
"name": "server1",
"node_id": 3000,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3000,
"priority": 0,
"private_address": null,
"proxy_protocol": false,
"rank": "primary",
"replication_custom_options": null,
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": 0,
"server_id": 3000,
"slave_connections": [],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Master, Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 1,
"time": "0.000100",
"total": 9.0147000000000003e-5
},
{
"count": 3,
"time": "0.001000",
"total": 0.00131908
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 4,
"total_connections": 1
},
"triggered_at": "Fri, 05 Jan 2024 07:23:54 GMT",
"uptime": 2372,
"version_string": "10.6.15-MariaDB-1:10.6.15+maria~ubu2004-log"
},
"id": "server1",
"links": {
"self": "http://localhost:8989/v1/servers/server1/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server1/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server1/relationships/services/"
}
}
},
"type": "servers"
},
{
"attributes": {
"gtid_binlog_pos": "0-3001-12",
"gtid_current_pos": "0-3001-12",
"last_event": "lost_slave",
"lock_held": null,
"master_group": null,
"master_id": 3000,
"name": "server2",
"node_id": 3001,
"parameters": {
"address": "127.0.0.1",
"disk_space_threshold": null,
"extra_port": 0,
"max_routing_connections": 0,
"monitorpw": null,
"monitoruser": null,
"persistmaxtime": "0ms",
"persistpoolmax": 0,
"port": 3001,
"priority": 0,
"private_address": null,
"proxy_protocol": false,
"rank": "primary",
"replication_custom_options": null,
"socket": null,
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX"
},
"read_only": false,
"replication_lag": -1,
"server_id": 3001,
"slave_connections": [
{
"connection_name": "",
"gtid_io_pos": "",
"last_io_error": "",
"last_sql_error": "",
"master_host": "127.0.0.1",
"master_port": 3000,
"master_server_id": 3000,
"seconds_behind_master": null,
"slave_io_running": "No",
"slave_sql_running": "No",
"using_gtid": "No"
}
],
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running",
"state_details": null,
"statistics": {
"active_operations": 0,
"adaptive_avg_select_time": "0ns",
"connection_pool_empty": 0,
"connections": 0,
"failed_auths": 0,
"max_connections": 1,
"max_pool_size": 0,
"persistent_connections": 0,
"response_time_distribution": {
"read": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 1,
"time": "0.001000",
"total": 0.00037632399999999998
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "read",
"range_base": 10
},
"write": {
"distribution": [
{
"count": 0,
"time": "0.000001",
"total": 0.0
},
{
"count": 0,
"time": "0.000010",
"total": 0.0
},
{
"count": 0,
"time": "0.000100",
"total": 0.0
},
{
"count": 0,
"time": "0.001000",
"total": 0.0
},
{
"count": 0,
"time": "0.010000",
"total": 0.0
},
{
"count": 0,
"time": "0.100000",
"total": 0.0
},
{
"count": 0,
"time": "1.000000",
"total": 0.0
},
{
"count": 0,
"time": "10.000000",
"total": 0.0
},
{
"count": 0,
"time": "100.000000",
"total": 0.0
},
{
"count": 0,
"time": "1000.000000",
"total": 0.0
},
{
"count": 0,
"time": "10000.000000",
"total": 0.0
},
{
"count": 0,
"time": "100000.000000",
"total": 0.0
}
],
"operation": "write",
"range_base": 10
}
},
"reused_connections": 0,
"routed_packets": 1,
"total_connections": 1
},
"triggered_at": "Fri, 05 Jan 2024 07:24:07 GMT",
"uptime": 2372,
"version_string": "10.6.15-MariaDB-1:10.6.15+maria~ubu2004-log"
},
"id": "server2",
"links": {
"self": "http://localhost:8989/v1/servers/server2/"
},
"relationships": {
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/servers/server2/relationships/monitors/"
}
},
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/servers/server2/relationships/services/"
}
}
},
"type": "servers"
}
],
"links": {
"self": "http://localhost:8989/v1/servers/"
}
}POST /v1/servers{
"data": {
"id": "server3",
"type": "servers",
"attributes": {
"parameters": {
"address": "127.0.0.1",
"port": 3003
}
}
}
}{
"data": {
"id": "server4",
"type": "servers",
"attributes": {
"parameters": {
"address": "127.0.0.1",
"port": 3002
}
},
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
},
{
"id": "Read-Connection-Router",
"type": "services"
}
]
},
"monitors": {
"data": [
{
"id": "MySQL-Monitor",
"type": "monitors"
}
]
}
}
}
}PATCH /v1/servers/:name{
"data": {
"attributes": {
"parameters": {
"address": "192.168.0.123"
}
}
}
}{
"data": {
"relationships": {
"services": {
"data": [
{ "id": "Read-Connection-Router", "type": "services" }
]
},
"monitors": {
"data": [
{ "id": "MySQL-Monitor", "type": "monitors" }
]
}
}
}
}PATCH /v1/servers/:name/relationships/:typePATCH /v1/servers/my-db-server/relationships/services
{
data: [
{ "id": "my-rwsplit-service", "type": "services" }
]
}PATCH /v1/servers/my-db-server/relationships/services
{
data: []
}DELETE /v1/servers/:namePUT /v1/servers/:name/setPUT /v1/servers/db-server-1/set?state=maintenancePUT /v1/servers/db-server-1/set?state=maintenance&force=yesPUT /v1/servers/:name/clearGET /v1/services/:name{
"data": {
"attributes": {
"connections": 0,
"listeners": [
{
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4008,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"connection_keepalive": "300000ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"force_connection_keepalive": false,
"idle_session_pool_time": "-1ms",
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": true,
"max_connections": 0,
"max_replication_lag": "0ms",
"max_sescmd_history": 50,
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"router": "readconnroute",
"router_options": "master",
"session_trace": false,
"strip_db_esc": true,
"type": "service",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null,
"wait_timeout": "0ms"
},
"router": "readconnroute",
"router_diagnostics": {
"queries": 0,
"server_query_statistics": []
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Fri, 05 Jan 2024 07:23:54 GMT",
"state": "Started",
"statistics": {
"active_operations": 0,
"avg_sescmd_history_length": 0.0,
"avg_session_lifetime": 0.0,
"connections": 0,
"failed_auths": 0,
"max_connections": 0,
"max_sescmd_history_length": 0,
"max_session_lifetime": 0,
"routed_packets": 0,
"total_connections": 0
},
"total_connections": 0,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Fri, 05 Jan 2024 07:23:55 GMT"
},
"id": "Read-Connection-Router",
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
},
{
"id": "Hint",
"type": "filters"
}
],
"links": {
"related": "http://localhost:8989/v1/filters/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/filters/"
}
},
"listeners": {
"data": [
{
"id": "Read-Connection-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/listeners/"
}
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/servers/"
}
}
},
"type": "services"
},
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
}
}GET /v1/services{
"data": [
{
"attributes": {
"connections": 1,
"listeners": [
{
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4006,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "RW-Split-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "RW-Split-Listener",
"relationships": {
"services": {
"data": [
{
"id": "RW-Split-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/RW-Split-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"causal_reads": "none",
"causal_reads_timeout": "10000ms",
"connection_keepalive": "300000ms",
"delayed_retry": false,
"delayed_retry_timeout": "10000ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"force_connection_keepalive": false,
"idle_session_pool_time": "-1ms",
"lazy_connect": false,
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": false,
"master_failure_mode": "fail_on_write",
"master_reconnection": true,
"max_connections": 0,
"max_replication_lag": "0ms",
"max_sescmd_history": 50,
"max_slave_connections": 255,
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"optimistic_trx": false,
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"retry_failed_reads": true,
"reuse_prepared_statements": false,
"router": "readwritesplit",
"session_trace": false,
"slave_connections": 255,
"slave_selection_criteria": "least_current_operations",
"strict_multi_stmt": false,
"strict_sp_calls": false,
"strict_tmp_tables": true,
"strip_db_esc": true,
"transaction_replay": false,
"transaction_replay_attempts": 5,
"transaction_replay_checksum": "full",
"transaction_replay_max_size": 1048576,
"transaction_replay_retry_on_deadlock": false,
"transaction_replay_retry_on_mismatch": false,
"transaction_replay_safe_commit": true,
"transaction_replay_timeout": "30000ms",
"type": "service",
"use_sql_variables_in": "all",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null,
"wait_timeout": "0ms"
},
"router": "readwritesplit",
"router_diagnostics": {
"queries": 4,
"replayed_transactions": 0,
"ro_transactions": 1,
"route_all": 1,
"route_master": 3,
"route_slave": 0,
"rw_transactions": 0,
"server_query_statistics": [
{
"avg_selects_per_session": 0,
"avg_sess_duration": "0ns",
"id": "server1",
"read": 1,
"total": 4,
"write": 3
},
{
"avg_selects_per_session": 0,
"avg_sess_duration": "0ns",
"id": "server2",
"read": 1,
"total": 1,
"write": 0
}
],
"trx_max_size_exceeded": 0
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Fri, 05 Jan 2024 07:23:54 GMT",
"state": "Started",
"statistics": {
"active_operations": 0,
"avg_sescmd_history_length": 0.0,
"avg_session_lifetime": 0.0,
"connections": 1,
"failed_auths": 0,
"max_connections": 1,
"max_sescmd_history_length": 0,
"max_session_lifetime": 0,
"routed_packets": 4,
"total_connections": 1
},
"total_connections": 1,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Fri, 05 Jan 2024 07:23:55 GMT"
},
"id": "RW-Split-Router",
"links": {
"self": "http://localhost:8989/v1/services/RW-Split-Router/"
},
"relationships": {
"listeners": {
"data": [
{
"id": "RW-Split-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/RW-Split-Router/relationships/listeners/"
}
},
"monitors": {
"data": [
{
"id": "MariaDB-Monitor",
"type": "monitors"
}
],
"links": {
"related": "http://localhost:8989/v1/monitors/",
"self": "http://localhost:8989/v1/services/RW-Split-Router/relationships/monitors/"
}
}
},
"type": "services"
},
{
"attributes": {
"connections": 0,
"listeners": [
{
"attributes": {
"parameters": {
"MariaDBProtocol": {
"allow_replication": true
},
"address": "::",
"authenticator": null,
"authenticator_options": null,
"connection_init_sql_file": null,
"connection_metadata": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"port": 4008,
"protocol": "MariaDBProtocol",
"proxy_protocol_networks": null,
"service": "Read-Connection-Router",
"socket": null,
"sql_mode": "default",
"ssl": false,
"ssl_ca": null,
"ssl_cert": null,
"ssl_cert_verify_depth": 9,
"ssl_cipher": null,
"ssl_crl": null,
"ssl_key": null,
"ssl_verify_peer_certificate": false,
"ssl_verify_peer_host": false,
"ssl_version": "MAX",
"type": "listener",
"user_mapping_file": null
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"state": "Running"
},
"id": "Read-Connection-Listener",
"relationships": {
"services": {
"data": [
{
"id": "Read-Connection-Router",
"type": "services"
}
],
"links": {
"related": "http://localhost:8989/v1/services/",
"self": "http://localhost:8989/v1/listeners/Read-Connection-Listener/relationships/services/"
}
}
},
"type": "listeners"
}
],
"parameters": {
"auth_all_servers": false,
"connection_keepalive": "300000ms",
"disable_sescmd_history": false,
"enable_root_user": false,
"force_connection_keepalive": false,
"idle_session_pool_time": "-1ms",
"localhost_match_wildcard_host": true,
"log_auth_warnings": true,
"log_debug": false,
"log_info": false,
"log_notice": false,
"log_warning": false,
"master_accept_reads": true,
"max_connections": 0,
"max_replication_lag": "0ms",
"max_sescmd_history": 50,
"multiplex_timeout": "60000ms",
"net_write_timeout": "0ms",
"password": "*****",
"prune_sescmd_history": true,
"rank": "primary",
"retain_last_statements": -1,
"router": "readconnroute",
"router_options": "master",
"session_trace": false,
"strip_db_esc": true,
"type": "service",
"user": "maxuser",
"user_accounts_file": null,
"user_accounts_file_usage": "add_when_load_ok",
"version_string": null,
"wait_timeout": "0ms"
},
"router": "readconnroute",
"router_diagnostics": {
"queries": 0,
"server_query_statistics": []
},
"source": {
"file": "/etc/maxscale.cnf",
"type": "static"
},
"started": "Fri, 05 Jan 2024 07:23:54 GMT",
"state": "Started",
"statistics": {
"active_operations": 0,
"avg_sescmd_history_length": 0.0,
"avg_session_lifetime": 0.0,
"connections": 0,
"failed_auths": 0,
"max_connections": 0,
"max_sescmd_history_length": 0,
"max_session_lifetime": 0,
"routed_packets": 0,
"total_connections": 0
},
"total_connections": 0,
"users": [
{
"default_role": "",
"global_priv": false,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": false,
"user": "mariadb.sys"
},
{
"default_role": "",
"global_priv": true,
"host": "127.0.0.1",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "maxuser"
},
{
"default_role": "",
"global_priv": true,
"host": "localhost",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
},
{
"default_role": "",
"global_priv": true,
"host": "%",
"plugin": "mysql_native_password",
"proxy_priv": false,
"ssl": false,
"super_priv": true,
"user": "root"
}
],
"users_last_update": "Fri, 05 Jan 2024 07:23:55 GMT"
},
"id": "Read-Connection-Router",
"links": {
"self": "http://localhost:8989/v1/services/Read-Connection-Router/"
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
},
{
"id": "Hint",
"type": "filters"
}
],
"links": {
"related": "http://localhost:8989/v1/filters/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/filters/"
}
},
"listeners": {
"data": [
{
"id": "Read-Connection-Listener",
"type": "listeners"
}
],
"links": {
"related": "http://localhost:8989/v1/listeners/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/listeners/"
}
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
},
{
"id": "server2",
"type": "servers"
}
],
"links": {
"related": "http://localhost:8989/v1/servers/",
"self": "http://localhost:8989/v1/services/Read-Connection-Router/relationships/servers/"
}
}
},
"type": "services"
}
],
"links": {
"self": "http://localhost:8989/v1/services/"
}
}POST /v1/services{
"data": {
"id": "my-service",
"type": "services",
"attributes": {
"router": "readwritesplit",
"parameters": {
"user": "maxuser",
"password": "maxpwd"
}
},
"relationships": {
"filters": {
"data": [
{
"id": "QLA",
"type": "filters"
}
]
},
"servers": {
"data": [
{
"id": "server1",
"type": "servers"
}
]
}
}
}
}DELETE /v1/services/:namePATCH /v1/services/:name{
"data": {
"attributes": {
"parameters": {
"user": "admin"
}
}
}
}PATCH /v1/services/:name/relationships/:typePATCH /v1/services/my-rw-service/relationships/servers
{
data: [
{ "id": "my-server", "type": "servers" }
]
}PATCH /v1/services/my-rw-service/relationships/servers
{
data: []
}PUT /v1/services/:name/stopPUT /v1/services/:name/startPOST /v1/services/:name/reloadGET /v1/services/:name/listenersGET /v1/services/:name/listeners/:listenerPOST /v1/services/:name/listenersDELETE /v1/services/:service/listeners/:nameMaintenance and Draining statemax_slave_connectionsslave_connectionsmax_replication_laguse_sql_variables_inmaster_reconnectionslave_selection_criteriamaster_accept_readsstrict_multi_stmtstrict_sp_callsstrict_tmp_tablesmaster_failure_moderetry_failed_readsdelayed_retrydelayed_retry_timeouttransaction_replaytransaction_replay_max_sizetransaction_replay_attemptstransaction_replay_timeouttransaction_replay_retry_on_deadlocktransaction_replay_safe_committransaction_replay_retry_on_mismatchtransaction_replay_checksumoptimistic_trxcausal_readscausal_reads_timeoutlazy_connectreuse_prepared_statementsreset-gtidalladaptive_routingleast_behind_masterleast_router_connectionsleast_global_connectionsfail_on_writeerror_on_writeresult_onlyno_insert_idlocalglobalfastfast_globaluniversalfast_universalmaxctrl set server <server> maintenance --forceSET @rownum := 0;
SELECT @rownum := @rownum + 1 AS rownum, user, host FROM mysql.user;SET @myid := 0;
INSERT INTO test.t1 VALUES (@myid := @myid + 1);
SELECT @myid; -- Might return 1 or 0slave_selection_criteria=<criteria># Use the primary for reads
master_accept_reads=true# Enable strict multi-statement mode
strict_multi_stmt=trueINSERT INTO test.t1 (id) VALUES (1);
SELECT * FROM test.t1 WHERE id = 1;INSERT INTO test.t1 (id) VALUES (1);
-- These are executed as one multi-query
SET @maxscale_secret_variable=(
SELECT CASE
WHEN MASTER_GTID_WAIT('0-3000-8', 10) = 0 THEN 1
ELSE (SELECT 1 FROM INFORMATION_SCHEMA.ENGINES)
END); SELECT * FROM test.t1 WHERE id = 1;COM_QUERY: INSERT INTO test.t1 (id) VALUES (1);
COM_STMT_PREPARE: SELECT * FROM test.t1 WHERE id = ?;
COM_STMT_EXECUTE: ? = 123COM_QUERY: INSERT INTO test.t1 (id) VALUES (1);
COM_STMT_PREPARE: SELECT * FROM test.t1 WHERE id = ?;
COM_QUERY: IF (MASTER_GTID_WAIT('0-3000-8', 10) <> 0) THEN KILL (SELECT CONNECTION_ID()); END IF
COM_STMT_EXECUTE: ? = 123Error: 1792
SQLSTATE: 25006
Message: Causal read timed out while in a read-only transaction, cannot retry command.maxctrl call command readwritesplit reset-gtid My-RW-RouterSET SQL_MODE=''; -- A session command
BEGIN;
SELECT "hello world"; -- Returns the string "hello world"
SET SQL_MODE='ANSI_QUOTES'; -- A session command
SELECT 'hello world'; -- Returns the string "hello world"SET SQL_MODE=''; -- Replayed session command
SET SQL_MODE='ANSI_QUOTES'; -- Replayed session command
BEGIN;
SELECT "hello world"; -- Returns an error
SELECT 'hello world'; -- Returns the string "hello world"COM_INIT_DB (USE <db name> creates this)
COM_CHANGE_USER
COM_STMT_CLOSE
COM_STMT_SEND_LONG_DATA
COM_STMT_RESET
COM_STMT_PREPARE
COM_QUIT (no response, session is closed)
COM_REFRESH
COM_DEBUG
COM_PING
SQLCOM_CHANGE_DB (USE ... statements)
SQLCOM_DEALLOCATE_PREPARE
SQLCOM_PREPARE
SQLCOM_SET_OPTION
SELECT ..INTO variable|OUTFILE|DUMPFILE
SET autocommit=1|0use_sql_variables_in=[master|all] (default: all)MySQL [(none)]> set @id=1;
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]> SELECT @id := @id + 1 FROM test.t1;
ERROR 1064 (42000): Routing query to backend failed. See the error log for further details.SELECT * FROM t WHERE a=1;INSERT INTO t SET a=42;Timeline 1 Timeline 2
Clients execute INSERT ... SELECT COUNT(*) FROM tbl
MaxScale -> DB SELECT COUNT(*) FROM tbl
MaxScale -> DB INSERT ...MaxScale -> Cache Delete invalidated values
MaxScale -> Cache Store result and invalidation key[Cache]
type=filter
module=cache
hard_ttl=30
soft_ttl=20
rules=...
...
[Cached-Routing-Service]
type=service
...
filters=Cachestorage=storage_redishard_ttl=60ssoft_ttl=60smax_resultset_rows=1000max_resultset_size=128Kimax_count=1000max_size=100Mirules=/path/to/rules-filemaxctrl alter filter MyCache rules='/path/to/rules-file'cached_data=sharedselects=verify_cacheablecache_in_transactions=neverdebug=31enabled=false* `never`: No invalidation is performed. This is the default.
* `current`: When a modification is made, entries in the cache used by
the current session are invalidated. Other sessions that use the same
cache will also be affected, but sessions that use another cache will
not.* `mixed`: The data of different users is stored in the same
cache. This is the default and may cause that a user can
access data he should not have access to.
* `isolated`: Each user has a unique cache and there can be
no unintended sharing.timeout=7000msSET @maxscale.cache.populate=TRUE;
SELECT a, b FROM tbl;
SET @maxscale.cache.populate=FALSE;
SELECT a, b FROM tbl;SELECT @maxscale.cache.populate;SET @maxscale.cache.use=TRUE;
SELECT a, b FROM tbl;
SET @maxscale.cache.use=FALSE;
SELECT a, b FROM tbl;SELECT @maxscale.cache.use;SET @maxscale.cache.soft_ttl=600;
SELECT a, b FROM unimportant;
SET @maxscale.cache.soft_ttl=60;
SELECT c, d FROM important;SELECT @maxscale.cache.soft_ttl;SET @maxscale.cache.soft_ttl=600, @maxscale.cache.hard_ttl=610;
SELECT a, b FROM unimportant;
SET @maxscale.cache.soft_ttl=60, @maxscale.cache.hard_ttl=65;
SELECT c, d FROM important;SELECT @maxscale.cache.hard_ttl;[TheCache]
type=filter
module=cache
enabled=falseSET @maxscale.cache.populate=TRUE;
SELECT a, b FROM tbl1;
SELECT c, d FROM tbl2;
SELECT e, f FROM tbl3;
SET @maxscale.cache.populate=FALSE;SET @maxscale.cache.use=TRUE;
SELECT a, b FROM tbl1;
SET @maxscale.cache.use=FALSE;UPDATE tbl1 SET a = ...;
SET @maxscale.cache.populate=TRUE;
SELECT a, b FROM tbl1;
SET @maxscale.cache.populate=FALSE;{
store: [ ... ],
use: [ ... ]
}[
{
store: [ ... ],
use: [ ... ]
},
{ ... }
]{
"attribute": <string>,
"op": <string>
"value": <string>
}SELECT * FROM db1.tblUSE db1;
SELECT * FROM tblSELECT * FROM tbl WHERE a = 2 AND b = 3;SELECT * FROM tbl WHERE b = 3 AND a = 2;SELECT a FROM tbl;SELECT b FROM tbl WHERE a > 5;USE somedb;
SELECT fld FROM tbl;{
"store": [
{
"attribute": "database",
"op": "=",
"value": "db1"
}
]
}{
"store": [
{
"attribute": "table",
"op": "!=",
"value": "tbl1"
}
]
}{
"store": [
{
"attribute": "table",
"op": "!=",
"value": "db1.tbl1"
}
]
}{
"store": [
{
"attribute": "query",
"op": "like",
"value": ".*WHERE.*"
}
]
}{
"attribute": <string>,
"op": <string>
"value": <string>
}{
"attribute": "user",
"op": "=",
"value": "'bob'@'%'"
}
{
"attribute": "user",
"op": "like",
"value": "bob@.*"
}{
"use": [
{
"attribute": "user",
"op": "!=",
"value": "admin"
}
]
}MySQL [testdb]> select * from access;
ERROR 1142 (42000): SELECT command denied to user 'bob'@'localhost' for table 'access'{
"store": [
{
"attribute": "table",
"op": "=",
"value": "access"
}
]
}MySQL [testdb]> select * from access;
+------+------+
| a | b |
+------+------+
| 47 | 11 |
+------+------+MySQL [testdb]> select current_user();
+----------------+
| current_user() |
+----------------+
| bob@127.0.0.1 |
+----------------+
1 row in set (0.00 sec)
MySQL [testdb]> select * from access;
+------+------+
| a | b |
+------+------+
| 47 | 11 |
+------+------+{
"store": [
{
"attribute": "table",
"op": "=",
"value": "access"
}
],
"use": [
{
"attribute": "user",
"op": "=",
"value": "'alice'@'%'"
}
]
}storage=storage_inmemorystorage=storage_memcached[Cache-Filter]
type=filter
module=cache
storage=storage_memcached
storage_memcached.server=192.168.1.31
storage_memcached.max_value_size=10Mstorage_options="server=192.168.1.31,max_value_size=10M"storage=storage_redis[Cache-Filter]
type=filter
module=cache
storage=storage_redis
storage_redis.server=192.168.1.31
storage_redis.username=hello
storage_redis.password=worldstorage_options="server=192.168.1.31,username=hello,password=world"$ redis-cli flushall[MyCache]
type=filter
module=cache
storage=storage_inmemory
soft_ttl=30
hard_ttl=45
cached_data=shared
max_size=50Mi
rules=cache_rules.json
[MyService]
type=service
...
filters=MyCache{
"store": [
{
"attribute": "table",
"op": "=",
"value": "sbtest"
}
]
}{
"store": [
{
"attribute": "database",
"op": "=",
"value": "db1"
}
]
}{
"store": [
{
"attribute": "query",
"op": "like",
"value": "FROM db1\\..*"
}
]
}{
"attribute": "query",
"op": "unlike",
"value": "FROM nomatch"
}{
"attribute": "database",
"op": "!=",
"value": "nomatch"
}assume_unique_hostnamesprivate_addressmaster_conditionsslave_conditionsfailcountenforce_writable_masterenforce_read_only_slavesenforce_read_only_serversmaintenance_on_low_disk_spacecooperative_monitoring_locksscript_max_replication_lagfetch-cmd-resultcancel-cmdconnecting_slaveconnected_slaverunning_slaveprimary_monitor_masterdisk_space_oklinked_masterrunning_masterwritable_masterprimary_monitor_mastermajority_of_allmajority_of_runningonyes1falseoffno0safeCREATE USER 'maxscale'@'maxscalehost' IDENTIFIED BY 'maxscale-password';
GRANT REPLICATION CLIENT ON *.* TO 'maxscale'@'maxscalehost';GRANT REPLICATION SLAVE ADMIN ON *.* TO 'maxscale'@'maxscalehost';GRANT REPLICA MONITOR ON *.* TO 'maxscale'@'maxscalehost';GRANT FILE ON *.* TO 'maxscale'@'maxscalehost';GRANT CONNECTION ADMIN ON *.* TO 'maxscale'@'maxscalehost';GRANT SUPER, RELOAD, PROCESS, SHOW DATABASES, EVENT ON *.* TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.user TO 'maxscale'@'maxscalehost';GRANT SELECT ON mysql.global_priv TO 'maxscale'@'maxscalehost';GRANT RELOAD, PROCESS, SHOW DATABASES, EVENT, SET USER, READ_ONLY ADMIN ON *.* TO 'maxscale'@'maxscalehost';
GRANT REPLICATION SLAVE ADMIN, BINLOG ADMIN, CONNECTION ADMIN ON *.* TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.user TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.global_priv TO 'maxscale'@'maxscalehost';CREATE USER 'replication'@'replicationhost' IDENTIFIED BY 'replication-password';
GRANT REPLICATION SLAVE ON *.* TO 'replication'@'replicationhost';[MyMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3
user=myuser
password=mypwdmaster_conditions=connected_slave,running_slaveslave_conditions=running_master,writable_master(monitor_interval + backend_connect_timeout) * failcountmaxctrl clear server server2 Maintcall command mariadbmon failover MONITORcall command mariadbmon failover-safe MONITORcall command mariadbmon switchover MONITOR [NEW_PRIMARY] [OLD_PRIMARY]call command mariadbmon switchover-force MONITOR [NEW_PRIMARY] [OLD_PRIMARY]call command mariadbmon rejoin MONITOR OLD_PRIMARYmaxctrl call command mariadbmon reset-replication MONITOR [NEW_PRIMARY]maxctrl call command mariadbmon failover MyMonitor
maxctrl call command mariadbmon failover-safe MyMonitor
maxctrl call command mariadbmon rejoin MyMonitor OldPrimaryServ
maxctrl call command mariadbmon reset-replication MyMonitor
maxctrl call command mariadbmon reset-replication MyMonitor NewPrimaryServ
maxctrl call command mariadbmon switchover MyMonitor
maxctrl call command mariadbmon switchover MyMonitor NewPrimaryServ
maxctrl call command mariadbmon switchover MyMonitor NewPrimaryServ OldPrimaryServ
maxctrl call command mariadbmon switchover-force MyMonitor NewPrimaryServ/v1/maxscale/modules/mariadbmon/<operation>?<monitor-name>&<server-name1>&<server-name2>[Cluster1]
type=monitor
module=mariadbmon
servers=server1, server2, server3, server 4
.../v1/maxscale/modules/mariadbmon/switchover?Cluster1&server4&server2/v1/maxscale/modules/mariadbmon/failover?Cluster1
/v1/maxscale/modules/mariadbmon/rejoin?Cluster1&server3
/v1/maxscale/modules/mariadbmon/reset-replication?Cluster1&server3maxctrl call command mariadbmon async-switchover Cluster1
OK
maxctrl call command mariadbmon fetch-cmd-result Cluster1
{
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/mariadbmon/fetch-cmd-result"
},
"meta": "switchover completed successfully."
}maxctrl call command mariadbmon switchover monitor=MyMonitor new_primary=MyServer2 async=1 force=1maxctrl call command mariadbmon switchover monitor=MyMonitor old_primary_maint=1switchover_on_low_disk_space=trueenforce_simple_topology=truereplication_custom_options=MASTER_SSL_CERT = '/tmp/certs/client-cert.pem',
MASTER_SSL_KEY = '/tmp/certs/client-key.pem',
MASTER_SSL_CA = '/tmp/certs/ca.pem',
MASTER_SSL_VERIFY_SERVER_CERT=0servers_no_promotion=backup_dc_server1,backup_dc_server2promotion_sql_file=/home/root/scripts/promotion.sql
demotion_sql_file=/home/root/scripts/demotion.sqlmaxctrl call command mariadbmon release-locks MyMonitor1write_test_interval=20sCREATE OR REPLACE TABLE mxs.maxscale_write_test
(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
`date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`gtid` TEXT NULL);GRANT SELECT, INSERT, DELETE, CREATE, DROP ON `mxs`.* TO 'maxscale'@'maxscalehost';write_test_table=mxs.my_write_test_tablemaxctrl call command mariadbmon async-rebuild-server MyMonitor MyTargetServer MySourceServermaxctrl call command mariadbmon async-rebuild-server MyMonitor MyTargetServer MySourceServer /my_datadirmaxctrl call command mariadbmon async-create-backup MyMonitor MySourceServer wednesday_161122maxctrl call command mariadbmon async-restore-from-backup MyMonitor MyTargetServer wednesday_161122maxctrl call command mariadbmon async-restore-from-backup MyMonitor MyTargetServer wednesday_161122 /my_datadirmariadb-backup_use_memory=2Gmariadb-backup_parallel=2backup_storage_address=192.168.1.11backup_storage_path=/home/maxscale_ssh_user/backup_storagejohnny ALL= NOPASSWD: /bin/systemctl stop mariadb
johnny ALL= NOPASSWD: /bin/systemctl start mariadb
johnny ALL= NOPASSWD: /usr/sbin/lsof
johnny ALL= NOPASSWD: /bin/kill
johnny ALL= NOPASSWD: /usr/bin/mariadb-backup
johnny ALL= NOPASSWD: /bin/mbstream
johnny ALL= NOPASSWD: /bin/rm -rf /var/lib/mysql/*
johnny ALL= NOPASSWD: /bin/chown -R mysql\:mysql /var/lib/mysql
johnny ALL= NOPASSWD: /bin/cat /var/lib/mysql/xtrabackup_binlog_info
johnny ALL= NOPASSWD: /bin/tar -xz -C /var/lib/mysql/maxctrl call command mariadbmon cs-get-status <monitor-name>
maxctrl call command mariadbmon async-cs-get-status <monitor-name>maxctrl call command mariadbmon cs-get-status MyMonitor
{
"mcs1": {
"cluster_mode": "readwrite",
"dbrm_mode": "master",
<snip>
maxctrl call command mariadbmon async-cs-get-status MyMonitor
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"mcs1": {
"cluster_mode": "readwrite",
"dbrm_mode": "master",
<snip>maxctrl call command mariadbmon async-cs-add-node <monitor-name> <node-host> <timeout>
maxctrl call command mariadbmon async-cs-remove-node <monitor-name> <node-host> <timeout>maxctrl call command mariadbmon async-cs-add-node MyMonitor mcs3 1m
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"node_id": "mcs3",
"timestamp": "2022-05-05 08:07:51.518268"
}
maxctrl call command mariadbmon async-cs-remove-node MyMonitor mcs3 1m
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"node_id": "mcs3",
"timestamp": "2022-05-05 10:46:46.506947"
}maxctrl call command mariadbmon async-cs-start-cluster <monitor-name> <timeout>
maxctrl call command mariadbmon async-cs-stop-cluster <monitor-name> <timeout>maxctrl call command mariadbmon async-cs-start-cluster MyMonitor 1m
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"timestamp": "2022-05-05 09:41:57.140732"
}
maxctrl call command mariadbmon async-cs-stop-cluster MyMonitor 1m
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"mcs1": {
"timestamp": "2022-05-05 09:45:33.779837"
},
<snip>maxctrl call command mariadbmon async-cs-set-readonly <monitor-name> <timeout>
maxctrl call command mariadbmon async-cs-set-readwrite <monitor-name> <timeout>maxctrl call command mariadbmon async-cs-set-readonly MyMonitor 30s
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"cluster-mode": "readonly",
"timestamp": "2022-05-05 09:49:18.365444"
}
maxctrl call command mariadbmon async-cs-set-readwrite MyMonitor 30s
OK
maxctrl call command mariadbmon fetch-cmd-result MyMonitor
{
"cluster-mode": "readwrite",
"timestamp": "2022-05-05 09:50:30.718972"
}cs_admin_port=8641cs_admin_api_key=somekey123maxctrl call command mariadbmon fetch-cmd-result MariaDB-Monitor
"switchover completed successfully."maxctrl call command mariadbmon cancel-cmd MariaDB-Monitor
OK

userpasswordauthentication_requiredauthentication_sharedauthentication_dbauthentication_key_idauthentication_userauthentication_passwordauthorization_enabledhoston_unknown_commandlog_unknown_commandauto_create_databasesauto_create_tablesid_lengthordered_insert_behaviorcursor_timeoutdebuginternal_cacheroot35INSERTordereddefault[TheService]
type=service
...
[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
port=17017maxctrl create listener TheService MongoDB-Listener --protocol=nosqlprotocol 'nosqlprotocol={"user":"the_user", "password": "the_password"}'const uri = "mongodb://127.0.0.1:17017"$ mongo --host 127.0.0.1 --port 17017
MongoDB shell version v4.4.1
...
>MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| bob | % |
| mysql | localhost |
+-------------+-----------+
2 rows in set (0.001 sec)> use test;
switched to db test
> db.runCommand({createUser: "bob", pwd: "bobspwd", roles: []});
{ "ok" : 1 }MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| bob | % |
| test.bob | % |
| mysql | localhost |
+-------------+-----------+
3 rows in set (0.001 sec)> use mariadb
switched to db mariadb
> db.runCommand({createUser: "bob", pwd: "bobspwd", roles: []});
{
"ok" : 0,
"errmsg" : "User \"bob\" already exists",
"code" : 51003,
"codeName" : "Location51003"
}> db.runCommand({createUser: "alice", pwd: "alicespwd", roles: []});
{ "ok" : 1 }MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| alice | % |
| bob | % |
| test.bob | % |
| mysql | localhost |
+-------------+-----------+
4 rows in set (0.001 sec)...
nosqlprotocol.user=theuser
nosqlprotocol.password=thepasswordnosqlprotocol.authentication_required=truenosqlprotocol.authorization_enabled=truenosqlprotocol.user = user_with_privileges_for_creating_a_user
nosqlprotocol.password = the_users_password$ mongo --port 17017
...
>> use admin;
switched to db admin
> db.runCommand({createUser: "nosql_admin", pwd: "nosql_pwd", roles: ["userAdmin"]});
{ "ok" : 1 }> use mariadb;
switched to db admin
> db.runCommand({mxsAddUser: "bob", pwd: "bob_pwd", roles: ["userAdmin"]});
{ "ok" : 1 }nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true> use test;
switched to db test
> db.runCommand({createUser: "alice", pwd: "alices_pwd", roles: []});
{
"ok" : 0,
"errmsg" : "command createUser requires authentication",
"code" : 13,
"codeName" : "Unauthorized"
}[NoSQL-Listener]
...
nosqlprotocol.user=db.the_user
nosqlprotocol.password=the_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true
...CREATE USER 'admin.nosql_admin'@'%' IDENTIFIED BY 'nosql_password';
GRANT ALL PRIVILEGES ON *.* TO 'admin.nosql_admin'@'%' WITH GRANT OPTION;[NoSQL-Listener]
type=listener
service=...
protocol=nosqlprotocol
nosqlprotocol.user=admin.nosql_admin
nosqlprotocol.password=nosql_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true... notice : [nosqlprotocol] Created initial NoSQL user 'admin.nosql_admin'.$ mongo --quiet --port 17017 -u nosql_admin -p nosql_password admin
>> db.runCommand({usersInfo: 1});
{
"users" : [
{
"_id" : "admin.nosql_admin",
"userId" : UUID("7d921459-3099-42a7-ad06-ed37ac002161"),
"user" : "nosql_admin",
"db" : "admin",
"roles" : [
{
"db" : "admin",
"role" : "dbAdminAnyDatabase"
},
{
"db" : "admin",
"role" : "readWriteAnyDatabase"
},
{
"db" : "admin",
"role" : "userAdminAnyDatabase"
},
{
"db" : "admin",
"role" : "root"
}
],
"mechanisms" : [
"SCRAM-SHA-256"
]
}
],
"ok" : 1
}CREATE USER 'test.test_user'@'%' IDENTIFIED BY 'test_password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX ON `test`.* TO 'test.test_user'@'%';[NoSQL-Listener]
type=listener
service=...
protocol=nosqlprotocol
nosqlprotocol.user=test.test_user
nosqlprotocol.password=test_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true... notice : [nosqlprotocol] Created initial NoSQL user 'test.test_user'.$ mongo --quiet --port 17017 -u test_user -p test_password test
>> db.runCommand({usersInfo: 1});
{
"users" : [
{
"_id" : "test.test_user",
"userId" : UUID("714f35e7-4276-45af-863c-0be4d1f5dd74"),
"user" : "test_user",
"db" : "test",
"roles" : [
{
"db" : "test",
"role" : "readWrite"
}
],
"mechanisms" : [
"SCRAM-SHA-256"
]
}
],
"ok" : 1
}[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
...[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
...[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
nosqlprotocol.on_unknown_command=return_error
...nosqlprotocol.debug=in,out,backCREATE TABLE name (id VARCHAR(35) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY,
doc JSON,
CONSTRAINT id_not_null CHECK(id IS NOT NULL));{ <field1>: <value>, <field2>: <value> ... }> db.runCommand({find: "collection", filter: { _id: 4711 }});> db.runCommand({find: "collection", filter: { _id: { $eq: 4711 }}});... WHERE (id = '4711')... WHERE (JSON_EXTRACT(doc, '$._id') = 4711)updates: [
{
q: <query>,
u: { $set: { status: "D" } },
...
},
...
]updates: [
{
q: <query>,
u: { status: "D", quantity: 4 },
...
},
...
]{ ok: 1 }> use myDatabase;
> db.runCommand({createUser: "user1", pwd: "pwd1", roles: []});{
"ok" : 0,
"errmsg" : "not running with --replSet",
"code" : 76,
"codeName" : "NoReplicationEnabled"
}{ "ok" : 1 }{
"errmsg" : "fsync not supported by MaxScale:nosqlprotocol",
"code" : 115,
"codeName" : "CommandNotSupported",
"ok" : 0
}{ "ok" : 1 }{ "state" : "undecided", "ok" : 1 }db.runCommand(
{
mxsAddUser: "<name>",
pwd: passwordPrompt(), // Or "<cleartext password>"
customData: { <any information> },
roles: [
{ role: "<role>", db: "<database>" } | "<role>",
...
],
mechanisms: [ "<scram-mechanism>", ...],
digestPassword: <boolean>
}
)> db.runCommand({mxsAddUser: "user", pwd: "pwd", roles: ["readWrite"]});
{ "ok" : 1 }> db.runCommand({mxsAddUser: "user2", pwd: "pwd2", roles: ["redWrite"]});
{
"ok" : 0,
"errmsg" : "No role named redWrite@test",
"code" : 31,
"codeName" : "RoleNotFound"
}db.adminCommand(
{
mxsCreateDatabase: <name>
}
)> db.adminCommand({mxsCreateDatabase: "db"});
{ "ok" : 1 }> db.adminCommand({mxsCreateDatabase: "db"});
{
"ok" : 0,
"errmsg" : "The database 'db' exists already.",
"code" : 48,
"codeName" : "NamespaceExists"
}db.runCommand(
{
mxsDiagnose: <command>
}
)> db.runCommand({mxsDiagnose: {ping:1}});
{ "kind" : "immediate", "response" : { "ok" : 1 }, "ok" : 1 }
> db.runCommand({mxsDiagnose: {find:"person", filter: { name: "Bob"}}});
{
"kind" : "single",
"sql" : "SELECT doc FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Bob') ",
"ok" : 1
}
> db.runCommand({mxsDiagnose: {delete:"person", deletes: [{q: { name: "Bob"}, limit:0}, {q: {name: "Alice"}, limit:0}]}});
{
"kind" : "single",
"sql" : [
"DELETE FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Bob') ",
"DELETE FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Alice') "
],
"ok" : 1
}db.runCommand(
{
mxsGetConfig: <any>
});> db.runCommand({mxsGetConfig: 1});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : true,
"id_length" : 35
...
},
"ok" : 1
}db.runCommand(
{
mxsListTables: <any>
});> db.runCommand({mxsListTables:"hello"});
{
cursor: {
id: Long('0'),
ns: 'test.$cmd.mxsListTables',
firstBatch: [
{ name: 'Cars', nosql: true },
{ name: 'Customers', nosql: false },
]
},
ok: 1
}db.runCommand(
{
mxsRemoveUser: "<name>"
}
)> db.runCommand({mxsRemoveUser: "user"});
{ "ok" : 1 }> db.runCommand({mxsRemoveUser: "user"});
{
"ok" : 0,
"errmsg" : "User 'user@test' not found",
"code" : 11,
"codeName" : "UserNotFound"
}db.runCommand(
{
mxsSetConfig: document
});> db.runCommand({mxsGetConfig: 1});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : true,
"id_length" : 35
...
},
"ok" : 1
}
> db.runCommand({mxsSetConfig: { auto_create_tables: false}});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : false,
"id_length" : 35
...
},
"ok" : 1
}db.runCommand(
{
mxsUpdateUser: "<name>",
pwd: passwordPrompt(), // Or "<cleartext password>"
customData: { <any information> },
roles: [
{ role: "<role>", db: "<database>" } | "<role>",
...
],
mechanisms: [ "<scram-mechanism>", ...],
digestPassword: <boolean>
}
)> db.runCommand({mxsUpdateUser: "user", pwd: "pwd", roles: ["readWrite"]});
{ "ok" : 1 }> db.runCommand({mxsUpdateUser: "user", roles: ["redWrite"]});
{
"ok" : 0,
"errmsg" : "No role named redWrite@test",
"code" : 31,
"codeName" : "RoleNotFound"
}[My-NoSQL-Listener]
...
nosqlprotocol.internal_cache=cache[My-NoSQL-Listener]
...
nosqlprotocol.internal_cache=cache
nosqlprotocol.cache.max_size=10M
nosqlprotocol.cache.soft_ttl=30s
nosqlprotocol.cache.hard_ttl=40s
...[TheService]
type=service
...
[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
port=17017... notice : (NoSQL-Listener); Listening for connections at [127.0.0.1]:17017$ mongo --port 17017
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:17017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("694f3eed-329f-487a-8d73-9a2d4cf82d62") }
MongoDB server version: 4.4.1
---
...
---
>> db.runCommand({insert: "collection", documents: [{_id: 1, "hello": "world"}]});
{ "n" : 1, "ok" : 1 }> db.runCommand({find: "collection"});
{
"cursor" : {
"firstBatch" : [
{
"_id" : 1,
"hello" : "world"
}
],
"id" : NumberLong(0),
"ns" : "test.collection"
},
"ok" : 1
}MariaDB [(none)]> select * from test.collection;
+------+------------------------------------+
| id | doc |
+------+------------------------------------+
| 1.0 | { "_id" : 1.0, "hello" : "world" } |
+------+------------------------------------+> db.runCommand({mxsDiagnose: {insert: "collection", documents: [{_id: 1, "hello": "world"}]}});
{
"kind" : "multi",
"sql" : [
"INSERT INTO `test`.`collection` (doc) VALUES ('{ \"_id\" : 1.0, \"hello\" : \"world\" }')"
],
"ok" : 1
}> db.runCommand({mxsDiagnose: {find: "collection"}});
{
"kind" : "single",
"sql" : "SELECT doc FROM `test`.`collection` ",
"ok" : 1
}const uri = "mongodb+srv://<user>:<password>@<cluster-url>?writeConcern=majority";const uri = "mongodb://<maxscale-ip>:17017";const { MongoClient } = require("mongodb");
const uri = "mongodb://127.0.0.1:17017";
const client = new MongoClient(uri, { useUnifiedTopology: true });
async function run() {
try {
await client.connect();
const database = client.db("mydb");
const movies = database.collection("movies");
// create a document to be inserted
const movie = { title: "Apocalypse Now", director: "Francis Ford Coppola" };
const result = await movies.insertOne(movie);
console.log(
`${result.insertedCount} documents were inserted with the _id: ${result.insertedId}`,
);
} finally {
await client.close();
}
}
run().catch(console.dir);$ nodejs insert.js
1 documents were inserted with the _id: 60afca73bf486114e3fb48b8const { MongoClient } = require("mongodb");
const uri = "mongodb://127.0.0.1:17017";
const client = new MongoClient(uri, { useUnifiedTopology: true });
async function run() {
try {
await client.connect();
const database = client.db("mydb");
const movies = database.collection("movies");
// Query for a movie that has the title 'Apocalypse Now'
const query = { title: "Apocalypse Now" };
const options = {
// Include only the 'director' field in the returned document
projection: { _id: 0, director: 1 },
};
const movie = await movies.findOne(query, options);
// Returns a document and not a cursor, so print directly.
console.log(movie);
} finally {
await client.close();
}
}
run().catch(console.dir);$ nodejs find.js
{ director: 'Francis Ford Coppola' }userpasswordauthentication_requiredauthentication_sharedauthentication_dbauthentication_key_idauthentication_userauthentication_passwordauthorization_enabledhoston_unknown_commandlog_unknown_commandauto_create_databasesauto_create_tablesid_lengthordered_insert_behaviorcursor_timeoutdebuginternal_cacheroot35INSERTordereddefault* [Authentication Commands](#authentication-commands)
* [Logout](#logout)
* [User Management Commands](#user-management-commands)
* [createUser](#createuser)
* [dropAllUsersFromDatabase](#dropallusersfromdatabase)
* [dropUser](#dropuser)
* [grantRolesToUser](#grantrolestouser)
* [revokeRolesFromUser](#revokerolesfromuser)
* [updateUser](#updateuser)
* [usersInfo](#usersinfo)
* [Replication Commands](#replication-commands)
* [isMaster](#ismaster)
* [replSetGetStatus](#replsetgetstatus)
* [Sessions Commands](#sessions-commands)
* [endSessions](#endsessions)
* [Administration Commands](#administration-commands)
* [create](#create)
* [createIndexes](#createindexes)
* [drop](#drop)
* [dropDatabase](#dropdatabase)
* [dropIndexes](#dropindexes)
* [fsync](#fsync)
* [killCursors](#killcursors)
* [listCollections](#listcollections)
* [listDatabases](#listdatabases)
* [listIndexes](#listindexes)
* [renameCollection](#renamecollection)
* [setParameter](#setparameter)
* [Diagnostic Commands](#diagnostic-commands)
* [buildInfo](#buildinfo)
* [explain](#explain)
* [getCmdLineOpts](#getcmdlineopts)
* [getLog](#getlog)
* [hostInfo](#hostinfo)
* [listCommands](#listcommands)
* [ping](#ping)
* [serverStatus](#serverstatus)
* [validate](#validate)
* [whatsmyuri](#whatsmyuri)
* [Free Monitoring Commands](#free-monitoring-commands)
* [getFreeMonitoringStatus](#getfreemonitoringstatus)
* [MaxScale Specific Commands](#maxscale-specific-commands)
* [mxsAddUser](#mxsadduser)
* [Definition](#definition)
* [mxsAddUser](#mxsadduser_1)
* [Syntax](#syntax)
* [Command Fields](#command-fields)
* [Returns](#returns)
* [mxsCreateDatabase](#mxscreatedatabase)
* [Definition](#definition_1)
* [mxsCreateDatabase](#mxscreatedatabase_1)
* [Syntax](#syntax_1)
* [Command Fields](#command-fields_1)
* [Returns](#returns_1)
* [mxsDiagnose](#mxsdiagnose)
* [Definition](#definition_2)
* [mxsDiagnose](#mxsdiagnose_1)
* [Syntax](#syntax_2)
* [Command Fields](#command-fields_2)
* [Returns](#returns_2)
* [mxsGetConfig](#mxsgetconfig)
* [Definition](#definition_3)
* [mxsGetConfig](#mxsgetconfig_1)
* [Syntax](#syntax_3)
* [Command Fields](#command-fields_3)
* [Returns](#returns_3)
* [mxsListTables](#mxslisttables)
* [Definition](#definition_4)
* [mxsListTables](#mxslisttables_1)
* [Syntax](#syntax_4)
* [Command Fields](#command-fields_4)
* [Returns](#returns_4)
* [mxsRemoveUser](#mxsremoveuser)
* [Definition](#definition_5)
* [mxsRemoveUser](#mxsremoveuser_1)
* [Syntax](#syntax_5)
* [Command Fields](#command-fields_5)
* [Returns](#returns_5)
* [mxsSetConfig](#mxssetconfig)
* [Definition](#definition_6)
* [mxsSetConfig](#mxssetconfig_1)
* [Syntax](#syntax_6)
* [Command Fields](#command-fields_6)
* [Returns](#returns_6)
* [mxsUpdateUser](#mxsupdateuser)
* [Definition](#definition_7)
* [mxsUpdateUser](#mxsupdateuser_1)
* [Syntax](#syntax_7)
* [Command Fields](#command-fields_7)
* [Returns](#returns_7)[TheService]
type=service
...
[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
port=17017maxctrl create listener TheService MongoDB-Listener --protocol=nosqlprotocol 'nosqlprotocol={"user":"the_user", "password": "the_password"}'const uri = "mongodb://127.0.0.1:17017"$ mongo --host 127.0.0.1 --port 17017
MongoDB shell version v4.4.1
...
>MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| bob | % |
| mysql | localhost |
+-------------+-----------+
2 rows in set (0.001 sec)> use test;
switched to db test
> db.runCommand({createUser: "bob", pwd: "bobspwd", roles: []});
{ "ok" : 1 }MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| bob | % |
| test.bob | % |
| mysql | localhost |
+-------------+-----------+
3 rows in set (0.001 sec)> use mariadb
switched to db mariadb
> db.runCommand({createUser: "bob", pwd: "bobspwd", roles: []});
{
"ok" : 0,
"errmsg" : "User \"bob\" already exists",
"code" : 51003,
"codeName" : "Location51003"
}> db.runCommand({createUser: "alice", pwd: "alicespwd", roles: []});
{ "ok" : 1 }MariaDB [(none)]> select user, host from mysql.user;
+-------------+-----------+
| User | Host |
+-------------+-----------+
| alice | % |
| bob | % |
| test.bob | % |
| mysql | localhost |
+-------------+-----------+
4 rows in set (0.001 sec)...
nosqlprotocol.user=theuser
nosqlprotocol.password=thepasswordnosqlprotocol.authentication_required=truenosqlprotocol.authorization_enabled=truenosqlprotocol.user = user_with_privileges_for_creating_a_user
nosqlprotocol.password = the_users_password$ mongo --port 17017
...
>> use admin;
switched to db admin
> db.runCommand({createUser: "nosql_admin", pwd: "nosql_pwd", roles: ["userAdmin"]});
{ "ok" : 1 }> use mariadb;
switched to db admin
> db.runCommand({mxsAddUser: "bob", pwd: "bob_pwd", roles: ["userAdmin"]});
{ "ok" : 1 }nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true> use test;
switched to db test
> db.runCommand({createUser: "alice", pwd: "alices_pwd", roles: []});
{
"ok" : 0,
"errmsg" : "command createUser requires authentication",
"code" : 13,
"codeName" : "Unauthorized"
}[NoSQL-Listener]
...
nosqlprotocol.user=db.the_user
nosqlprotocol.password=the_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true
...CREATE USER 'admin.nosql_admin'@'%' IDENTIFIED BY 'nosql_password';
GRANT ALL PRIVILEGES ON *.* TO 'admin.nosql_admin'@'%' WITH GRANT OPTION;[NoSQL-Listener]
type=listener
service=...
protocol=nosqlprotocol
nosqlprotocol.user=admin.nosql_admin
nosqlprotocol.password=nosql_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true... notice : [nosqlprotocol] Created initial NoSQL user 'admin.nosql_admin'.$ mongo --quiet --port 17017 -u nosql_admin -p nosql_password admin
>> db.runCommand({usersInfo: 1});
{
"users" : [
{
"_id" : "admin.nosql_admin",
"userId" : UUID("7d921459-3099-42a7-ad06-ed37ac002161"),
"user" : "nosql_admin",
"db" : "admin",
"roles" : [
{
"db" : "admin",
"role" : "dbAdminAnyDatabase"
},
{
"db" : "admin",
"role" : "readWriteAnyDatabase"
},
{
"db" : "admin",
"role" : "userAdminAnyDatabase"
},
{
"db" : "admin",
"role" : "root"
}
],
"mechanisms" : [
"SCRAM-SHA-256"
]
}
],
"ok" : 1
}CREATE USER 'test.test_user'@'%' IDENTIFIED BY 'test_password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX ON `test`.* TO 'test.test_user'@'%';[NoSQL-Listener]
type=listener
service=...
protocol=nosqlprotocol
nosqlprotocol.user=test.test_user
nosqlprotocol.password=test_password
nosqlprotocol.authentication_required=true
nosqlprotocol.authorization_enabled=true... notice : [nosqlprotocol] Created initial NoSQL user 'test.test_user'.$ mongo --quiet --port 17017 -u test_user -p test_password test
>> db.runCommand({usersInfo: 1});
{
"users" : [
{
"_id" : "test.test_user",
"userId" : UUID("714f35e7-4276-45af-863c-0be4d1f5dd74"),
"user" : "test_user",
"db" : "test",
"roles" : [
{
"db" : "test",
"role" : "readWrite"
}
],
"mechanisms" : [
"SCRAM-SHA-256"
]
}
],
"ok" : 1
}[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
...[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
...[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
nosqlprotocol.on_unknown_command=return_error
...nosqlprotocol.debug=in,out,backCREATE TABLE name (id VARCHAR(35) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY,
doc JSON,
CONSTRAINT id_not_null CHECK(id IS NOT NULL));{ <field1>: <value>, <field2>: <value> ... }> db.runCommand({find: "collection", filter: { _id: 4711 }});> db.runCommand({find: "collection", filter: { _id: { $eq: 4711 }}});... WHERE (id = '4711')... WHERE (JSON_EXTRACT(doc, '$._id') = 4711)updates: [
{
q: <query>,
u: { $set: { status: "D" } },
...
},
...
]updates: [
{
q: <query>,
u: { status: "D", quantity: 4 },
...
},
...
]{ ok: 1 }> use myDatabase;
> db.runCommand({createUser: "user1", pwd: "pwd1", roles: []});{
"ok" : 0,
"errmsg" : "not running with --replSet",
"code" : 76,
"codeName" : "NoReplicationEnabled"
}{ "ok" : 1 }{
"errmsg" : "fsync not supported by MaxScale:nosqlprotocol",
"code" : 115,
"codeName" : "CommandNotSupported",
"ok" : 0
}{ "ok" : 1 }{ "state" : "undecided", "ok" : 1 }db.runCommand(
{
mxsAddUser: "<name>",
pwd: passwordPrompt(), // Or "<cleartext password>"
customData: { <any information> },
roles: [
{ role: "<role>", db: "<database>" } | "<role>",
...
],
mechanisms: [ "<scram-mechanism>", ...],
digestPassword: <boolean>
}
)> db.runCommand({mxsAddUser: "user", pwd: "pwd", roles: ["readWrite"]});
{ "ok" : 1 }> db.runCommand({mxsAddUser: "user2", pwd: "pwd2", roles: ["redWrite"]});
{
"ok" : 0,
"errmsg" : "No role named redWrite@test",
"code" : 31,
"codeName" : "RoleNotFound"
}db.adminCommand(
{
mxsCreateDatabase: <name>
}
)> db.adminCommand({mxsCreateDatabase: "db"});
{ "ok" : 1 }> db.adminCommand({mxsCreateDatabase: "db"});
{
"ok" : 0,
"errmsg" : "The database 'db' exists already.",
"code" : 48,
"codeName" : "NamespaceExists"
}db.runCommand(
{
mxsDiagnose: <command>
}
)> db.runCommand({mxsDiagnose: {ping:1}});
{ "kind" : "immediate", "response" : { "ok" : 1 }, "ok" : 1 }
> db.runCommand({mxsDiagnose: {find:"person", filter: { name: "Bob"}}});
{
"kind" : "single",
"sql" : "SELECT doc FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Bob') ",
"ok" : 1
}
> db.runCommand({mxsDiagnose: {delete:"person", deletes: [{q: { name: "Bob"}, limit:0}, {q: {name: "Alice"}, limit:0}]}});
{
"kind" : "single",
"sql" : [
"DELETE FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Bob') ",
"DELETE FROM `test`.`person` WHERE ( JSON_EXTRACT(doc, '$.name') = 'Alice') "
],
"ok" : 1
}db.runCommand(
{
mxsGetConfig: <any>
});> db.runCommand({mxsGetConfig: 1});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : true,
"id_length" : 35
...
},
"ok" : 1
}db.runCommand(
{
mxsListTables: <any>
});> db.runCommand({mxsListTables:"hello"});
{
cursor: {
id: Long('0'),
ns: 'test.$cmd.mxsListTables',
firstBatch: [
{ name: 'Cars', nosql: true },
{ name: 'Customers', nosql: false },
]
},
ok: 1
}db.runCommand(
{
mxsRemoveUser: "<name>"
}
)> db.runCommand({mxsRemoveUser: "user"});
{ "ok" : 1 }> db.runCommand({mxsRemoveUser: "user"});
{
"ok" : 0,
"errmsg" : "User 'user@test' not found",
"code" : 11,
"codeName" : "UserNotFound"
}db.runCommand(
{
mxsSetConfig: document
});> db.runCommand({mxsGetConfig: 1});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : true,
"id_length" : 35
...
},
"ok" : 1
}
> db.runCommand({mxsSetConfig: { auto_create_tables: false}});
{
"config" : {
"on_unknown_command" : "return_error",
"auto_create_tables" : false,
"id_length" : 35
...
},
"ok" : 1
}db.runCommand(
{
mxsUpdateUser: "<name>",
pwd: passwordPrompt(), // Or "<cleartext password>"
customData: { <any information> },
roles: [
{ role: "<role>", db: "<database>" } | "<role>",
...
],
mechanisms: [ "<scram-mechanism>", ...],
digestPassword: <boolean>
}
)> db.runCommand({mxsUpdateUser: "user", pwd: "pwd", roles: ["readWrite"]});
{ "ok" : 1 }> db.runCommand({mxsUpdateUser: "user", roles: ["redWrite"]});
{
"ok" : 0,
"errmsg" : "No role named redWrite@test",
"code" : 31,
"codeName" : "RoleNotFound"
}[My-NoSQL-Listener]
...
nosqlprotocol.internal_cache=cache[My-NoSQL-Listener]
...
nosqlprotocol.internal_cache=cache
nosqlprotocol.cache.max_size=10M
nosqlprotocol.cache.soft_ttl=30s
nosqlprotocol.cache.hard_ttl=40s
...[TheService]
type=service
...
[NoSQL-Listener]
type=listener
service=TheService
protocol=nosqlprotocol
nosqlprotocol.user=the_user
nosqlprotocol.password=the_password
port=17017... notice : (NoSQL-Listener); Listening for connections at [127.0.0.1]:17017$ mongo --port 17017
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:17017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("694f3eed-329f-487a-8d73-9a2d4cf82d62") }
MongoDB server version: 4.4.1
---
...
---
>> db.runCommand({insert: "collection", documents: [{_id: 1, "hello": "world"}]});
{ "n" : 1, "ok" : 1 }> db.runCommand({find: "collection"});
{
"cursor" : {
"firstBatch" : [
{
"_id" : 1,
"hello" : "world"
}
],
"id" : NumberLong(0),
"ns" : "test.collection"
},
"ok" : 1
}MariaDB [(none)]> select * from test.collection;
+------+------------------------------------+
| id | doc |
+------+------------------------------------+
| 1.0 | { "_id" : 1.0, "hello" : "world" } |
+------+------------------------------------+> db.runCommand({mxsDiagnose: {insert: "collection", documents: [{_id: 1, "hello": "world"}]}});
{
"kind" : "multi",
"sql" : [
"INSERT INTO `test`.`collection` (doc) VALUES ('{ \"_id\" : 1.0, \"hello\" : \"world\" }')"
],
"ok" : 1
}> db.runCommand({mxsDiagnose: {find: "collection"}});
{
"kind" : "single",
"sql" : "SELECT doc FROM `test`.`collection` ",
"ok" : 1
}const uri = "mongodb+srv://<user>:<password>@<cluster-url>?writeConcern=majority";const uri = "mongodb://<maxscale-ip>:17017";const { MongoClient } = require("mongodb");
const uri = "mongodb://127.0.0.1:17017";
const client = new MongoClient(uri, { useUnifiedTopology: true });
async function run() {
try {
await client.connect();
const database = client.db("mydb");
const movies = database.collection("movies");
// create a document to be inserted
const movie = { title: "Apocalypse Now", director: "Francis Ford Coppola" };
const result = await movies.insertOne(movie);
console.log(
`${result.insertedCount} documents were inserted with the _id: ${result.insertedId}`,
);
} finally {
await client.close();
}
}
run().catch(console.dir);$ nodejs insert.js
1 documents were inserted with the _id: 60afca73bf486114e3fb48b8const { MongoClient } = require("mongodb");
const uri = "mongodb://127.0.0.1:17017";
const client = new MongoClient(uri, { useUnifiedTopology: true });
async function run() {
try {
await client.connect();
const database = client.db("mydb");
const movies = database.collection("movies");
// Query for a movie that has the title 'Apocalypse Now'
const query = { title: "Apocalypse Now" };
const options = {
// Include only the 'director' field in the returned document
projection: { _id: 0, director: 1 },
};
const movie = await movies.findOne(query, options);
// Returns a document and not a cursor, so print directly.
console.log(movie);
} finally {
await client.close();
}
}
run().catch(console.dir);$ nodejs find.js
{ director: 'Francis Ford Coppola' }links object should be used instead. This way the navigation will provide
a consistent view of the log that does not overlap.
Optionally, the id values in the returned data can be used as the values
for this parameter to read data from a known point in the file.priorityGET /v1/maxscale{
"data": {
"attributes": {
"activated_at": "Fri, 05 Jan 2024 07:23:54 GMT",
"commit": "af392f1a43e72e5538e1956aa500d77aca4d4456",
"config_sync": null,
"parameters": {
"admin_audit": false,
"admin_audit_exclude_methods": [],
"admin_audit_file": "/var/log/maxscale/admin_audit.csv",
"admin_auth": true,
"admin_enabled": true,
"admin_gui": true,
"admin_host": "127.0.0.1",
"admin_jwt_algorithm": "auto",
"admin_jwt_issuer": "maxscale",
"admin_jwt_key": null,
"admin_jwt_max_age": "86400000ms",
"admin_log_auth_failures": true,
"admin_oidc_url": null,
"admin_pam_readonly_service": null,
"admin_pam_readwrite_service": null,
"admin_port": 8989,
"admin_readonly_hosts": "*",
"admin_readwrite_hosts": "*",
"admin_secure_gui": false,
"admin_ssl_ca": null,
"admin_ssl_cert": null,
"admin_ssl_key": null,
"admin_ssl_version": "MAX",
"admin_verify_url": null,
"auth_connect_timeout": "10000ms",
"auth_read_timeout": "10000ms",
"auth_write_timeout": "10000ms",
"auto_tune": [],
"cachedir": "/var/cache/maxscale",
"config_sync_cluster": null,
"config_sync_db": "mysql",
"config_sync_interval": "5000ms",
"config_sync_password": null,
"config_sync_timeout": "10000ms",
"config_sync_user": null,
"connector_plugindir": "/usr/lib64/maxscale/plugin",
"datadir": "/var/lib/maxscale",
"debug": null,
"dump_last_statements": "never",
"execdir": "/usr/bin",
"key_manager": "none",
"language": "/var/lib/maxscale",
"libdir": "/usr/lib64/maxscale",
"load_persisted_configs": true,
"local_address": null,
"log_debug": false,
"log_info": false,
"log_notice": true,
"log_throttling": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"log_warn_super_user": false,
"log_warning": true,
"logdir": "/var/log/maxscale",
"max_auth_errors_until_block": 10,
"max_read_amount": 0,
"maxlog": true,
"module_configdir": "/etc/maxscale.modules.d",
"ms_timestamp": false,
"passive": false,
"persist_runtime_changes": true,
"persistdir": "/var/lib/maxscale/maxscale.cnf.d",
"piddir": "/var/run/maxscale",
"query_classifier_cache_size": 5003753472,
"query_retries": 1,
"query_retry_timeout": "5000ms",
"rebalance_period": "0ms",
"rebalance_threshold": 20,
"rebalance_window": 10,
"retain_last_statements": 0,
"session_trace": 0,
"session_trace_match": null,
"skip_name_resolve": false,
"sql_mode": "default",
"syslog": false,
"threads": 3,
"threads_max": 256,
"users_refresh_interval": "0ms",
"users_refresh_time": "0ms",
"writeq_high_water": 65536,
"writeq_low_water": 1024
},
"process_datadir": "/var/lib/maxscale/data1",
"started_at": "Fri, 05 Jan 2024 07:23:54 GMT",
"system": {
"machine": {
"cores_available": 8,
"cores_physical": 8,
"cores_virtual": 8.0,
"memory_available": 33358356480,
"memory_physical": 33358356480
},
"maxscale": {
"query_classifier_cache_size": 5003753472,
"threads": 3
},
"os": {
"machine": "x86_64",
"nodename": "monolith",
"release": "6.6.4-100.fc38.x86_64",
"sysname": "Linux",
"version": "#1 SMP PREEMPT_DYNAMIC Sun Dec 3 18:11:27 UTC 2023"
}
},
"uptime": 12,
"version": "24.02.0"
},
"id": "maxscale",
"type": "maxscale"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/"
}
}PATCH /v1/maxscaleGET /v1/maxscale/threads/:id{
"data": {
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"listening": true,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 20,
"sessions": 0,
"state": "Active",
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "0",
"links": {
"self": "http://localhost:8989/v1/threads/0/"
},
"type": "threads"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/threads/0/"
}
}GET /v1/maxscale/threads{
"data": [
{
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"listening": true,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 21,
"sessions": 0,
"state": "Active",
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "0",
"links": {
"self": "http://localhost:8989/v1/threads/0/"
},
"type": "threads"
},
{
"attributes": {
"stats": {
"accepts": 1,
"avg_event_queue_length": 1,
"current_descriptors": 8,
"errors": 0,
"hangups": 0,
"listening": true,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 2,
"max_exec_time": 1,
"max_queue_time": 0,
"memory": {
"query_classifier": 1481,
"sessions": 70221,
"total": 71702,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 3,
"misses": 4,
"size": 1481
},
"reads": 35,
"sessions": 1,
"state": "Active",
"total_descriptors": 8,
"writes": 15,
"zombies": 0
}
},
"id": "1",
"links": {
"self": "http://localhost:8989/v1/threads/1/"
},
"type": "threads"
},
{
"attributes": {
"stats": {
"accepts": 0,
"avg_event_queue_length": 1,
"current_descriptors": 5,
"errors": 0,
"hangups": 0,
"listening": true,
"load": {
"last_hour": 0,
"last_minute": 0,
"last_second": 0
},
"max_event_queue_length": 1,
"max_exec_time": 0,
"max_queue_time": 0,
"memory": {
"query_classifier": 0,
"sessions": 0,
"total": 0,
"zombies": 0
},
"query_classifier_cache": {
"evictions": 0,
"hits": 0,
"inserts": 0,
"misses": 0,
"size": 0
},
"reads": 20,
"sessions": 0,
"state": "Active",
"total_descriptors": 5,
"writes": 0,
"zombies": 0
}
},
"id": "2",
"links": {
"self": "http://localhost:8989/v1/threads/2/"
},
"type": "threads"
}
],
"links": {
"self": "http://localhost:8989/v1/maxscale/threads/"
}
}GET /v1/maxscale/logs{
"data": {
"attributes": {
"log_file": "/var/log/maxscale/maxscale.log",
"log_priorities": [
"alert",
"error",
"warning",
"notice"
],
"parameters": {
"log_debug": false,
"log_info": false,
"log_notice": true,
"log_throttling": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"log_warning": true,
"maxlog": true,
"ms_timestamp": false,
"syslog": false
}
},
"id": "logs",
"type": "logs"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/logs/"
}
}GET /v1/maxscale/logs/data{
"data": {
"attributes": {
"log": [
{
"id": "37",
"message": "MaxScale started with 3 worker threads.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:54",
"unix_timestamp": 1704439434
},
{
"id": "38",
"message": "Read 8 user@host entries from 'server1' for service 'RW-Split-Router'.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:55",
"unix_timestamp": 1704439435
},
{
"id": "39",
"message": "Read 8 user@host entries from 'server1' for service 'Read-Connection-Router'.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:55",
"unix_timestamp": 1704439435
}
],
"log_source": "maxlog"
},
"id": "log_data",
"type": "log_data"
},
"links": {
"last": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bsize%5D=3",
"prev": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bcursor%5D=34&page%5Bsize%5D=3",
"self": "http://localhost:8989/v1/maxscale/logs/data/?page%5Bcursor%5D=40&page%5Bsize%5D=3"
}
}GET /v1/maxscale/logs/entries{
"data": [
{
"attributes": {
"log_source": "maxlog",
"message": "MaxScale started with 3 worker threads.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:54",
"unix_timestamp": 1704439434
},
"id": "37",
"type": "log_entry"
},
{
"attributes": {
"log_source": "maxlog",
"message": "Read 8 user@host entries from 'server1' for service 'RW-Split-Router'.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:55",
"unix_timestamp": 1704439435
},
"id": "38",
"type": "log_entry"
},
{
"attributes": {
"log_source": "maxlog",
"message": "Read 8 user@host entries from 'server1' for service 'Read-Connection-Router'.",
"priority": "notice",
"timestamp": "2024-01-05 07:23:55",
"unix_timestamp": 1704439435
},
"id": "39",
"type": "log_entry"
}
],
"links": {
"last": "http://localhost:8989/v1/maxscale/logs/entries/?page%5Bsize%5D=3",
"prev": "http://localhost:8989/v1/maxscale/logs/entries/?page%5Bcursor%5D=34&page%5Bsize%5D=3",
"self": "http://localhost:8989/v1/maxscale/logs/entries/?page%5Bcursor%5D=40&page%5Bsize%5D=3"
},
"meta": {
"total": 3
}
}GET /v1/maxscale/logs/stream{
"id": "572",
"message": "MaxScale started with 8 worker threads, each with a stack size of 8388608 bytes.",
"priority": "notice",
"timestamp": "2020-09-25 10:01:29"
}PATCH /v1/maxscale/logsPOST /v1/maxscale/logs/flushPOST /v1/maxscale/tls/reloadGET /v1/maxscale/modules/:name{
"data": {
"attributes": {
"api": "router",
"commands": [
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Reset global GTID state in readwritesplit.",
"method": "POST",
"parameters": [
{
"description": "Readwritesplit service",
"required": true,
"type": "SERVICE"
}
]
},
"id": "reset-gtid",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/reset-gtid/"
},
"type": "module_command"
}
],
"description": "A Read/Write splitting router for enhancement read scalability",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": "none",
"description": "Causal reads mode",
"enum_values": [
"none",
"local",
"global",
"fast_global",
"fast",
"universal",
"fast_universal",
"false",
"off",
"0",
"true",
"on",
"1"
],
"mandatory": false,
"modifiable": true,
"name": "causal_reads",
"type": "enum"
},
{
"default_value": "10000ms",
"description": "Timeout for the slave synchronization",
"mandatory": false,
"modifiable": true,
"name": "causal_reads_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Retry failed writes outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry",
"type": "bool"
},
{
"default_value": "10000ms",
"description": "Timeout for delayed_retry",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Create connections only when needed",
"mandatory": false,
"modifiable": true,
"name": "lazy_connect",
"type": "bool"
},
{
"default_value": false,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "fail_on_write",
"description": "Master failure mode behavior",
"enum_values": [
"fail_instantly",
"fail_on_write",
"error_on_write"
],
"mandatory": false,
"modifiable": true,
"name": "master_failure_mode",
"type": "enum"
},
{
"default_value": true,
"description": "Reconnect to master",
"mandatory": false,
"modifiable": true,
"name": "master_reconnection",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Maximum replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": 255,
"description": "Maximum number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "max_slave_connections",
"type": "count"
},
{
"deprecated": true,
"description": "Alias for 'max_replication_lag'",
"mandatory": false,
"modifiable": true,
"name": "max_slave_replication_lag",
"type": "duration"
},
{
"default_value": false,
"description": "Optimistically offload transactions to slaves",
"mandatory": false,
"modifiable": true,
"name": "optimistic_trx",
"type": "bool"
},
{
"default_value": true,
"description": "Automatically retry failed reads outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "retry_failed_reads",
"type": "bool"
},
{
"default_value": false,
"description": "Reuse identical prepared statements inside the same connection",
"mandatory": false,
"modifiable": true,
"name": "reuse_prepared_statements",
"type": "bool"
},
{
"default_value": 255,
"description": "Starting number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "slave_connections",
"type": "count"
},
{
"default_value": "least_current_operations",
"description": "Slave selection criteria",
"enum_values": [
"least_global_connections",
"least_router_connections",
"least_behind_master",
"least_current_operations",
"adaptive_routing",
"LEAST_GLOBAL_CONNECTIONS",
"LEAST_ROUTER_CONNECTIONS",
"LEAST_BEHIND_MASTER",
"LEAST_CURRENT_OPERATIONS",
"ADAPTIVE_ROUTING"
],
"mandatory": false,
"modifiable": true,
"name": "slave_selection_criteria",
"type": "enum"
},
{
"default_value": false,
"description": "Lock connection to master after multi-statement query",
"mandatory": false,
"modifiable": true,
"name": "strict_multi_stmt",
"type": "bool"
},
{
"default_value": false,
"description": "Lock connection to master after a stored procedure is executed",
"mandatory": false,
"modifiable": true,
"name": "strict_sp_calls",
"type": "bool"
},
{
"default_value": true,
"description": "Prevent reconnections if temporary tables exist",
"mandatory": false,
"modifiable": true,
"name": "strict_tmp_tables",
"type": "bool"
},
{
"default_value": false,
"description": "Retry failed transactions",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay",
"type": "bool"
},
{
"default_value": 5,
"description": "Maximum number of times to retry a transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_attempts",
"type": "count"
},
{
"default_value": "full",
"description": "Type of checksum to calculate for results",
"enum_values": [
"full",
"result_only",
"no_insert_id"
],
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_checksum",
"type": "enum"
},
{
"default_value": 1048576,
"description": "Maximum size of transaction to retry",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_max_size",
"type": "size"
},
{
"default_value": false,
"description": "Retry transaction on deadlock",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_deadlock",
"type": "bool"
},
{
"default_value": false,
"description": "Retry transaction on checksum mismatch",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_mismatch",
"type": "bool"
},
{
"default_value": true,
"description": "Prevent replaying of about-to-commit transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_safe_commit",
"type": "bool"
},
{
"default_value": "30000ms",
"description": "Timeout for transaction replay",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "all",
"description": "Whether to route SQL variable modifications to all servers or only to the master",
"enum_values": [
"all",
"master"
],
"mandatory": false,
"modifiable": true,
"name": "use_sql_variables_in",
"type": "enum"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How often idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"deprecated": true,
"description": "Alias for 'wait_timeout'",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": false,
"description": "Ping connections unconditionally",
"mandatory": false,
"modifiable": true,
"name": "force_connection_keepalive",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"deprecated": true,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"deprecated": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "wait_timeout",
"type": "duration",
"unit": "ms"
}
],
"version": "V1.1.0"
},
"id": "readwritesplit",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/"
},
"type": "modules"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/"
}
}GET /v1/maxscale/modules{
"data": [
{
"attributes": {
"commands": [],
"description": "maxscale",
"maturity": "GA",
"module_type": "maxscale",
"parameters": [
{
"default_value": false,
"description": "Enable REST audit logging",
"mandatory": false,
"modifiable": true,
"name": "admin_audit",
"type": "bool"
},
{
"default_value": [],
"description": "List of HTTP methods to exclude from audit logging, e.g. \"GET\"",
"enum_values": [
"GET",
"PUT",
"POST",
"PATCH",
"DELETE",
"HEAD",
"CONNECT",
"OPTIONS",
"TRACE"
],
"mandatory": false,
"modifiable": true,
"name": "admin_audit_exclude_methods",
"type": "enum list"
},
{
"default_value": "/var/log/maxscale/admin_audit.csv",
"description": "Full path to admin audit file",
"mandatory": false,
"modifiable": true,
"name": "admin_audit_file",
"type": "string"
},
{
"default_value": true,
"description": "Admin interface authentication.",
"mandatory": false,
"modifiable": false,
"name": "admin_auth",
"type": "bool"
},
{
"default_value": true,
"description": "Admin interface is enabled.",
"mandatory": false,
"modifiable": false,
"name": "admin_enabled",
"type": "bool"
},
{
"default_value": true,
"description": "Enable admin GUI.",
"mandatory": false,
"modifiable": false,
"name": "admin_gui",
"type": "bool"
},
{
"default_value": "127.0.0.1",
"description": "Admin interface host.",
"mandatory": false,
"modifiable": false,
"name": "admin_host",
"type": "string"
},
{
"default_value": "auto",
"description": "JWT signature algorithm",
"enum_values": [
"auto",
"HS256",
"HS384",
"HS512",
"RS256",
"RS384",
"RS512",
"ES256",
"ES384",
"ES512",
"PS256",
"PS384",
"PS512",
"ED25519",
"ED448"
],
"mandatory": false,
"modifiable": false,
"name": "admin_jwt_algorithm",
"type": "enum"
},
{
"default_value": "maxscale",
"description": "The issuer claim for all JWTs generated by MaxScale.",
"mandatory": false,
"modifiable": false,
"name": "admin_jwt_issuer",
"type": "string"
},
{
"description": "Encryption key ID for symmetric signature algorithms. If left empty, MaxScale will generate a random key that is used to sign the JWT.",
"mandatory": false,
"modifiable": false,
"name": "admin_jwt_key",
"type": "string"
},
{
"default_value": "86400000ms",
"description": "Maximum age of the JWTs generated by MaxScale",
"mandatory": false,
"modifiable": true,
"name": "admin_jwt_max_age",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Log admin interface authentication failures.",
"mandatory": false,
"modifiable": true,
"name": "admin_log_auth_failures",
"type": "bool"
},
{
"description": "Extra public certificates used to validate externally signed JWTs",
"mandatory": false,
"modifiable": true,
"name": "admin_oidc_url",
"type": "string"
},
{
"description": "PAM service for read-only users.",
"mandatory": false,
"modifiable": false,
"name": "admin_pam_readonly_service",
"type": "string"
},
{
"description": "PAM service for read-write users.",
"mandatory": false,
"modifiable": false,
"name": "admin_pam_readwrite_service",
"type": "string"
},
{
"default_value": 8989,
"description": "Admin interface port.",
"mandatory": false,
"modifiable": false,
"name": "admin_port",
"type": "int"
},
{
"default_value": "*",
"description": "Allowed hosts for read-only rest-api users.",
"mandatory": false,
"modifiable": false,
"name": "admin_readonly_hosts",
"type": "host pattern list"
},
{
"default_value": "*",
"description": "Allowed hosts for read-only rest-api users.",
"mandatory": false,
"modifiable": false,
"name": "admin_readwrite_hosts",
"type": "host pattern list"
},
{
"default_value": true,
"description": "Only serve GUI over HTTPS.",
"mandatory": false,
"modifiable": false,
"name": "admin_secure_gui",
"type": "bool"
},
{
"description": "Admin SSL CA cert",
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'admin_ssl_ca'",
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_ca_cert",
"type": "path"
},
{
"description": "Admin SSL cert",
"mandatory": false,
"modifiable": true,
"name": "admin_ssl_cert",
"type": "path"
},
{
"description": "Admin SSL key",
"mandatory": false,
"modifiable": true,
"name": "admin_ssl_key",
"type": "path"
},
{
"default_value": "MAX",
"description": "Minimum required TLS protocol version for the REST API",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": false,
"name": "admin_ssl_version",
"type": "enum"
},
{
"description": "URL for third-party verification of client tokens",
"mandatory": false,
"modifiable": false,
"name": "admin_verify_url",
"type": "string"
},
{
"default_value": "10000ms",
"description": "Connection timeout for fetching user accounts.",
"mandatory": false,
"modifiable": true,
"name": "auth_connect_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "10000ms",
"description": "Read timeout for fetching user accounts (deprecated).",
"mandatory": false,
"modifiable": true,
"name": "auth_read_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "10000ms",
"description": "Write timeout for fetching user accounts (deprecated).",
"mandatory": false,
"modifiable": true,
"name": "auth_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": [],
"description": "Specifies whether a MaxScale parameter whose value depends on a specific global server variable, should automatically be updated to match the variable's current value.",
"mandatory": false,
"modifiable": false,
"name": "auto_tune",
"type": "stringlist"
},
{
"description": "Cluster used for configuration synchronization. If left empty (i.e. value is \"\"), synchronization is not done.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_cluster",
"type": "string"
},
{
"default_value": "mysql",
"description": "Database where the 'maxscale_config' table is created.",
"mandatory": false,
"modifiable": false,
"name": "config_sync_db",
"type": "string"
},
{
"default_value": "5000ms",
"description": "How often to synchronize the configuration.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used for configuration synchronization.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_password",
"type": "password"
},
{
"default_value": "10000ms",
"description": "Timeout for the configuration synchronization operations.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "User account used for configuration synchronization.",
"mandatory": false,
"modifiable": true,
"name": "config_sync_user",
"type": "string"
},
{
"description": "Debug options",
"mandatory": false,
"modifiable": false,
"name": "debug",
"type": "string"
},
{
"default_value": "never",
"description": "In what circumstances should the last statements that a client sent be dumped.",
"enum_values": [
"on_close",
"on_error",
"never"
],
"mandatory": false,
"modifiable": true,
"name": "dump_last_statements",
"type": "enum"
},
{
"default_value": "none",
"description": "Key manager type",
"enum_values": [
"none",
"file",
"kmip",
"vault"
],
"mandatory": false,
"modifiable": true,
"name": "key_manager",
"type": "enum"
},
{
"default_value": true,
"description": "Specifies whether persisted configuration files should be loaded on startup.",
"mandatory": false,
"modifiable": false,
"name": "load_persisted_configs",
"type": "bool"
},
{
"description": "Local address to use when connecting.",
"mandatory": false,
"modifiable": false,
"name": "local_address",
"type": "string"
},
{
"default_value": false,
"description": "Specifies whether debug messages should be logged (meaningful only with debug builds).",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Specifies whether info messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": true,
"description": "Specifies whether notice messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": {
"count": 10,
"suppress": 10000,
"window": 1000
},
"description": "Limit the amount of identical log messages than can be logged during a certain time period.",
"mandatory": false,
"modifiable": true,
"name": "log_throttling",
"type": "throttling"
},
{
"default_value": false,
"description": "Log a warning when a user with super privilege logs in.",
"mandatory": false,
"modifiable": false,
"name": "log_warn_super_user",
"type": "bool"
},
{
"default_value": true,
"description": "Specifies whether warning messages should be logged.",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 10,
"description": "The maximum number of authentication failures that are tolerated before a host is temporarily blocked.",
"mandatory": false,
"modifiable": true,
"name": "max_auth_errors_until_block",
"type": "int"
},
{
"default_value": 0,
"description": "Maximum amount of data read before return to epoll_wait.",
"mandatory": false,
"modifiable": false,
"name": "max_read_amount",
"type": "size"
},
{
"default_value": true,
"description": "Log to MaxScale's own log.",
"mandatory": false,
"modifiable": true,
"name": "maxlog",
"type": "bool"
},
{
"default_value": false,
"description": "Enable or disable high precision timestamps.",
"mandatory": false,
"modifiable": true,
"name": "ms_timestamp",
"type": "bool"
},
{
"default_value": false,
"description": "True if MaxScale is in passive mode.",
"mandatory": false,
"modifiable": true,
"name": "passive",
"type": "bool"
},
{
"default_value": true,
"description": "Persist configurations changes done at runtime.",
"mandatory": false,
"modifiable": false,
"name": "persist_runtime_changes",
"type": "bool"
},
{
"default_value": "qc_sqlite",
"deprecated": true,
"description": "The name of the query classifier to load.",
"mandatory": false,
"modifiable": false,
"name": "query_classifier",
"type": "string"
},
{
"deprecated": true,
"description": "Arguments for the query classifier.",
"mandatory": false,
"modifiable": false,
"name": "query_classifier_args",
"type": "string"
},
{
"default_value": 5003753472,
"description": "Maximum amount of memory used by query classifier cache.",
"mandatory": false,
"modifiable": true,
"name": "query_classifier_cache_size",
"type": "size"
},
{
"default_value": 1,
"description": "Number of times an interrupted query is retried.",
"mandatory": false,
"modifiable": false,
"name": "query_retries",
"type": "int"
},
{
"default_value": "5000ms",
"description": "The total timeout in seconds for any retried queries.",
"mandatory": false,
"modifiable": true,
"name": "query_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "How often should the load of the worker threads be checked and rebalancing be made.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_period",
"type": "duration",
"unit": "ms"
},
{
"default_value": 20,
"description": "If the difference in load between the thread with the maximum load and the thread with the minimum load is larger than the value of this parameter, then work will be moved from the former to the latter.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_threshold",
"type": "int"
},
{
"default_value": 10,
"description": "The load of how many seconds should be taken into account when rebalancing.",
"mandatory": false,
"modifiable": true,
"name": "rebalance_window",
"type": "count"
},
{
"default_value": 0,
"description": "How many statements should be retained for each session for debugging purposes.",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "count"
},
{
"default_value": 0,
"description": "How many log entries are stored in the session specific trace log.",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "count"
},
{
"description": "Regular expression that is matched against the contents of the session trace log and if it matches the contents are logged when the session stops.",
"mandatory": false,
"modifiable": true,
"name": "session_trace_match",
"type": "regex"
},
{
"default_value": false,
"description": "Do not resolve client IP addresses to hostnames during authentication",
"mandatory": false,
"modifiable": true,
"name": "skip_name_resolve",
"type": "bool"
},
{
"default_value": false,
"deprecated": true,
"description": "Skip service and monitor permission checks.",
"mandatory": false,
"modifiable": true,
"name": "skip_permission_checks",
"type": "bool"
},
{
"default_value": "default",
"description": "The query classifier sql mode.",
"enum_values": [
"default",
"oracle"
],
"mandatory": false,
"modifiable": false,
"name": "sql_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Log to syslog.",
"mandatory": false,
"modifiable": true,
"name": "syslog",
"type": "bool"
},
{
"default_value": 8,
"description": "This parameter specifies how many threads will be used for handling the routing.",
"mandatory": false,
"modifiable": true,
"name": "threads",
"type": "count"
},
{
"default_value": 256,
"description": "This parameter specifies a hard maximum for the number of routing threads.",
"mandatory": false,
"modifiable": false,
"name": "threads_max",
"type": "count"
},
{
"default_value": "0ms",
"description": "How often the users will be refreshed.",
"mandatory": false,
"modifiable": true,
"name": "users_refresh_interval",
"type": "duration",
"unit": "ms"
},
{
"default_value": "30000ms",
"description": "How often the users can be refreshed.",
"mandatory": false,
"modifiable": true,
"name": "users_refresh_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": 65536,
"description": "High water mark of dcb write queue.",
"mandatory": false,
"modifiable": true,
"name": "writeq_high_water",
"type": "size"
},
{
"default_value": 1024,
"description": "Low water mark of dcb write queue.",
"mandatory": false,
"modifiable": true,
"name": "writeq_low_water",
"type": "size"
}
],
"version": "24.02.0"
},
"id": "maxscale",
"links": {
"self": "http://localhost:8989/v1/modules/maxscale/"
},
"type": "modules"
},
{
"attributes": {
"commands": [],
"description": "servers",
"maturity": "GA",
"module_type": "servers",
"parameters": [
{
"description": "Server address",
"mandatory": false,
"modifiable": true,
"name": "address",
"type": "string"
},
{
"description": "Server authenticator (deprecated)",
"mandatory": false,
"modifiable": false,
"name": "authenticator",
"type": "string"
},
{
"description": "Server disk space threshold",
"mandatory": false,
"modifiable": true,
"name": "disk_space_threshold",
"type": "disk_space_limits"
},
{
"default_value": 0,
"description": "Server extra port",
"mandatory": false,
"modifiable": true,
"name": "extra_port",
"type": "count"
},
{
"default_value": 0,
"description": "Maximum routing connections",
"mandatory": false,
"modifiable": true,
"name": "max_routing_connections",
"type": "count"
},
{
"description": "Monitor password",
"mandatory": false,
"modifiable": true,
"name": "monitorpw",
"type": "password"
},
{
"description": "Monitor user",
"mandatory": false,
"modifiable": true,
"name": "monitoruser",
"type": "string"
},
{
"default_value": "0ms",
"description": "Maximum time that a connection can be in the pool",
"mandatory": false,
"modifiable": true,
"name": "persistmaxtime",
"type": "duration",
"unit": "ms"
},
{
"default_value": 0,
"description": "Maximum size of the persistent connection pool",
"mandatory": false,
"modifiable": true,
"name": "persistpoolmax",
"type": "count"
},
{
"default_value": 3306,
"description": "Server port",
"mandatory": false,
"modifiable": true,
"name": "port",
"type": "count"
},
{
"default_value": 0,
"description": "Server priority",
"mandatory": false,
"modifiable": true,
"name": "priority",
"type": "int"
},
{
"description": "Server private address (replication)",
"mandatory": false,
"modifiable": true,
"name": "private_address",
"type": "string"
},
{
"description": "Server protocol (deprecated)",
"mandatory": false,
"modifiable": false,
"name": "protocol",
"type": "string"
},
{
"default_value": false,
"description": "Enable proxy protocol",
"mandatory": false,
"modifiable": true,
"name": "proxy_protocol",
"type": "bool"
},
{
"default_value": "primary",
"description": "Server rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"description": "Custom CHANGE MASTER TO options",
"mandatory": false,
"modifiable": true,
"name": "replication_custom_options",
"type": "string"
},
{
"description": "Server UNIX socket",
"mandatory": false,
"modifiable": true,
"name": "socket",
"type": "string"
},
{
"default_value": false,
"description": "Enable TLS for server",
"mandatory": false,
"modifiable": true,
"name": "ssl",
"type": "bool"
},
{
"description": "TLS certificate authority",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'ssl_ca'",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca_cert",
"type": "path"
},
{
"description": "TLS public certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert",
"type": "path"
},
{
"default_value": 9,
"description": "TLS certificate verification depth",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert_verify_depth",
"type": "count"
},
{
"description": "TLS cipher list",
"mandatory": false,
"modifiable": true,
"name": "ssl_cipher",
"type": "string"
},
{
"description": "TLS private key",
"mandatory": false,
"modifiable": true,
"name": "ssl_key",
"type": "path"
},
{
"default_value": false,
"description": "Verify TLS peer certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_certificate",
"type": "bool"
},
{
"default_value": false,
"description": "Verify TLS peer host",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_host",
"type": "bool"
},
{
"default_value": "MAX",
"description": "Minimum TLS protocol version",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": true,
"name": "ssl_version",
"type": "enum"
},
{
"default_value": "server",
"description": "Object type",
"mandatory": false,
"modifiable": false,
"name": "type",
"type": "string"
}
],
"version": "24.02.0"
},
"id": "servers",
"links": {
"self": "http://localhost:8989/v1/modules/servers/"
},
"type": "modules"
},
{
"attributes": {
"api": "filter",
"commands": [],
"description": "A hint parsing filter",
"maturity": "Alpha",
"module_type": "Filter",
"parameters": [],
"version": "V1.0.0"
},
"id": "hintfilter",
"links": {
"self": "http://localhost:8989/v1/modules/hintfilter/"
},
"type": "modules"
},
{
"attributes": {
"api": "authenticator",
"commands": [],
"description": "Standard MySQL/MariaDB authentication (mysql_native_password)",
"maturity": "GA",
"module_type": "Authenticator",
"parameters": null,
"version": "V2.1.0"
},
"id": "MariaDBAuth",
"links": {
"self": "http://localhost:8989/v1/modules/MariaDBAuth/"
},
"type": "modules"
},
{
"attributes": {
"api": "monitor",
"commands": [
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Switch primary server with replica",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "New primary (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Current primary (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "switchover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/switchover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Switch primary server with replica. Ignores most errors.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "New primary (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Current primary (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "switchover-force",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/switchover-force/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Schedule primary switchover. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "New primary (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Current primary (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "async-switchover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-switchover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Perform primary failover",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "failover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/failover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Schedule primary failover. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-failover",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-failover/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Rejoin server to a cluster",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Joining server",
"required": true,
"type": "SERVER"
}
]
},
"id": "rejoin",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/rejoin/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Rejoin server to a cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Joining server",
"required": true,
"type": "SERVER"
}
]
},
"id": "async-rejoin",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-rejoin/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 1,
"description": "Delete replica connections, delete binary logs and set up replication (dangerous)",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Primary server (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "reset-replication",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/reset-replication/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 1,
"description": "Delete replica connections, delete binary logs and set up replication (dangerous). Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Primary server (optional)",
"required": false,
"type": "[SERVER]"
}
]
},
"id": "async-reset-replication",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-reset-replication/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Release any held server locks for 1 minute.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "release-locks",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/release-locks/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Release any held server locks for 1 minute. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-release-locks",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-release-locks/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Fetch result of the last scheduled command.",
"method": "GET",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "fetch-cmd-result",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/fetch-cmd-result/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Cancel the last scheduled command.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "cancel-cmd",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/cancel-cmd/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 3,
"description": "Add a node to a ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Hostname/IP of node to add to ColumnStore cluster",
"required": true,
"type": "STRING"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-add-node",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-add-node/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 3,
"description": "Remove a node from a ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Hostname/IP of node to remove from ColumnStore cluster",
"required": true,
"type": "STRING"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-remove-node",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-remove-node/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Get ColumnStore cluster status.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "cs-get-status",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/cs-get-status/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Get ColumnStore cluster status. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
}
]
},
"id": "async-cs-get-status",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-get-status/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Start ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-start-cluster",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-start-cluster/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Stop ColumnStore cluster. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-stop-cluster",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-stop-cluster/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Set ColumnStore cluster read-only. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-set-readonly",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-set-readonly/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 2,
"arg_min": 2,
"description": "Set ColumnStore cluster readwrite. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Timeout",
"required": true,
"type": "STRING"
}
]
},
"id": "async-cs-set-readwrite",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-cs-set-readwrite/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 4,
"arg_min": 2,
"description": "Rebuild a server with mariadb-backup. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Target server",
"required": true,
"type": "SERVER"
},
{
"description": "Source server (optional)",
"required": false,
"type": "[SERVER]"
},
{
"description": "Target data directory (optional)",
"required": false,
"type": "[STRING]"
}
]
},
"id": "async-rebuild-server",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-rebuild-server/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 3,
"arg_min": 3,
"description": "Create a backup with mariadb-backup. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Source server",
"required": true,
"type": "SERVER"
},
{
"description": "Backup name",
"required": true,
"type": "STRING"
}
]
},
"id": "async-create-backup",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-create-backup/"
},
"type": "module_command"
},
{
"attributes": {
"arg_max": 4,
"arg_min": 3,
"description": "Restore a server from a backup. Does not wait for completion.",
"method": "POST",
"parameters": [
{
"description": "Monitor name",
"required": true,
"type": "MONITOR"
},
{
"description": "Target server",
"required": true,
"type": "SERVER"
},
{
"description": "Backup name",
"required": true,
"type": "STRING"
},
{
"description": "Target data directory (optional)",
"required": false,
"type": "[STRING]"
}
]
},
"id": "async-restore-from-backup",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/async-restore-from-backup/"
},
"type": "module_command"
}
],
"description": "A MariaDB Primary/Replica replication monitor",
"maturity": "GA",
"module_type": "Monitor",
"parameters": [
{
"default_value": true,
"description": "Assume that hostnames are unique",
"mandatory": false,
"modifiable": true,
"name": "assume_unique_hostnames",
"type": "bool"
},
{
"default_value": false,
"description": "Enable automatic server failover",
"mandatory": false,
"modifiable": true,
"name": "auto_failover",
"type": "bool"
},
{
"default_value": false,
"description": "Enable automatic server rejoin",
"mandatory": false,
"modifiable": true,
"name": "auto_rejoin",
"type": "bool"
},
{
"description": "Address of backup storage.",
"mandatory": false,
"modifiable": true,
"name": "backup_storage_address",
"type": "string"
},
{
"description": "Backup storage directory path.",
"mandatory": false,
"modifiable": true,
"name": "backup_storage_path",
"type": "string"
},
{
"default_value": "none",
"description": "Cooperative monitoring type",
"enum_values": [
"none",
"majority_of_running",
"majority_of_all"
],
"mandatory": false,
"modifiable": true,
"name": "cooperative_monitoring_locks",
"type": "enum"
},
{
"description": "The API key used in communication with the ColumnStore admin daemon.",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_api_key",
"type": "string"
},
{
"default_value": "/cmapi/0.4.0",
"description": "The base path to be used when accessing the ColumnStore administrative daemon. If, for instance, a daemon URL is https://localhost:8640/cmapi/0.4.0/node/start then the admin_base_path is \"/cmapi/0.4.0\".",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_base_path",
"type": "string"
},
{
"default_value": 8640,
"description": "Port of the ColumnStore administrative daemon.",
"mandatory": false,
"modifiable": false,
"name": "cs_admin_port",
"type": "count"
},
{
"description": "Path to SQL file that is executed during node demotion",
"mandatory": false,
"modifiable": true,
"name": "demotion_sql_file",
"type": "path"
},
{
"default_value": false,
"description": "Enable read_only on all slave servers",
"mandatory": false,
"modifiable": true,
"name": "enforce_read_only_slaves",
"type": "bool"
},
{
"default_value": false,
"description": "Enforce a simple topology",
"mandatory": false,
"modifiable": true,
"name": "enforce_simple_topology",
"type": "bool"
},
{
"default_value": false,
"description": "Disable read_only on the current master server",
"mandatory": false,
"modifiable": true,
"name": "enforce_writable_master",
"type": "bool"
},
{
"default_value": 5,
"description": "Number of failures to tolerate before failover occurs",
"mandatory": false,
"modifiable": true,
"name": "failcount",
"type": "count"
},
{
"default_value": "90000ms",
"description": "Timeout for failover",
"mandatory": false,
"modifiable": true,
"name": "failover_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Manage server-side events",
"mandatory": false,
"modifiable": true,
"name": "handle_events",
"type": "bool"
},
{
"default_value": true,
"description": "Put the server into maintenance mode when it runs out of disk space",
"mandatory": false,
"modifiable": true,
"name": "maintenance_on_low_disk_space",
"type": "bool"
},
{
"default_value": 1,
"description": "mariadb-backup thread count.",
"mandatory": false,
"modifiable": true,
"name": "mariadb-backup_parallel",
"type": "int"
},
{
"default_value": "1G",
"description": "mariadb-backup buffer pool size.",
"mandatory": false,
"modifiable": true,
"name": "mariadb-backup_use_memory",
"type": "string"
},
{
"default_value": "primary_monitor_master",
"description": "Conditions that the master servers must meet",
"enum_values": [
"none",
"connecting_slave",
"connected_slave",
"running_slave",
"primary_monitor_master"
],
"mandatory": false,
"modifiable": true,
"name": "master_conditions",
"type": "enum_mask"
},
{
"default_value": "10000ms",
"description": "Master failure timeout",
"mandatory": false,
"modifiable": true,
"name": "master_failure_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Path to SQL file that is executed during node promotion",
"mandatory": false,
"modifiable": true,
"name": "promotion_sql_file",
"type": "path"
},
{
"default_value": 4444,
"description": "Listen port used for transferring server backup.",
"mandatory": false,
"modifiable": true,
"name": "rebuild_port",
"type": "count"
},
{
"description": "Custom CHANGE MASTER TO options",
"mandatory": false,
"modifiable": true,
"name": "replication_custom_options",
"type": "string"
},
{
"default_value": false,
"description": "Enable SSL when configuring replication",
"mandatory": false,
"modifiable": true,
"name": "replication_master_ssl",
"type": "bool"
},
{
"description": "Password for the user that is used for replication",
"mandatory": false,
"modifiable": true,
"name": "replication_password",
"type": "password"
},
{
"description": "User used for replication",
"mandatory": false,
"modifiable": true,
"name": "replication_user",
"type": "string"
},
{
"default_value": -1,
"description": "Replication lag limit at which the script is run",
"mandatory": false,
"modifiable": true,
"name": "script_max_replication_lag",
"type": "int"
},
{
"description": "List of servers that are never promoted",
"mandatory": false,
"modifiable": true,
"name": "servers_no_promotion",
"type": "serverlist"
},
{
"default_value": "",
"description": "Conditions that the slave servers must meet",
"enum_values": [
"linked_master",
"running_master",
"writable_master",
"primary_monitor_master",
"none"
],
"mandatory": false,
"modifiable": true,
"name": "slave_conditions",
"type": "enum_mask"
},
{
"default_value": true,
"description": "Is SSH host key check enabled.",
"mandatory": false,
"modifiable": true,
"name": "ssh_check_host_key",
"type": "bool"
},
{
"description": "SSH keyfile. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": false,
"name": "ssh_keyfile",
"type": "path"
},
{
"default_value": 22,
"description": "SSH port. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": true,
"name": "ssh_port",
"type": "count"
},
{
"default_value": "10000ms",
"description": "SSH connection and command timeout",
"mandatory": false,
"modifiable": true,
"name": "ssh_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "SSH username. Used for running remote commands on servers.",
"mandatory": false,
"modifiable": false,
"name": "ssh_user",
"type": "string"
},
{
"default_value": false,
"description": "Perform a switchover when a server runs out of disk space",
"mandatory": false,
"modifiable": true,
"name": "switchover_on_low_disk_space",
"type": "bool"
},
{
"default_value": "90000ms",
"description": "Timeout for switchover",
"mandatory": false,
"modifiable": true,
"name": "switchover_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Verify master failure",
"mandatory": false,
"modifiable": true,
"name": "verify_master_failure",
"type": "bool"
},
{
"default_value": 1,
"description": "Number of connection attempts to make to a server",
"mandatory": false,
"modifiable": true,
"name": "backend_connect_attempts",
"type": "count"
},
{
"default_value": "3000ms",
"description": "Connection timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_connect_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "3000ms",
"description": "Read timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_read_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "3000ms",
"description": "Write timeout for monitor connections",
"mandatory": false,
"modifiable": true,
"name": "backend_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "How often the disk space is checked",
"mandatory": false,
"modifiable": true,
"name": "disk_space_check_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Disk space threshold",
"mandatory": false,
"modifiable": true,
"name": "disk_space_threshold",
"type": "string"
},
{
"default_value": "all,master_down,master_up,slave_down,slave_up,server_down,server_up,synced_down,synced_up,donor_down,donor_up,lost_master,lost_slave,lost_synced,lost_donor,new_master,new_slave,new_synced,new_donor",
"description": "Events that cause the script to be called",
"enum_values": [
"all",
"master_down",
"master_up",
"slave_down",
"slave_up",
"server_down",
"server_up",
"synced_down",
"synced_up",
"donor_down",
"donor_up",
"lost_master",
"lost_slave",
"lost_synced",
"lost_donor",
"new_master",
"new_slave",
"new_synced",
"new_donor"
],
"mandatory": false,
"modifiable": true,
"name": "events",
"type": "enum_mask"
},
{
"default_value": "28800000ms",
"description": "The time the on-disk cached server states are valid for",
"mandatory": false,
"modifiable": true,
"name": "journal_max_age",
"type": "duration",
"unit": "ms"
},
{
"default_value": "2000ms",
"description": "How often the servers are monitored",
"mandatory": false,
"modifiable": true,
"name": "monitor_interval",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to monitor the servers",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"description": "Script to run whenever an event occurs",
"mandatory": false,
"modifiable": true,
"name": "script",
"type": "string"
},
{
"default_value": "90000ms",
"description": "Timeout for the script",
"mandatory": false,
"modifiable": true,
"name": "script_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "List of servers to use",
"mandatory": false,
"modifiable": true,
"name": "servers",
"type": "serverlist"
},
{
"description": "Username used to monitor the servers",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
}
],
"version": "V1.5.0"
},
"id": "mariadbmon",
"links": {
"self": "http://localhost:8989/v1/modules/mariadbmon/"
},
"type": "modules"
},
{
"attributes": {
"api": "protocol",
"commands": [],
"description": "The client to MaxScale MySQL protocol implementation",
"maturity": "GA",
"module_type": "Protocol",
"parameters": [
{
"default_value": true,
"description": "Allow use of the replication protocol through this listener",
"mandatory": false,
"modifiable": false,
"name": "allow_replication",
"type": "bool"
},
{
"default_value": "::",
"description": "Listener address",
"mandatory": false,
"modifiable": false,
"name": "address",
"type": "string"
},
{
"description": "Listener authenticator",
"mandatory": false,
"modifiable": false,
"name": "authenticator",
"type": "string"
},
{
"description": "Authenticator options",
"mandatory": false,
"modifiable": false,
"name": "authenticator_options",
"type": "string"
},
{
"description": "Path to connection initialization SQL",
"mandatory": false,
"modifiable": true,
"name": "connection_init_sql_file",
"type": "path"
},
{
"default_value": [
"character_set_client=auto",
"character_set_connection=auto",
"character_set_results=auto",
"max_allowed_packet=auto",
"system_time_zone=auto",
"time_zone=auto",
"tx_isolation=auto",
"maxscale=auto"
],
"description": "Metadata that's sent to all connecting clients.",
"mandatory": false,
"modifiable": true,
"name": "connection_metadata",
"type": "stringlist"
},
{
"default_value": 0,
"description": "Listener port",
"mandatory": false,
"modifiable": false,
"name": "port",
"type": "count"
},
{
"default_value": "MariaDBProtocol",
"description": "Listener protocol to use",
"mandatory": false,
"modifiable": false,
"name": "protocol",
"type": "module"
},
{
"description": "Allowed (sub)networks for proxy protocol connections. Should be a comma-separated list of IPv4 or IPv6 addresses.",
"mandatory": false,
"modifiable": true,
"name": "proxy_protocol_networks",
"type": "string"
},
{
"description": "Service to which the listener connects to",
"mandatory": true,
"modifiable": false,
"name": "service",
"type": "service"
},
{
"description": "Listener UNIX socket",
"mandatory": false,
"modifiable": false,
"name": "socket",
"type": "string"
},
{
"default_value": "default",
"description": "SQL parsing mode",
"enum_values": [
"default",
"oracle"
],
"mandatory": false,
"modifiable": true,
"name": "sql_mode",
"type": "enum"
},
{
"default_value": false,
"description": "Enable TLS for server",
"mandatory": false,
"modifiable": true,
"name": "ssl",
"type": "bool"
},
{
"description": "TLS certificate authority",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca",
"type": "path"
},
{
"deprecated": true,
"description": "Alias for 'ssl_ca'",
"mandatory": false,
"modifiable": true,
"name": "ssl_ca_cert",
"type": "path"
},
{
"description": "TLS public certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert",
"type": "path"
},
{
"default_value": 9,
"description": "TLS certificate verification depth",
"mandatory": false,
"modifiable": true,
"name": "ssl_cert_verify_depth",
"type": "count"
},
{
"description": "TLS cipher list",
"mandatory": false,
"modifiable": true,
"name": "ssl_cipher",
"type": "string"
},
{
"description": "TLS certificate revocation list",
"mandatory": false,
"modifiable": true,
"name": "ssl_crl",
"type": "string"
},
{
"description": "TLS private key",
"mandatory": false,
"modifiable": true,
"name": "ssl_key",
"type": "path"
},
{
"default_value": false,
"description": "Verify TLS peer certificate",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_certificate",
"type": "bool"
},
{
"default_value": false,
"description": "Verify TLS peer host",
"mandatory": false,
"modifiable": true,
"name": "ssl_verify_peer_host",
"type": "bool"
},
{
"default_value": "MAX",
"description": "Minimum TLS protocol version",
"enum_values": [
"MAX",
"TLSv10",
"TLSv11",
"TLSv12",
"TLSv13"
],
"mandatory": false,
"modifiable": true,
"name": "ssl_version",
"type": "enum"
},
{
"description": "Path to user and group mapping file",
"mandatory": false,
"modifiable": true,
"name": "user_mapping_file",
"type": "path"
}
],
"version": "V1.1.0"
},
"id": "MariaDBProtocol",
"links": {
"self": "http://localhost:8989/v1/modules/MariaDBProtocol/"
},
"type": "modules"
},
{
"attributes": {
"api": "parser",
"commands": [],
"description": "MariaDB SQL parser using sqlite3.",
"maturity": "GA",
"module_type": "Parser",
"parameters": null,
"version": "V1.0.0"
},
"id": "pp_sqlite",
"links": {
"self": "http://localhost:8989/v1/modules/pp_sqlite/"
},
"type": "modules"
},
{
"attributes": {
"api": "filter",
"commands": [
{
"attributes": {
"arg_max": 3,
"arg_min": 1,
"description": "Show unified log file as a JSON array",
"method": "GET",
"parameters": [
{
"description": "Filter to read logs from",
"required": true,
"type": "FILTER"
},
{
"description": "Start reading from this line",
"required": false,
"type": "[STRING]"
},
{
"description": "Stop reading at this line (exclusive)",
"required": false,
"type": "[STRING]"
}
]
},
"id": "log",
"links": {
"self": "http://localhost:8989/v1/modules/qlafilter/log/"
},
"type": "module_command"
}
],
"description": "A simple query logging filter",
"maturity": "GA",
"module_type": "Filter",
"parameters": [
{
"default_value": true,
"description": "Append new entries to log files instead of overwriting them",
"mandatory": false,
"modifiable": true,
"name": "append",
"type": "bool"
},
{
"default_value": "ms",
"description": "Duration in milliseconds (ms) or microseconds (us)",
"enum_values": [
"ms",
"milliseconds",
"us",
"microseconds"
],
"mandatory": false,
"modifiable": true,
"name": "duration_unit",
"type": "enum"
},
{
"description": "Exclude queries matching this pattern from the log",
"mandatory": false,
"modifiable": true,
"name": "exclude",
"type": "regex"
},
{
"description": "The basename of the output file",
"mandatory": true,
"modifiable": true,
"name": "filebase",
"type": "string"
},
{
"default_value": false,
"description": "Flush log files after every write",
"mandatory": false,
"modifiable": true,
"name": "flush",
"type": "bool"
},
{
"default_value": "date,user,query",
"description": "Type of data to log in the log files",
"enum_values": [
"service",
"session",
"date",
"user",
"query",
"reply_time",
"total_reply_time",
"default_db",
"num_rows",
"reply_size",
"transaction",
"transaction_time",
"num_warnings",
"error_msg",
"server",
"command"
],
"mandatory": false,
"modifiable": true,
"name": "log_data",
"type": "enum_mask"
},
{
"default_value": "session",
"description": "The type of log file to use",
"enum_values": [
"session",
"unified",
"stdout"
],
"mandatory": false,
"modifiable": true,
"name": "log_type",
"type": "enum_mask"
},
{
"description": "Only log queries matching this pattern",
"mandatory": false,
"modifiable": true,
"name": "match",
"type": "regex"
},
{
"default_value": " ",
"description": "Value used to replace newlines",
"mandatory": false,
"modifiable": true,
"name": "newline_replacement",
"type": "string"
},
{
"default_value": "",
"description": "Regular expression options",
"enum_values": [
"case",
"ignorecase",
"extended"
],
"mandatory": false,
"modifiable": true,
"name": "options",
"type": "enum_mask"
},
{
"default_value": ",",
"description": "Defines the separator between elements of a log entry",
"mandatory": false,
"modifiable": true,
"name": "separator",
"type": "string"
},
{
"description": "Log queries only from this network address",
"mandatory": false,
"modifiable": true,
"name": "source",
"type": "string"
},
{
"description": "Exclude queries from hosts that match this pattern",
"mandatory": false,
"modifiable": true,
"name": "source_exclude",
"type": "regex"
},
{
"description": "Log queries only from hosts that match this pattern",
"mandatory": false,
"modifiable": true,
"name": "source_match",
"type": "regex"
},
{
"default_value": false,
"description": "Write queries in canonical form",
"mandatory": false,
"modifiable": true,
"name": "use_canonical_form",
"type": "bool"
},
{
"description": "Log queries only from this user",
"mandatory": false,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Exclude queries from users that match this pattern",
"mandatory": false,
"modifiable": true,
"name": "user_exclude",
"type": "regex"
},
{
"description": "Log queries only from users that match this pattern",
"mandatory": false,
"modifiable": true,
"name": "user_match",
"type": "regex"
}
],
"version": "V1.1.1"
},
"id": "qlafilter",
"links": {
"self": "http://localhost:8989/v1/modules/qlafilter/"
},
"type": "modules"
},
{
"attributes": {
"api": "router",
"commands": [],
"description": "A connection based router to load balance based on connections",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": true,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Maximum acceptable replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": "running",
"description": "A comma separated list of server roles",
"enum_values": [
"master",
"slave",
"running",
"synced"
],
"mandatory": false,
"modifiable": true,
"name": "router_options",
"type": "enum_mask"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How often idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"deprecated": true,
"description": "Alias for 'wait_timeout'",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": false,
"description": "Ping connections unconditionally",
"mandatory": false,
"modifiable": true,
"name": "force_connection_keepalive",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"deprecated": true,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"deprecated": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "wait_timeout",
"type": "duration",
"unit": "ms"
}
],
"version": "V2.0.0"
},
"id": "readconnroute",
"links": {
"self": "http://localhost:8989/v1/modules/readconnroute/"
},
"type": "modules"
},
{
"attributes": {
"api": "router",
"commands": [
{
"attributes": {
"arg_max": 1,
"arg_min": 1,
"description": "Reset global GTID state in readwritesplit.",
"method": "POST",
"parameters": [
{
"description": "Readwritesplit service",
"required": true,
"type": "SERVICE"
}
]
},
"id": "reset-gtid",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/reset-gtid/"
},
"type": "module_command"
}
],
"description": "A Read/Write splitting router for enhancement read scalability",
"maturity": "GA",
"module_type": "Router",
"parameters": [
{
"default_value": "none",
"description": "Causal reads mode",
"enum_values": [
"none",
"local",
"global",
"fast_global",
"fast",
"universal",
"fast_universal",
"false",
"off",
"0",
"true",
"on",
"1"
],
"mandatory": false,
"modifiable": true,
"name": "causal_reads",
"type": "enum"
},
{
"default_value": "10000ms",
"description": "Timeout for the slave synchronization",
"mandatory": false,
"modifiable": true,
"name": "causal_reads_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Retry failed writes outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry",
"type": "bool"
},
{
"default_value": "10000ms",
"description": "Timeout for delayed_retry",
"mandatory": false,
"modifiable": true,
"name": "delayed_retry_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": false,
"description": "Create connections only when needed",
"mandatory": false,
"modifiable": true,
"name": "lazy_connect",
"type": "bool"
},
{
"default_value": false,
"description": "Use master for reads",
"mandatory": false,
"modifiable": true,
"name": "master_accept_reads",
"type": "bool"
},
{
"default_value": "fail_on_write",
"description": "Master failure mode behavior",
"enum_values": [
"fail_instantly",
"fail_on_write",
"error_on_write"
],
"mandatory": false,
"modifiable": true,
"name": "master_failure_mode",
"type": "enum"
},
{
"default_value": true,
"description": "Reconnect to master",
"mandatory": false,
"modifiable": true,
"name": "master_reconnection",
"type": "bool"
},
{
"default_value": "0ms",
"description": "Maximum replication lag",
"mandatory": false,
"modifiable": true,
"name": "max_replication_lag",
"type": "duration",
"unit": "ms"
},
{
"default_value": 255,
"description": "Maximum number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "max_slave_connections",
"type": "count"
},
{
"deprecated": true,
"description": "Alias for 'max_replication_lag'",
"mandatory": false,
"modifiable": true,
"name": "max_slave_replication_lag",
"type": "duration"
},
{
"default_value": false,
"description": "Optimistically offload transactions to slaves",
"mandatory": false,
"modifiable": true,
"name": "optimistic_trx",
"type": "bool"
},
{
"default_value": true,
"description": "Automatically retry failed reads outside of transactions",
"mandatory": false,
"modifiable": true,
"name": "retry_failed_reads",
"type": "bool"
},
{
"default_value": false,
"description": "Reuse identical prepared statements inside the same connection",
"mandatory": false,
"modifiable": true,
"name": "reuse_prepared_statements",
"type": "bool"
},
{
"default_value": 255,
"description": "Starting number of slave connections",
"mandatory": false,
"modifiable": true,
"name": "slave_connections",
"type": "count"
},
{
"default_value": "least_current_operations",
"description": "Slave selection criteria",
"enum_values": [
"least_global_connections",
"least_router_connections",
"least_behind_master",
"least_current_operations",
"adaptive_routing",
"LEAST_GLOBAL_CONNECTIONS",
"LEAST_ROUTER_CONNECTIONS",
"LEAST_BEHIND_MASTER",
"LEAST_CURRENT_OPERATIONS",
"ADAPTIVE_ROUTING"
],
"mandatory": false,
"modifiable": true,
"name": "slave_selection_criteria",
"type": "enum"
},
{
"default_value": false,
"description": "Lock connection to master after multi-statement query",
"mandatory": false,
"modifiable": true,
"name": "strict_multi_stmt",
"type": "bool"
},
{
"default_value": false,
"description": "Lock connection to master after a stored procedure is executed",
"mandatory": false,
"modifiable": true,
"name": "strict_sp_calls",
"type": "bool"
},
{
"default_value": true,
"description": "Prevent reconnections if temporary tables exist",
"mandatory": false,
"modifiable": true,
"name": "strict_tmp_tables",
"type": "bool"
},
{
"default_value": false,
"description": "Retry failed transactions",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay",
"type": "bool"
},
{
"default_value": 5,
"description": "Maximum number of times to retry a transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_attempts",
"type": "count"
},
{
"default_value": "full",
"description": "Type of checksum to calculate for results",
"enum_values": [
"full",
"result_only",
"no_insert_id"
],
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_checksum",
"type": "enum"
},
{
"default_value": 1048576,
"description": "Maximum size of transaction to retry",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_max_size",
"type": "size"
},
{
"default_value": false,
"description": "Retry transaction on deadlock",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_deadlock",
"type": "bool"
},
{
"default_value": false,
"description": "Retry transaction on checksum mismatch",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_retry_on_mismatch",
"type": "bool"
},
{
"default_value": true,
"description": "Prevent replaying of about-to-commit transaction",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_safe_commit",
"type": "bool"
},
{
"default_value": "30000ms",
"description": "Timeout for transaction replay",
"mandatory": false,
"modifiable": true,
"name": "transaction_replay_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "all",
"description": "Whether to route SQL variable modifications to all servers or only to the master",
"enum_values": [
"all",
"master"
],
"mandatory": false,
"modifiable": true,
"name": "use_sql_variables_in",
"type": "enum"
},
{
"default_value": false,
"deprecated": true,
"description": "Retrieve users from all backend servers instead of only one",
"mandatory": false,
"modifiable": true,
"name": "auth_all_servers",
"type": "bool"
},
{
"default_value": "300000ms",
"description": "How often idle connections are pinged",
"mandatory": false,
"modifiable": true,
"name": "connection_keepalive",
"type": "duration",
"unit": "ms"
},
{
"deprecated": true,
"description": "Alias for 'wait_timeout'",
"mandatory": false,
"modifiable": true,
"name": "connection_timeout",
"type": "duration"
},
{
"default_value": false,
"description": "Disable session command history",
"mandatory": false,
"modifiable": true,
"name": "disable_sescmd_history",
"type": "bool"
},
{
"default_value": false,
"description": "Allow the root user to connect to this service",
"mandatory": false,
"modifiable": true,
"name": "enable_root_user",
"type": "bool"
},
{
"default_value": false,
"description": "Ping connections unconditionally",
"mandatory": false,
"modifiable": true,
"name": "force_connection_keepalive",
"type": "bool"
},
{
"default_value": "-1ms",
"description": "Put connections into pool after session has been idle for this long",
"mandatory": false,
"modifiable": true,
"name": "idle_session_pool_time",
"type": "duration",
"unit": "ms"
},
{
"default_value": true,
"description": "Match localhost to wildcard host",
"mandatory": false,
"modifiable": true,
"name": "localhost_match_wildcard_host",
"type": "bool"
},
{
"default_value": true,
"description": "Log a warning when client authentication fails",
"mandatory": false,
"modifiable": true,
"name": "log_auth_warnings",
"type": "bool"
},
{
"default_value": false,
"description": "Log debug messages for this service (debug builds only)",
"mandatory": false,
"modifiable": true,
"name": "log_debug",
"type": "bool"
},
{
"default_value": false,
"description": "Log info messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_info",
"type": "bool"
},
{
"default_value": false,
"description": "Log notice messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_notice",
"type": "bool"
},
{
"default_value": false,
"description": "Log warning messages for this service",
"mandatory": false,
"modifiable": true,
"name": "log_warning",
"type": "bool"
},
{
"default_value": 0,
"description": "Maximum number of connections",
"mandatory": false,
"modifiable": true,
"name": "max_connections",
"type": "count"
},
{
"default_value": 50,
"description": "Session command history size",
"mandatory": false,
"modifiable": true,
"name": "max_sescmd_history",
"type": "count"
},
{
"default_value": "60000ms",
"description": "How long a session can wait for a connection to become available",
"mandatory": false,
"modifiable": true,
"name": "multiplex_timeout",
"type": "duration",
"unit": "ms"
},
{
"default_value": "0ms",
"description": "Network write timeout",
"mandatory": false,
"modifiable": true,
"name": "net_write_timeout",
"type": "duration",
"unit": "ms"
},
{
"description": "Password for the user used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "password",
"type": "password"
},
{
"default_value": true,
"description": "Prune old session command history if the limit is exceeded",
"mandatory": false,
"modifiable": true,
"name": "prune_sescmd_history",
"type": "bool"
},
{
"default_value": "primary",
"description": "Service rank",
"enum_values": [
"primary",
"secondary"
],
"mandatory": false,
"modifiable": true,
"name": "rank",
"type": "enum"
},
{
"default_value": -1,
"description": "Number of statements kept in memory",
"mandatory": false,
"modifiable": true,
"name": "retain_last_statements",
"type": "int"
},
{
"default_value": false,
"description": "Enable session tracing for this service",
"mandatory": false,
"modifiable": true,
"name": "session_trace",
"type": "bool"
},
{
"default_value": false,
"deprecated": true,
"description": "Track session state using server responses",
"mandatory": false,
"modifiable": true,
"name": "session_track_trx_state",
"type": "bool"
},
{
"default_value": true,
"deprecated": true,
"description": "Strip escape characters from database names",
"mandatory": false,
"modifiable": true,
"name": "strip_db_esc",
"type": "bool"
},
{
"description": "Username used to retrieve database users",
"mandatory": true,
"modifiable": true,
"name": "user",
"type": "string"
},
{
"description": "Load additional users from a file",
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file",
"type": "path"
},
{
"default_value": "add_when_load_ok",
"description": "When and how the user accounts file is used",
"enum_values": [
"add_when_load_ok",
"file_only_always"
],
"mandatory": false,
"modifiable": false,
"name": "user_accounts_file_usage",
"type": "enum"
},
{
"description": "Custom version string to use",
"mandatory": false,
"modifiable": true,
"name": "version_string",
"type": "string"
},
{
"default_value": "0ms",
"description": "Connection idle timeout",
"mandatory": false,
"modifiable": true,
"name": "wait_timeout",
"type": "duration",
"unit": "ms"
}
],
"version": "V1.1.0"
},
"id": "readwritesplit",
"links": {
"self": "http://localhost:8989/v1/modules/readwritesplit/"
},
"type": "modules"
}
],
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/"
}
}GET /v1/maxscale/modules/:module/:commandPOST /v1/maxscale/modules/:module/:commandPOST /v1/maxscale/modules/mariadbmon/reset-replication?MariaDB-Monitor&server1{
"links": {
"self": "http://localhost:8989/v1/maxscale/modules/mariadbmon/reset-replication"
},
"meta": [ // Output of module command (module dependent)
{
"name": "value"
}
]
}GET /v1/maxscale/query_classifier/classify?sql=<statement>GET /v1/maxscale/query_classifier/classify?sql=SELECT+1{
"data": {
"attributes": {
"canonical": "SELECT ?",
"fields": [],
"functions": [],
"operation": "sql::OP_SELECT",
"parse_result": "Parser::Result::PARSED",
"type_mask": "sql::TYPE_READ"
},
"id": "classify",
"type": "classify"
},
"links": {
"self": "http://localhost:8989/v1/maxscale/query_classifier/classify/"
}
}core_fileauto_tunethreadsthreads_maxrebalance_periodrebalance_thresholdrebalance_windowskip_name_resolvehost_cache_sizeauth_connect_timeoutauth_read_timeoutauth_write_timeoutquery_retriesquery_retry_timeoutpassivems_timestampsyslogmaxloglog_warninglog_noticelog_infolog_debugtrace_file_dirtrace_file_sizelog_warn_super_userlog_augmentationlog_throttlinglogdirdatadirsecretsdirlibdirsharedircachedirpiddirexecdirconnector_plugindirpersistdirmodule_configdirlanguagequery_classifierquery_classifier_cache_sizequery_classifier_argssubstitute_variablessql_modelocal_addressusers_refresh_timeusers_refresh_intervalretain_last_statementsdump_last_statementssession_tracesession_trace_matchwriteq_high_waterwriteq_low_waterpersist_runtime_changesload_persisted_configsmax_auth_errors_until_blockdebugadmin_hostadmin_portadmin_authadmin_ssl_keyadmin_ssl_certadmin_ssl_ca_certadmin_ssl_caadmin_ssl_versionadmin_ssl_cipheradmin_enabledadmin_guiadmin_secure_guiadmin_log_auth_failuresadmin_pam_readwrite_serviceadmin_pam_readonly_serviceadmin_readwrite_hostsadmin_readonly_hostsadmin_jwt_algorithmadmin_jwt_keyadmin_jwt_max_ageadmin_oidc_urladmin_verify_urladmin_jwt_issueradmin_auditadmin_audit_fileadmin_audit_exclude_methodsconfig_sync_clusterconfig_sync_userconfig_sync_passwordconfig_sync_dbconfig_sync_intervalconfig_sync_timeoutkey_managerrouterfilterstargetsserversclusteruserpasswordenable_root_userlocalhost_match_wildcard_hostversion_stringauth_all_serversstrip_db_esclog_auth_warningslog_warninglog_noticelog_infolog_debugwait_timeoutmax_connectionssession_track_trx_stateretain_last_statementsconnection_keepaliveforce_connection_keepalivenet_write_timeoutmax_sescmd_historyprune_sescmd_historydisable_sescmd_historyuser_accounts_fileuser_accounts_file_usageidle_session_pool_timemultiplex_timeoutaddressportsocketprivate_addressmonitorusermonitorpwextra_portpersistpoolmaxpersistmaxtimemax_routing_connectionsproxy_protocoldisk_space_thresholdrankpriorityreplication_custom_optionsserviceprotocoladdressportsocketauthenticatorauthenticator_optionssql_modeproxy_protocol_networksconnection_init_sql_fileuser_mapping_fileconnection_metadataMariaDB or MariaDBClientCDCPostgresql or Postgresprotocolnosqlprotocolsslssl_keyssl_certssl_ca_certssl_cassl_versionssl_cipherssl_cert_verify_depthssl_verify_peer_certificatessl_verify_peer_hostssl_crlgrep -Eautooracleon_errorneverTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv13HS256HS384HS512RS256RS384RS512PS256PS384PS512ES256ES384ES512ED25519ED448HS256PUTPOSTPATCHDELETEHEADOPTIONSCONNECTTRACE0sfile_only_always""""secondary0""oracleTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv13# This is a comment before a parameter
some_parameter=123[MyService]
type=service
router=readconnroute
servers=server1,
server2,
server3max_size=1099511628000
max_size=1073741824Ki
max_size=1048576Mi
max_size=1024Gi
max_size=1Timax_size=1000000000000
max_size=1000000000k
max_size=1000000M
max_size=1000G
max_size=1Tsoft_ttl=1h
soft_ttl=60m
soft_ttl=60min
soft_ttl=3600s
soft_ttl=3600000mssome_param=42%router_options=master,slavepath_list_parameter=/tmp/something.log:/var/log/maxscale/maxscale.log# Valid options are:
# threads=[<number of threads> | auto ]
[MaxScale]
threads=autorebalance_period=10srebalance_threshold=15auth_connect_timeout=10s# Note: to get a clean compressed file, kill the 'tail' process and instead of
# using Ctrl+C to kill 'gzip'.
tail -F /var/log/maxscale/maxscale.trace | gzip > maxscale.trace.gz# Valid options are:
# log_augmentation=<0|1>
log_augmentation=1# A valid value looks like
# log_throttling = X, Y, Z
#
# where the first value X is a positive integer and means the number of times
# a specific error may be logged within a duration of Y, before the logging
# of that error is suppressed for a duration of Z.
log_throttling=8, 2s, 15000mslog_throttling=log_throttling=0, 0, 0logdir=/var/log/maxscale/datadir=/var/lib/maxscale/libdir=/usr/lib64/maxscale/cachedir=/var/cache/maxscale/execdir=/usr/bin/connector_plugindir=/usr/lib64/maxscale/plugin/persistdir=/var/lib/maxscale/maxscale.cnf.d/module_configdir=/etc/maxscale.modules.d/language=/var/lib/maxscale/# 1MB query classifier cache
query_classifier_cache_size=1MBsome_parameter=$SOME_VALUEsubstitute_variables=truesql_mode=oracleset sql_mode=oracle;set sql_mode=default;local_address=192.168.1.254users_refresh_time=120susers_refresh_interval=2hretain_last_statements=20dump_last_statements=on_errorsession_trace=20session_trace=1000
session_trace_match=/You have an error in your SQL syntax/REST API HTTP daemon error: Setting priorities to ... failed: The request is invalid.admin_ssl_cipher=SECURE256:-ECDHE-RSA:-AES-256-CCM:+AES-128-GCMadmin_readwrite_hosts=192.168.1.1,127.0.0.1/21admin_readonly_hosts=mydomain%.comGRANT SELECT, INSERT, UPDATE, CREATE ON `mysql`.`maxscale_config`CREATE TABLE IF NOT EXISTS mysql.maxscale_config(
cluster VARCHAR(256) PRIMARY KEY,
version BIGINT NOT NULL,
config JSON NOT NULL,
origin VARCHAR(254) NOT NULL,
nodes JSON NOT NULL
) ENGINE=InnoDB;key_manager=file
file.keyfile=/path/to/keyfileevent.X.facility=LOG_LOCAL0
event.X.level=LOG_ERRauth,authpriv.* /var/log/auth.logevent.authentication_failure.facility=LOG_AUTH
event.authentication_failure.level=LOG_CRIT[Test-Service]
type=servicerouter=readconnroute
router_options=slaverouter=readconnroute
router_options=master,slavefilters=counter | QLAtargets=My-Service,server2servers=server1,server2,server3cluster=TheMonitoruser=maxscale
password=Mhu87p2Duser=maxscale
password=Mhu87p2Dversion_string=10.11.2-MariaDB-RWsplit[Test-Service]
wait_timeout=300s[Test-Service]
max_connections=100session_track_state_change = ON
session_track_transaction_info = CHARACTERISTICSmaxctrl alter service MyService retain_last_statements 5SET @my_planet='Earth'; -- This command will be removed by history simplification
SET @my_home='My home is: ' || @my_planet; -- Command #1 in the history
SET @my_planet='Earth'; -- Command #2 in the historyuser_accounts_file=/home/root/users.json{
"user": [
{
"user": "test1",
"host": "%",
"global_db_priv": true
},
{
"user": "test2",
"host": "127.0.0.1",
"password": "*032169CDF0B90AF8C00992D43D354E29A2EACB42",
"plugin": "mysql_native_password",
"default_role": "role2"
},
{
"user": "",
"host": "%",
"plugin": "pam",
"proxy_priv": true
}
],
"db": [
{
"user": "test2",
"host": "127.0.0.1",
"db": "test"
}
],
"roles_mapping": [
{
"user": "test2",
"host": "127.0.0.1",
"role": "role2"
}
]
}user_accounts_file_usage=file_only_alwaysidle_session_pool_time=900msmax_slave_connections=1
lazy_connect=1
transaction_replay=true[server1]
type=server
max_routing_connections=1000 #this should be based on MariaDB Server capacity
persistpoolmax=1000 #same as above
persistmaxtime=10
#other server settings...
[myservice]
type=service
max_slave_connections=1
transaction_replay=true
idle_session_pool_time=500ms
lazy_connect=1
#other service settings...multiplex_timeout=33s[MyMariaDBServer1]
type=server
address=127.0.0.1
port=3000monitoruser=mymonitoruser
monitorpw=mymonitorpasswdmonitoruser=mymonitoruser
monitorpw=mymonitorpasswdmax_routing_connections=1234/data:80disk_space_threshold=*:80
disk_space_threshold=/data:80
disk_space_threshold=/data1:80,/data2:60,*:90> use information_schema;
> select * from disks;
+-----------+----------------------+-----------+----------+-----------+
| Disk | Path | Total | Used | Available |
+-----------+----------------------+-----------+----------+-----------+
| /dev/sda3 | / | 47929956 | 34332348 | 11139820 |
| /dev/sdb1 | /data | 961301832 | 83764 | 912363644 |
...[main-site-primary]
type=server
address=192.168.0.11
rank=primary
[main-site-replica]
type=server
address=192.168.0.12
rank=primary
[DR-site-primary]
type=server
address=192.168.0.21
rank=secondary
[DR-site-replica]
type=server
address=192.168.0.22
rank=secondary[MyListener1]
type=listener
service=MyService1
port=3006proxy_protocol_networks=192.168.0.1,198.168.0.0/16connection_init_sql_file=/home/dba/init_queries.txtset @myvar = 'mytext';
set @myvar2 = 4;user_mapping_file=/home/root/mapping.json{
"user_map": [
{
"original_user": "bob",
"mapped_user": "janet"
},
{
"original_user": "karen",
"mapped_user": "janet"
}
],
"group_map": [
{
"original_group": "visitors",
"mapped_user": "db_user"
}
],
"server_credentials": [
{
"mapped_user": "janet",
"password": "secret_pw",
"plugin": "mysql_native_password"
},
{
"mapped_user": "db_user",
"password": "secret_pw2",
"plugin": "pam"
}
]
}connection_metadata=redirect_url=localhost:3306,service_name=my-service,max_allowed_packet=auto[Monitor1]
type=monitor
module=mariadbmon
user=the_user
password=the_password
handle_events=false
monitor_interval=2000ms
backend_connect_timeout = 3s
backend_connect_attempts = 5
servers=Server1, Server2
[Monitor2]
type=monitor
module=mariadbmon
user=the_user
password=the_password
handle_events=false
monitor_interval=2000ms
backend_connect_timeout = 3s
backend_connect_attempts = 5
servers=Server3, Server4[Monitor-Common]
type=include
module=mariadbmon
user=the_user
password=the_password
handle_events=false
monitor_interval=2000ms
backend_connect_timeout = 3s
backend_connect_attempts = 5
[Monitor1]
type=monitor
@include=Monitor-Common
servers=Server1, Server2
[Monitor2]
type=monitor
@include=Monitor-Common
servers=Server3, Server3@include=Some-Common-Attributes, Other-Common-Attributes[Monitor2]
type=monitor
@include=Monitor-Common
servers=Server3, Server3
backend_connect_timeout = 5s[Monitor-Common]
type=include
@include=Base-Common
...
[Monitor2]
type=monitor
@include=Monitor1
...ssl_verify_peer_certificate=true
ssl_verify_peer_host=true[server1]
type=server
address=10.131.24.62
port=3306
ssl=true
ssl_cert=/usr/local/mariadb/maxscale/ssl/crt.max-client.pem
ssl_key=/usr/local/mariadb/maxscale/ssl/key.max-client.pem
ssl_ca_cert=/usr/local/mariadb/maxscale/ssl/crt.ca.maxscale.pem[RW-Split-Listener]
type=listener
service=RW-Split-Router
port=3306
ssl=true
ssl_cert=/usr/local/mariadb/maxscale/ssl/crt.maxscale.pem
ssl_key=/usr/local/mariadb/maxscale/ssl/key.csr.maxscale.pem
ssl_ca_cert=/usr/local/mariadb/maxscale/ssl/crt.ca.maxscale.pem# Usage: maxkeys [PATH]
maxkeys /var/lib/maxscale/# Usage: maxpasswd PATH PASSWORD
maxpasswd /var/lib/maxscale/ MaxScalePw001
61DD955512C39A4A8BC4BB1E5F116705[Split-Service]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=maxscale
password=61DD955512C39A4A8BC4BB1E5F116705├──────────────┼─────────────────────────────────────────────────────────────┤
│ Config Sync │ { │
│ │ "checksum": "3dd6b467760d1d2023f2bc3871a60dd903a3341e", │
│ │ "nodes": { │
│ │ "maxscale": "OK", │
│ │ "maxscale2": "OK" │
│ │ }, │
│ │ "origin": "maxscale", │
│ │ "status": "OK", │
│ │ "version": 2 │
│ │ } │
├──────────────┼─────────────────────────────────────────────────────────────┤maxctrl alter maxscale config_sync_cluster ""maxscale --export-config=/tmp/maxscale.cnf.combined[maxscale]
key_manager=file
file.keyfile=/var/lib/maxscale/encryption.key
[NoSQL-Listener]
type=listener
service=My-Service
protocol=nosqlprotocol
nosqlprotocol.authentication_key_id=1
nosqlprotocol.authentication_user=my_user
nosqlprotocol.authentication_password=my_password
# Add services, servers, monitors etc.$ openssl rand -hex 32|vault kv put secret/1 data=-
== Secret Path ==
secret/data/1
======= Metadata =======
Key Value
--- -----
created_time 2022-06-23T06:50:55.29063873Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 1$ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬────────┬────────┬─────┐
│ Id │ 0 │ 1 │ 2 │ 3 │ All │
├────────────────────────┼────────┼────────┼────────┼────────┼─────┤
│ State │ Active │ Active │ Active │ Active │ N/A │
├────────────────────────┼────────┼────────┼────────┼────────┼─────┤
...$ bin/maxctrl alter maxscale threads=2
OK
$ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬──────────┬──────────┬─────────┐
│ Id │ 0 │ 1 │ 2 │ 3 │ All │
├────────────────────────┼────────┼────────┼──────────┼──────────┼─────────┤
│ State │ Active │ Active │ Draining │ Draining │ N/A │
├────────────────────────┼────────┼────────┼──────────┼──────────┼─────────┤
...┌────────────────────────┬────────┬────────┬─────────┬──────────┬────────┐
│ Id │ 0 │ 1 │ 2 │ 3 │ All │
├────────────────────────┼────────┼────────┼─────────┼──────────┼────────┤
│ State │ Active │ Active │ Dormant │ Draining │ N/A │
├────────────────────────┼────────┼────────┼─────────┼──────────┼────────┤
...$ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬──────┐
│ Id │ 0 │ 1 │ All │
├────────────────────────┼────────┼────────┼──────┤
│ State │ Active │ Active │ N/A │
├────────────────────────┼────────┼────────┼──────┤
...$ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬─────────┬──────────┬────────┐
│ Id │ 0 │ 1 │ 2 │ 3 │ All │
├────────────────────────┼────────┼────────┼─────────┼──────────┼────────┤
│ State │ Active │ Active │ Dormant │ Draining │ N/A │
├────────────────────────┼────────┼────────┼─────────┼──────────┼────────┤
...$ bin/maxctrl alter maxscale threads=3
OK
wikman@johan-P53s:maxscale $ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬────────┬──────────┬────────┐
│ Id │ 0 │ 1 │ 2 │ 3 │ All │
├────────────────────────┼────────┼────────┼────────┼──────────┼────────┤
│ State │ Active │ Active │ Active │ Draining │ N/A │
├────────────────────────┼────────┼────────┼────────┼──────────┼────────┤
...$ bin/maxctrl show threads
┌────────────────────────┬────────┬────────┬────────┬──────┐
│ Id │ 0 │ 1 │ 2 │ All │
├────────────────────────┼────────┼────────┼────────┼──────┤
│ State │ Active │ Active │ Active │ N/A │
├────────────────────────┼────────┼────────┼────────┼──────┤
...$ maxctrl show maxscale
...
├──────────────┼────────────────────────────────────────────────────────────────────────────┤
│ System │ { │
│ │ "machine": { │
│ │ "cores_available": 8, │
│ │ "cores_physical": 8, │
│ │ "cores_virtual": 4, │
│ │ "memory_available": 20858544128, │
│ │ "memory_physical": 41717088256 │
│ │ }, │
│ │ "maxscale": { │
│ │ "query_classifier_cache_size": 6257563238, │
│ │ "threads": 8 │
│ │ }, │
│ │ "os": { │
│ │ "machine": "x86_64", │
│ │ "nodename": "johan-P53s", │
│ │ "release": "5.4.0-125-generic", │
│ │ "sysname": "Linux", │
│ │ "version": "#141~18.04.1-Ubuntu SMP Thu Aug 11 20:15:56 UTC 2022" │
│ │ } │
│ │ } │
└──────────────┴────────────────────────────────────────────────────────────────────────────┘[maxscale]
threads=4
query_classifier_cache_size=3100000000
...WatchdogSec=30s