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...
Choose the right installation method for MariaDB MaxScale. This section includes guides for building from source code and installing via tarballs for custom or non-standard deployments.
Access essential guides for deploying MariaDB MaxScale including installation, configuration, upgrades, and using the MaxGUI browser-based interface for management and monitoring.
Master the Read/Write Split Router. This collection of guides details how to configure query load balancing, automatic failover, transaction replay, and causal consistency settings.
Overview of security features in MariaDB MaxScale, including hardening guides, authentication configuration, and encryption settings for protecting database traffic and administrative access.
Manage your MariaDB MaxScale instance using MaxCtrl, a command-line utility for the REST API. Monitor status, configure services, and handle administrative tasks efficiently.
Get started with MariaDB MaxScale, the advanced database proxy. These guides provide concise instructions for installation, configuration, and understanding core concepts for new deployments.
Centralize your database proxy administration. This guide outlines tools and procedures for deploying, configuring, and maintaining MariaDB MaxScale instances.
Explore the core capabilities of MariaDB MaxScale. This overview covers intelligent routing automated failover security filters and Kafka integration for scalable database architectures.
Explore hands-on guides for MariaDB MaxScale. These tutorials cover essential configurations including automatic failover, read-write splitting, security setup, and database sharding.
Discover common deployment scenarios for MariaDB MaxScale. Learn how to leverage its features for high availability, read-write splitting, and load balancing to optimize your database.
Perform day-to-day operations on MaxScale. This section covers managing REST API users, rotating logs, and enabling TLS for secure client connections.
Complete MariaDB MaxScale guide. Complete resource for intelligent query routing, load balancing, connection pooling, and high availability.
Understand the architecture of MariaDB MaxScale. This section details the core components, including routers, monitors, and filters, that power the database proxy.
Manage MariaDB MaxScale visually with MaxGUI. This browser-based dashboard simplifies configuration, monitoring, and administration tasks for your database proxy instances.
maxscale.cnf.$ sudo systemctl restart maxscale[split-router]
type = service
router = readwritesplit
...
master_reconnection = true
master_failure_mode = fail_on_writeCustomize load balancing algorithms. Explore options for the slave_selection_criteria parameter, including adaptive routing and least-global-connections strategies.
Learn to inspect MaxScale's runtime state using the JSON report from maxctrl. Use jq to query servers services and monitors for detailed debugging and analysis.
Set up monitoring for Galera Clusters. Configure the galeramon module to automatically detect the primary node and manage cluster membership within MaxScale.
Create new users for the MaxScale REST API using MaxCtrl. This page explains the difference between basic and admin users and provides command examples for adding credentials to your system.
Define your database backend servers in MaxScale. Learn to configure server objects set addresses and ports and and enable TLS encryption for secure connections.
Optimize applications for read-write splitting. This guide outlines best practices for transaction management and connection handling to ensure compatibility with MaxScale.
[maxscale]
...
admin_host = 0.0.0.0
admin_port = 8443$ sudo systemctl restart maxscale[split-router]
type = service
router = readwritesplit
...
delayed_retry = true
delayed_retry_timeout = 30s$ maxctrl --secure
--user=maxscale_rest_admin
--password=maxscale_rest_admin_password
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
set server server1 maintenance$ maxctrl --secure
--user=maxscale_rest_admin
--password=maxscale_rest_admin_password
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem $ sudo systemctl restart maxscaleFilters 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.
Secure client connections with MaxScale authentication modules. This reference details configuration for Native, PAM, GSSAPI, and Ed25519 plugins to validate user credentials.
CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';[split-router]
type = service
router = readwritesplit
...
retry_failed_reads = true$ sudo systemctl restart maxscale[Replication-Monitor]
type=monitor
module=mariadbmon
servers=dbserv1,dbserv2,dbserv3
user=monitor_user
password=my_password
monitor_interval=2000ms[split-router]
type = service
router = readwritesplit
...
slave_selection_criteria = LEAST_GLOBAL_CONNECTIONS$ sudo systemctl restart maxscalemaxctrl create report maxctrl-report.jsonjq '.servers.data[].id' < maxctrl-report.jsonjq '.services.data[].id' < maxctrl-report.jsonjq '.monitors.data[].id' < maxctrl-report.jsonjq '.listeners.data[].id' < maxctrl-report.jsonjq '.filters.data[].id' < maxctrl-report.jsonjq 'keys' < maxctrl-report.jsonjq '.servers.data[0]|keys' < maxctrl-report.jsonjq '.services.data|map(select(.id == "RW-Split-Router"))' < maxctrl-report.jsonjq '.monitors.data|map(select(.id == "MariaDB-Monitor"))' < maxctrl-report.jsonjq '.servers.data|map(select(.id == "DB-1"))' < maxctrl-report.jsonjq '.servers.data|map(select(.id == "DB-1"))|.[].relationships.monitors.data' < maxctrl-report.jsonjq '[.threads.data[].attributes.stats.query_classifier_cache.size]|add' < maxctrl-report.json$ maxctrl --secure
--user=admin
--password=mariadb
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
create user "maxscale_rest" "maxscale_rest_password"$ maxctrl --secure
--user=admin
--password=mariadb
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
create user "maxscale_rest_admin" "maxscale_rest_admin_password" --type=admin[my_service]
type=service
router=readwritesplit
servers=server1,server2
user=maxscale_user # User MaxScale uses to connect to backend MariaDB for UAM
password=maxscale_password
[my_listener]
type=listener
service=my_service
protocol=MariaDBClient
port=3306
authenticator=MariaDBAuth # Example: Use the standard MariaDB password authentication
# authenticator=GSSAPIAuth # Or GSSAPI authentication
# authenticator=PAMAuth # Or PAM authentication[my_listener]
# ... other settings ...
authenticator=MariaDBAuth
authenticator_options=skip_authentication=true,match_host=false[split-router]
type = service
router = readwritesplit
...
transaction_replay = true
transaction_replay_max_size = 10Mi
transaction_replay_attempts = 10
transaction_replay_retry_on_deadlock = true$ sudo systemctl restart maxscale$ maxctrl --secure
--user=maxscale_rest_admin
--password=maxscale_rest_admin_password
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
destroy user "admin"[split-router]
type = service
router = readwritesplit
...
max_sescmd_history = 1500
prune_sescmd_history = true$ sudo systemctl restart maxscale[split-router]
type = service
router = readwritesplit
...
disable_sescmd_history = true$ sudo systemctl restart maxscaleCREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';
GRANT REPLICA MONITOR ON *.* TO 'monitor_user'@'%';--force--forceCompile MariaDB MaxScale from source code. This guide details the build prerequisites, CMake configuration options, and steps to generate custom binary packages for your system.
Learn how to secure your MaxCtrl connections using TLS. This guide details the necessary MaxScale configuration parameters and command-line flags to enable encrypted administrative sessions.
maxctrl destroy server mariadbgalera3 --force● maxscale.service - MariaDB MaxScale Database Proxy
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2024-09-23 08:57:14 CEST; 6s agoAccess the complete reference for MariaDB MaxScale. Find detailed documentation on configuration parameters, MaxCtrl commands, routers, monitors,

SET USER[Listener]
type=listener
address=127.0.0.1
port=3306
service=Service
authenticator=mariadbauth,parsecauth/var/lib/maxscale. If a different directory is required, it can be given as the first argument to the program. For more information, see maxkeys --help.maxkeysgit 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 packageCREATE USER 'maxscale' IDENTIFIED BY 'maxscale_passwd';
GRANT ALL PRIVILEGES ON *.* to 'maxscale';[maxscale]
threads=auto
[server1]
type=server
address=127.0.0.1
port=3306
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1
user=maxscale
password=maxscale_passwd
monitor_interval=2s
[Read-Write-Listener]
type=listener
service=Read-Write-Service
port=4006
[Read-Write-Service]
type=service
router=readwritesplit
cluster=MariaDB-Monitor
user=maxscale
password=maxscale_passwd┌─────────┬───────────┬───────┬─────────────┬─────────────────┬─────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │ GTID │ Monitor │
├─────────┼───────────┼───────┼─────────────┼─────────────────┼─────────┼─────────────────┤
│ server1 │ 127.0.0.1 │ 3306 │ 0 │ Master, Running │ 1-100-3 │ MariaDB-Monitor │
└─────────┴───────────┴───────┴─────────────┴─────────────────┴─────────┴─────────────────┘2024-09-17 17:55:55 notice : Read 16 user@host entries from 'server1' for service 'Read-Write-Service'.mariadb -h127.0.0.1 -P4006 -umaxscale -pmaxscale_passwd
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 11.4.3-MariaDB-log MariaDB Server
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)]> select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0,001 sec)[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3
user=maxscale
password=maxscale_passwd
monitor_interval=2s┌─────────┬───────────┬───────┬─────────────┬─────────────────┬─────────┬─────────────────┐
│ Server │ Address │ Port │ Connections │ State │ GTID │ Monitor │
├─────────┼───────────┼───────┼─────────────┼─────────────────┼─────────┼─────────────────┤
│ server1 │ 127.0.0.1 │ 3306 │ 0 │ Master, Running │ 1-100-3 │ MariaDB-Monitor │
├─────────┼───────────┼───────┼─────────────┼─────────────────┼─────────┼─────────────────┤
│ server2 │ 127.0.0.1 │ 3307 │ 0 │ Slave, Running │ 1-100-3 │ MariaDB-Monitor │
├─────────┼───────────┼───────┼─────────────┼─────────────────┼─────────┼─────────────────┤
│ server3 │ 127.0.0.1 │ 3308 │ 0 │ Slave, Running │ 1-100-3 │ MariaDB-Monitor │
└─────────┴───────────┴───────┴─────────────┴─────────────────┴─────────┴─────────────────┘[MyLogFilter]
type=filter
module=qlafilter
filebase=/var/log/maxscale/query_log
log_type=unified
flush=true[Read-Write-Service]
type=service
filters=MyLogFilter
router=readwritesplit
cluster=MariaDB-Monitor
user=maxscale
password=maxscale_passwd$ maxctrl create user "maxscale_rest_admin" "maxscale_rest_admin_password" --type=admin[maxscale]
...
admin_host = 0.0.0.0
admin_port = 8443[maxscale]
...
admin_ssl_key=/certs/server-key.pem
admin_ssl_cert=/certs/server-cert.pem
admin_ssl_ca_cert=/certs/ca-cert.pem$ maxctrl --secure
--user=maxscale_rest_admin
--password=maxscale_rest_admin_password
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pemmaxctrl destroy listener \
Round-Robin-Service \
Round-Robin-Listenermaxctrl unlink service \
Round-Robin-Service \
mariadbgalera3maxctrl show servicesmaxctrl unlink monitor \
MariaDB-Monitor \
mariadbgalera3maxctrl show monitorsmaxctrl destroy server \
mariadbgalera3maxctrl show serversecho "<ENTERPRISE_TOKEN>" | docker login docker.mariadb.com -u <your-mariadb.id-email> --password-stdindocker pull docker.mariadb.com/maxscale:latestdocker pull docker.mariadb.com/maxscale:25.01.1docker run -d -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latest## Authenticate, pull, and run in one sequence
echo "<ENTERPRISE_TOKEN>" | docker login docker.mariadb.com -u <your-mariadb.id-email> --password-stdin
docker pull docker.mariadb.com/maxscale:latest
docker run -d -p 3306:3306 -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latestdocker run -d -p 3306:3306 -p 8989:8989 --name mxs docker.mariadb.com/maxscale:latestcurl -u admin:mariadb http://localhost:8989/v1/maxscaledocker run -d -p 8989:8989 --name mxs -v /path/to/your-maxscale.cnf:/etc/maxscale.cnf.d/custom.cnf docker.mariadb.com/maxscale:latestdocker run -d -p 8989:8989 --name mxs -v /path/to/your-maxscale.cnf:/etc/maxscale.cnf.d docker.mariadb.com/maxscale:latestdocker exec -it mxs bashdocker ps --filter "name=mxs"docker stop mxsdocker rm mxs$ 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 --helpsysctl vm.overcommit_memorycat /proc/sys/vm/overcommit_memorytar -caf maxscale-backup.tar.gz /etc/maxscale.cnf /etc/maxscale.cnf.d/ /var/lib/maxscale/#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;
}[PsReuse]
type=filter
module=psreuse
[MyService]
...
filters=PsReusemaxpasswd plainpassword
96F99AA1315BDC3604B006F427DD9484[My-Service]
type=service
router=readconnroute
router_options=master
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=96F99AA1315BDC3604B006F427DD9484Evaluate MariaDB MaxScale with the free Trial version. Learn about its features installation steps, and specific limitations like connection counts and runtime duration for testing purposes.
Prevent stale reads in replication clusters. Configure the causal_reads setting to ensure clients always see their own updates by waiting for replicas to catch up.
Follow this guide to prepare your environment for MaxScale. Learn to create necessary database users configure the server and set up basic monitoring permissions.
Integrate MaxScale with Kerberos or Active Directory using GSSAPI. Learn to configure the GSSAPIAuth module, manage keytab files, and set up service principals for secure login.
[maxscale]
...
admin_host = 0.0.0.0
admin_port = 8443[maxscale]
...
admin_ssl_key=/certs/server-key.pem
admin_ssl_cert=/certs/server-cert.pem
admin_ssl_ca_cert=/certs/ca-cert.pem$ sudo systemctl restart maxscale$ maxctrl --secure
--user=admin
--password=mariadb
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
create user "maxscale_rest_admin" "maxscale_rest_admin_password" --type=admin$ maxctrl --secure
--user=maxscale_rest_admin
--password=maxscale_rest_admin_password
--hosts=192.0.2.100:8443
--tls-key=/certs/client-key.pem
--tls-cert=/certs/client-cert.pem
--tls-ca-cert=/certs/ca.pem
destroy user "admin"

false[OptimisticTrx]
type=filter
module=optimistictrx
[MyService]
...
filters=OptimisticTrxCREATE USER 'service_user'@'%' IDENTIFIED BY 'service_pw';
GRANT SELECT ON mysql.user TO 'service_user'@'%';
GRANT SELECT ON mysql.db TO 'service_user'@'%';
GRANT SELECT ON mysql.tables_priv TO 'service_user'@'%';
GRANT SELECT ON mysql.columns_priv TO 'service_user'@'%';
GRANT SELECT ON mysql.procs_priv TO 'service_user'@'%';
GRANT SELECT ON mysql.proxies_priv TO 'service_user'@'%';
GRANT SELECT ON mysql.roles_mapping TO 'service_user'@'%';
GRANT SHOW DATABASES ON *.* TO 'service_user'@'%';CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'monitor_pw';
GRANT ALL ON *.* TO 'monitor_user'@'%';sudo service maxscale startcat /var/log/maxscale/maxscale.logmaxctrl list serversmaxctrl list servicesadmin_host=0.0.0.02025-03-25 12:17:34 error : (Read-Only-Service); The maximum limit of 1 services in MaxScale Trial has been reached. If insufficient, consider upgrading to MaxScale Enterprise: https://mariadb.com/maxscale-contact/
2025-03-25 12:17:34 error : (Read-Only-Service); Service 'Read-Only-Service' creation failed.
2025-03-25 12:17:34 error : 1 errors were encountered while processing configuration.
2025-03-25 12:17:34 alert : Failed to process the MaxScale configuration file /etc/maxscale.cnf.maxctrl create service Read-Only-Service router=readconnroute user=service_users
Error: Server at http://127.0.0.1:8989 responded with 400 Bad Request to `POST services`
{
"errors": [
{
"detail": "The maximum limit of 1 services in MaxScale Trial has been reached. If insufficient, consider upgrading to MaxScale Enterprise: https://mariadb.com/maxscale-contact/"
},
{
"detail": "Could not create service 'Read-Only-Service' with module 'router=readconnroute'"
}
]
}INSERT INTO hq_sales.invoices
(customer_id, invoice_date, invoice_total, payment_method)
VALUES
(1, '2020-05-10 12:35:10', 1087.23, 'CREDIT_CARD');SELECT * FROM hq_sales.invoices
WHERE customer_id = 1
AND invoice_date = '2020-05-10 12:35:10';[mariadb]
...
session_track_system_variables=last_gtid$ sudo systemctl restart mariadb[split-router]
type = service
router = readwritesplit
...
causal_reads = local
causal_reads_timeout = 15
The unit for the causal_reads_timeout parameter is seconds, and the default value is 10.$ sudo systemctl restart maxscale[split-router]
type = service
router = readwritesplit
...
causal_reads = ON
causal_reads_timeout = 15
The unit for the causal_reads_timeout parameter is seconds, and the default value is 10.$ sudo systemctl restart maxscaleCREATE 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.global_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';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 │
└───────────────────┴──────┴──────┴─────────┘[Splitter-Service]
type=service
router=readwritesplit
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw[Splitter-Listener]
type=listener
service=Splitter-Service
port=3306authenticator=GSSAPIAuth
authenticator_options=principal_name=mariadb/localhost.localdomain@EXAMPLE.COMauthenticator_options=principal_name=mymariadb@EXAMPLE.COM,gssapi_keytab_path=/home/user/mymariadb.keytab[MyListener]
type=listener
authenticator=mariadbauth
authenticator_options=clear_pw_passthrough=true
ssl=true
<other options>maxctrl create filter OptimisticTrx optimistictrx
maxctrl alter service-filter MyService OptimisticTrxSET autocommit=1
PREPARE hide_autocommit FROM "SET autocommit=0"
EXECUTE hide_autocommit[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=256000[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[Throttle]
type = filter
module = throttlefilter
max_qps = 500
throttling_duration = 60000
...
[Routing-Service]
type = service
filters = Throttle[Read-Service]
type=service
router=readconnroute
cluster=MyCluster
filters=readonlyUnderstand the routing logic of the readwritesplit router. This guide explains how MaxScale identifies write statements for the primary and distributes reads to replicas.
Essential hardening steps for production MaxScale environments. Learn to encrypt passwords, secure the REST API with TLS, enable audit logging, and configure encrypted database connections.
Understand how MaxScale handles MySQL protocol authentication. This guide covers the User Account Manager, required database grants, and general authentication settings like matching hosts.
Implement high-security authentication using Ed25519 signatures. This guide explains how to configure the ed25519auth module and handle backend authentication via user mapping.
Manage LOAD DATA INFILE operations. This filter splits large data loads into smaller chunks to prevent blocking and improve stability during bulk data ingestion.
sudo apt update
sudo apt install -y curl
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
sudo apt install -y maxscalecurl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
sudo dnf install -y maxscale[server1]
type=server
# IP address or hostname of your first MariaDB server
address=192.168.1.101
[server2]
type=server
# IP address or hostname of your second MariaDB server
address=192.168.1.102
# Set the port if MariaDB is listening on a non-default port
port=3307[maxscale]
threads=auto
[server1]
type=server
address=192.168.1.101
[server2]
type=server
address=192.168.1.102
port=3307
[MariaDB-Cluster]
type=monitor
module=mariadbmon
servers=server1,server2
user=maxscale_monitor
password=monitor_password
monitor_interval=5s
[Read-Write-Service]
type=service
router=readwritesplit
cluster=MariaDB-Cluster
user=maxscale_user
password=maxscale_password
[Read-Write-Listener]
type=listener
service=Read-Write-Service
port=3306sudo systemctl start maxscale
sudo systemctl enable maxscale
sudo systemctl status maxscale # Check statusmariadb -h 127.0.0.1 -P 3306 -u my-user -pQUIT, PING, STMT RESET, and CHANGE USER.falsetrue[MariaDB-Cluster]
type=monitor
# The MariaDB asynchronous replication monitoring module
module=mariadbmon
# List of servers to monitor
servers=server1,server2
# The user used for monitoring
user=maxscale_monitor
password=monitor_password
# Check every 5 seconds
monitor_interval=5sCREATE USER 'maxscale_monitor'@'%' IDENTIFIED BY 'monitor_password';
GRANT BINLOG ADMIN, BINLOG MONITOR, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, SLAVE MONITOR, RELOAD, PROCESS, SUPER, EVENT, SET USER, SHOW DATABASES ON *.* TO `maxscale_monitor`@`%`;
GRANT SELECT ON mysql.global_priv TO 'maxscale_monitor'@'%';[Read-Write-Service]
type=service
# The readwritesplit router module load balances reads and routes writes to the primary node
router=readwritesplit
# Servers available for this service
cluster=MariaDB-Cluster
# The user account used to fetch the user information from MariaDB
user=maxscale_user
password=maxscale_passwordCREATE USER 'maxscale_user'@'%' IDENTIFIED BY 'maxscale_password';
GRANT SELECT ON mysql.user TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.db TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.tables_priv TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.columns_priv TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.procs_priv TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.proxies_priv TO 'maxscale_user'@'%';
GRANT SELECT ON mysql.roles_mapping TO 'maxscale_user'@'%';
GRANT SHOW DATABASES ON *.* TO 'maxscale_user'@'%';[Read-Write-Listener]
type=listener
# The service that this listener connects to
service=Read-Write-Service
# The port that MaxScale will listen on for client applications
port=3306[maxscale]
# Select the number of worker threads automatically based on the CPU thread count
threads=autoSET SESSION autocommit=OFF;
SELECT * FROM hq_sales.invoices WHERE branch_id=1;
INSERT INTO hq_sales.invoices
(customer_id, invoice_date, invoice_total, payment_method)
VALUES
(1, '2020-05-10 12:35:10', 1087.23, 'CREDIT_CARD');
COMMIT;BEGIN;
SELECT * FROM hq_sales.invoices WHERE branch_id=1;
INSERT INTO hq_sales.invoices
(customer_id, invoice_date, invoice_total, payment_method)
VALUES
(1, '2020-05-10 12:35:10', 1087.23, 'CREDIT_CARD');
COMMIT;SELECT @@global.alter_algorithm;
SELECT @@my_user_var;
SHOW statements$ maxkeys$ maxpasswd plaintextpassword
96F99AA1315BDC3604B006F427DD9484[MariaDB-Service]
type=service
router=readwritesplit
servers=MariaDB1,MariaDB2,MariaDB3
user=maxscale-user
password=96F99AA1315BDC3604B006F427DD9484[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[RWS-Listener]
type=listener
service=RWS-Service
ssl=true
ssl_key=/certs/my-cert-key.pem
ssl_cert=/certs/my-cert.pem[RWS-Listener]
type=listener
service=RWS-Service
ssl=true
ssl_key=/certs/my-cert-key.pem
ssl_cert=/certs/my-cert.pem
ssl_ca=/certs/my_ca_cert.pem[MariaDB-Server1]
type=server
address=...
port=...
ssl=true
ssl_verify_peer_certificate=true
ssl_ca=/certs/my_ca_cert.pem[MariaDB-Server1]
type=server
address=...
port=...
ssl=true
ssl_verify_peer_certificate=true
ssl_key=/certs/my-cert-key.pem
ssl_cert=/certs/my-cert.pem
ssl_ca=/certs/my_ca_cert.pemCREATE USER 'maxscale'@'maxscalehost' IDENTIFIED BY 'maxscale-password';
GRANT SELECT ON mysql.user TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.db TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.tables_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.columns_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.procs_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.proxies_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.global_priv TO 'maxscale'@'maxscalehost';
GRANT SELECT ON mysql.roles_mapping TO 'maxscale'@'maxscalehost';
GRANT SHOW DATABASES ON *.* TO 'maxscale'@'maxscalehost';
GRANT SET USER ON *.* TO 'maxscale'@'maxscalehost';GRANT ALL ON infinidb_vtable.* TO 'maxscale'@'maxscalehost';authenticator_options=skip_authentication=true,lower_case_table_names=1authenticator_options=skip_authentication=trueauthenticator_options=match_host=falseauthenticator_options=lower_case_table_names=0[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=4000LOAD 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;# 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 masterINSERT 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=CreateTableFilterExplore the power of MaxScale filters. Learn to implement query logging statement rewriting and other processing steps in your request pipeline with practical examples.
[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.pem[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=HighScores[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=NamedServerFilterImplement basic database sharding using the schemarouter. Learn to distribute data across multiple servers while presenting a single logical database to clients.
Build a resilient replication cluster. This guide explains how to combine MaxScale's failover with semi-synchronous replication to minimize data loss during crashes.
Duplicate query traffic to multiple targets. This filter sends a copy of incoming requests to a secondary service or server useful for testing and auditing.
Identify the most expensive queries. This filter logs the top N slowest queries passing through MaxScale helping to pinpoint performance bottlenecks.
[Service]
ExecStart=valgrind --leak-check=full /usr/bin/maxscale -d
Type=simpleERROR 1045 (28000): Access denied for user 'bob'@'office' (using password: YES)GRANT SELECT ON `my\_database`.\* TO 'user'@'%' <-- bad
GRANT SELECT ON `my_database`.\* TO 'user'@'%' <-- goodsudo sysctl -w fs.pipe-max-size=8388608pkg/prelude/bootstrap.js:1872
throw error;
^
Error: ENOENT: no such file or directory, uv_cwd
1) If you want to compile the package/file into executable, please pay
attention to compilation warnings and specify a literal in 'require'
call.
2) If you don't want to compile the package/file into executable and
want to 'require' it from filesystem (likely plugin), specify an
absolute path in 'require' call using process.cwd() or process.execPath.
at Object.wrappedCwd [as cwd] (internal/bootstrap/switches/does_own_process_state.js:130:28)
at /snapshot/maxctrl/node_modules/yargs/build/index.cjs:1:59463
at Argv (/snapshot/maxctrl/node_modules/yargs/index.cjs:12:16)
at Object.<anonymous> (/snapshot/maxctrl/node_modules/yargs/index.cjs:7:1)
at Module._compile (pkg/prelude/bootstrap.js:1926:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at Module.require (pkg/prelude/bootstrap.js:1851:31) {
errno: -2,
code: 'ENOENT',
syscall: 'uv_cwd',
pkg: true
}sysctl -w kernel.core_pattern='|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e'$ cat /etc/systemd/coredump.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See coredump.conf(5) for details.
[Coredump]
Storage=external
Compress=yes
ProcessSizeMax=1G
ExternalSizeMax=1G
JournalSizeMax=1G
#MaxUse=
#KeepFree=SELECT * FROM t WHERE f = 10
SELECT * FROM t WHERE f = 20SELECT * FROM t WHERE f > 5
SELECT * FROM t WHERE f = 10
INSERT INTO t VALUES (42)
DELETE FROM t WHERE f > 20
SELECT * FROM users WHERE username = 'input' AND password = 'input'SELECT * FROM t WHERE f > ?
SELECT * FROM t WHERE f = ?
INSERT INTO t VALUES (?)
DELETE FROM t WHERE f > ?
SELECT * FROM users WHERE username = ? AND password = ?SELECT * FROM t WHERE f > 100
SELECT * FROM t WHERE f = 42
INSERT INTO t VALUES (84)
DELETE FROM t WHERE f > 200
SELECT * FROM users WHERE username = 'joe' AND password = 'secret'# != is neither > nor =
SELECT * FROM t WHERE f != 10
# During learning only one value was inserted
INSERT INTO t VALUES (1), (2)
# During learning DELETE was always accompanied by a WHERE clause
DELETE FROM t
# An apparent SQL-injection attack does not match what was learnt.
SELECT * FROM users WHERE username = '' OR '1'='1' AND password = ''[MyFirewall]
type=filter
module=firewallexclude_users=admin, 'super'@'192.168.02.1'2024-11-18 08:01:47 warning: (1) [firewall] (Service); Firewall incident (user@127.0.0.1): DELETE FROM t[MyFirewall]
type=filter
module=firewall[MyService]
type=service
router=readwritesplit
...
filters=MyFirewallmaxctrl alter filter MyFirewall mode=learn-clearmaxctrl alter filter MyFirewall mode=supervisemaxctrl alter filter MyFilter mode=enforce[server1]
type=server
address=192.168.121.51
port=3306
[server2]
...
[server3]
...
[server4]
...
[TheMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3,server4
...ignorecasecaseextendedfalseignorecasecaseextended$ 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_failover=true
monitor_interval=2s
failcount=5
...[TheMonitor]
type=monitor
module=mariadbmon
servers=server1,server2,server3,server4
auto_failover=true
auto_rejoin=true
...$ 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 │
└─────────┴─────────────────┴──────┴─────────────┴─────────────────┘# 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
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
CREATE USER 'monitor_user'@'%' IDENTIFIED BY 'secret';
GRANT REPLICATION CLIENT ON *.* TO 'monitor_user'@'%';
-- Create the application user
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 exist$ maxctrl list servers
┌──────────┬─────────────────┬──────┬─────────────┬────────┬────────────────────┬─────────┬──────────┐
│ Server │ Address │ Port │ Connections │ Status │ Status Info │ GTID │ Monitor │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Write │ Down │ 1-1-101 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Read │ Replica, read_only │ 1-1-100 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Read │ Replica, read_only │ 1-1-100 │ Monitor1 │
└──────────┴─────────────────┴──────┴─────────────┴────────┴────────────────────┴─────────┴──────────┘$ maxctrl list servers
┌──────────┬─────────────────┬──────┬─────────────┬────────┬────────────────────┬─────────┬──────────┐
│ Server │ Address │ Port │ Connections │ Status │ Status Info │ GTID │ Monitor │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Up │ │ 1-1-101 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Write │ Primary │ 1-2-102 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Read │ Replica, read_only │ 1-2-102 │ Monitor1 │
└──────────┴─────────────────┴──────┴─────────────┴────────┴────────────────────┴─────────┴──────────┘rpl_semi_sync_master_enabled=ON
rpl_semi_sync_slave_enabled=ONrpl_semi_sync_master_wait_point=AFTER_SYNCinit-rpl-role=SLAVE$ maxctrl list servers
┌──────────┬─────────────────┬──────┬─────────────┬────────┬────────────────────┬─────────┬──────────┐
│ Server │ Address │ Port │ Connections │ Status │ Status Info │ GTID │ Monitor │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server1 │ 192.168.121.51 │ 3306 │ 0 │ Write │ Primary │ 1-1-100 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server2 │ 192.168.121.190 │ 3306 │ 0 │ Read │ Replica, read_only │ 1-1-101 │ Monitor1 │
├──────────┼─────────────────┼──────┼─────────────┼────────┼────────────────────┼─────────┼──────────┤
│ server3 │ 192.168.121.112 │ 3306 │ 0 │ Read │ Replica, read_only │ 1-1-101 │ Monitor1 │
└──────────┴─────────────────┴──────┴─────────────┴────────┴────────────────────┴─────────┴──────────┘[Service]
RestartSec=1minrpl_semi_sync_master_enabled=ON
rpl_semi_sync_slave_enabled=ON
rpl_semi_sync_master_wait_point=AFTER_SYNC
rpl_semi_sync_master_timeout=6000
rpl_semi_sync_slave_kill_conn_timeout=5
init-rpl-role=SLAVE
gtid_strict_mode=1
log_slave_updates=1[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=4012[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$[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"
}
]
}Interact with MaxScale programmatically using the REST API. This tutorial demonstrates how to create, modify, and inspect MaxScale objects at runtime using curl.
maxctrl 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/server1maxctrl alter maxscale
admin_audit_file=/var/log/maxscale/admin_audit.march.csv.$ 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-userTransform SQL queries using template-based rules. This filter modifies incoming statements to optimize performance or fix compatibility issues without changing application code.
%%
# 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=falseFollow the specific steps to upgrade MariaDB MaxScale to version 25.01. This guide covers new package structures, removed features, and critical configuration changes for this release.
Log every SQL query passing through MaxScale. This filter provides comprehensive audit trails by recording query text, execution time, and client details.
filebasematchexcludeoptionsusersourceuser_matchuser_excludesource_matchsource_excludelog_typelog_dataduration_unituse_canonical_formflushappendseparatornewline_replacementcaseignorecaseextendedsessionunifiedstdoutservicesessiondateuserreply_timetotal_reply_timequerydefault_dbnum_rowsreply_sizetransactiontransaction_timenum_warningserror_msgfalsefalsetrue[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 PRODUCTSReview critical information and procedures for upgrading MariaDB MaxScale versions. Learn about new features deprecated functionality and specific steps for each version transition.
reuse_prepared_statementsoptimistic_trxthreadsmariadbmonpasswd is deprecatedauthenticator_options for servers is ignoredRecord and replay real database traffic. This filter captures client sessions to create realistic benchmarks and test environments based on production workloads.
sudo dnf update maxscalesudo cp /etc/maxscale.cnf /data/backups/config/maxscale.cnfsudo systemctl stop maxscalesudo maxctrl show maxscale┌──────────────┬──────────────────────────────────────────────────────────────────────┐
│ Version │ 25.01.2 │
├──────────────┼──────────────────────────────────────────────────────────────────────┤
│ Commit │ 61b8bbf7f63c38ca9c408674e66f3627a0b2192e │
├──────────────┼──────────────────────────────────────────────────────────────────────┤
│ Started At │ Fri, 03 Jan 2025 18:05:18 GMT │
├──────────────┼──────────────────────────────────────────────────────────────────────┤
│ Activated At │ Fri, 03 Jan 2025 18:05:18 GMT │
├──────────────┼──────────────────────────────────────────────────────────────────────┤
│ Uptime │ 109 │
├──────────────┼──────────────────────────────────────────────────────────────────────┤
│ Parameters │ { │
│ │ "libdir": "/usr/lib/x86_64-linux-gnu/maxscale", │
│ │ "datadir": "/var/lib/maxscale", │
│ │ "process_datadir": "/var/lib/maxscale/data3850", │
│ │ "cachedir": "/var/cache/maxscale", │
│ │ "configdir": "/etc", │
│ │ "config_persistdir": "/var/lib/maxscale/maxscale.cnf.d", │
│ │ "module_configdir": "/etc/maxscale.modules.d", │
│ │ "piddir": "/var/run/maxscale", │
│ │ "logdir": "/var/log/maxscale", │
│ │ "langdir": "/var/lib/maxscale", │
│ │ "execdir": "/usr/bin", │
│ │ "connector_plugindir": "/usr/lib/x86_64-linux-gnu/mysql/plugin", │
│ │ "threads": 1, │
│ │ "thread_stack_size": 8388608, │
│ │ "writeq_high_water": 0, │
│ │ "writeq_low_water": 0, │
│ │ "auth_connect_timeout": 3, │
│ │ "auth_read_timeout": 1, │
│ │ "auth_write_timeout": 2, │
│ │ "skip_permission_checks": false, │
│ │ "admin_auth": true, │
│ │ "admin_enabled": true, │
│ │ "admin_log_auth_failures": true, │
│ │ "admin_host": "127.0.0.1", │
│ │ "admin_port": 8989, │
│ │ "admin_ssl_key": "", │
│ │ "admin_ssl_cert": "", │
│ │ "admin_ssl_ca_cert": "", │
│ │ "admin_pam_readwrite_service": "", │
│ │ "admin_pam_readonly_service": "", │
│ │ "passive": false, │
│ │ "query_classifier": "", │
│ │ "query_classifier_cache_size": 155008819, │
│ │ "retain_last_statements": 0, │
│ │ "dump_last_statements": "never", │
│ │ "session_trace": 0, │
│ │ "load_persisted_configs": true, │
│ │ "max_auth_errors_until_block": 10 │
│ │ } │
└──────────────┴──────────────────────────────────────────────────────────────────────┘sudo yum install curlcurl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setupchmod +x mariadb_es_repo_setupsudo ./mariadb_es_repo_setup --token="CUSTOMER_DOWNLOAD_TOKEN" --apply \
--mariadb-maxscale-version="25.01"maxctrl create monitor mdb_monitor mariadbmon \
--monitor-user mxs \
--monitor-password 'maxscale_passwd' \
replication_user='repl_user' \
replication_password='repl_pass' \
--servers node1 node2 node3maxctrl create monitor mdb_monitor mariadbmon \
user='mxs' \
password='maxscale_passwd' \
replication_user='repl_user' \
replication_password='repl_pass' \
--servers node1 node2 node3GRANT SELECT ON mysql.global_priv TO 'maxscale_user'@'%';[My-Readwritesplit]
type=service
router=readwritesplit
reuse_prepared_statements=true[PsReuse]
type=filter
module=psreuse
[My-Readwritesplit]
type=service
router=readwritesplit
filters=PsReuse[My-Readwritesplit]
type=service
router=readwritesplit
optimistic_trx=true[OptimisticTrx]
type=filter
module=optimistictrx
[My-Readwritesplit]
type=service
router=readwritesplit
transaction_replay=true
filters=OptimisticTrxmaxctrl alter service My-Service connection_keepalive 30000maxctrl alter service My-Service connection_keepalive 30000ms[CSMonitor]
type=monitor
module=csmon
version=1.5
...[My Server]
...
[My Service]
...
servers=My Server[MyServer]
...
[MyService]
...
servers=MyServersome_param=60s
some_param=60000ms[The-Service]
type=service
passwd=some-service-password
...
[The-Monitor]
type=monitor
passwd=some-monitor-password
...[The-Service]
type=service
password=some-service-password
...
[The-Monitor]
type=monitor
password=some-monitor-password
...user@host $ maxadmin -u adminGRANT SELECT ON mysql.tables_priv TO 'username'@'maxscalehost';[RW-Split-Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=jdoe
passwd=BD26E4139A15280CA882264AA1551C70
ssl=required
ssl_cert=/home/user/certs/server-cert.pem
ssl_key=/home/user/certs/server-key.pem
ssl_ca_cert=/home/user/certs/ca.pem
ssl_version=TLSv12
[RW-Split-Listener]
type=listener
service=RW-Split-Router
port=3306[RW-Split-Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=jdoe
passwd=BD26E4139A15280CA882264AA1551C70
[RW-Split-Listener]
type=listener
service=RW-Split-Router
port=3306
ssl=required
ssl_cert=/home/user/certs/server-cert.pem
ssl_key=/home/user/certs/server-key.pem
ssl_ca_cert=/home/user/certs/ca.pem
ssl_version=TLSv12[binlog_configuration]
master_host=127.0.0.1
master_port=3308
master_user=repl
master_password=somepass
filestem=repl-bin# Re-install init scripts
cd /usr/local/mariadb-maxscale
./postinstsyslog=trueslave_conditionsObfuscate sensitive data in query results. This filter masks specific columns based on user roles, ensuring compliance with privacy regulations without altering the database.
ruleswarn_type_mismatchlarge_payloadprevent_function_usagerequire_fully_parsedtreat_string_arg_as_fieldcheck_user_variablescheck_unionscheck_subqueriesreplaceobfuscatewithapplies_toexemptedreloadmasking_rules.jsonsudo apt install curlcurl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setupchmod +x mariadb_es_repo_setupsudo ./mariadb_es_repo_setup --token="CUSTOMER_DOWNLOAD_TOKEN" --apply \
--mariadb-maxscale-version="25.01"sudo apt updatesudo apt install --only-upgrade maxscalesudo zypper install curlcurl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setupecho "4d483b4df193831a0101d3dfa7fb3e17411dda7fc06c31be4f9e089c325403c0 mariadb_es_repo_setup" \
| sha256sum -c -chmod +x mariadb_es_repo_setupsudo ./mariadb_es_repo_setup --token="CUSTOMER_DOWNLOAD_TOKEN" --apply \
--mariadb-maxscale-version="25.01"sudo zypper update maxscaleGRANT SHOW DATABASES ON *.*
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.columns_priv
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.db
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.procs_priv
TO 'mxs'@'192.0.2.1';
GRANT SELECT ON mysql.proxies_priv
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.roles_mapping
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.tables_priv
TO 'maxscale'@'192.0.2.1';
GRANT SELECT ON mysql.user
TO 'maxscale'@'192.0.2.1';[repl-monitor]
type = monitor
module = mariadbmon
servers = server1,server2,server3
user = maxscale
password = max_passwd
auto_failover = ON
auto_rejoin = ON
master_conditions = connected_slave,running_slave[col-monitor]
type = monitor
module = csmon
servers = server1,server2,server3
user = maxscale
password = max_passwd
version = 1.2[maxscale]
syslog=true[repl-monitor]
type = monitor
module = mariadbmon
servers = server1,server2,server3
user = maxscale
password = max_passwd
auto_failover = ON
auto_rejoin = ON
slave_conditions = running_master,writable_mastermaxctrl 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.jsonmaxvisualize baseline-summary.json comparison-summary.json --Voila.ip='0.0.0.0'maxplayer -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.2SETneveralwaysignoreaborttruetruetruetruetruetrue> 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"
}
}
]
}Improve query performance by caching SELECT statement results. This filter stores result sets in memory, serving identical subsequent queries directly from MaxScale.
information_schemastoragestorage_optionshard_ttlsoft_ttlmax_resultset_rowsmax_resultset_sizemax_countmax_sizerulescached_dataselectscache_in_transactionsdebugenabledinvalidateclear_cache_on_parse_errorsuserstimeout@maxscale.cache.populate@maxscale.cache.use@maxscale.cache.soft_ttl@maxscale.cache.hard_ttlcached_data=thread_specificcache_data=sharedstorage_inmemorystorage_memcachedservermax_value_sizestorage_redisserverusernamepasswordsslssl_certssl_keyssl_cacache_rules.json0s0s00sharedthread_specificassume_cacheableverify_cacheableFOUND_ROWSGET_LOCKIS_FREE_LOCKIS_USED_LOCKLAST_INSERT_IDLOAD_FILELOCALTIMELOCALTIMESTAMPMASTER_POS_WAITNOWRANDRELEASE_LOCKSESSION_USERSLEEPSYSDATESYSTEM_USERUNIX_TIMESTAMPUSERUUIDUUID_SHORTneverread_only_transactionsall_transactionsall_transactions: The cache will be used and populated inside explicitly read-only transactions. Inside transactions that are not explicitly read-only, the cache will be used and populated until the first non-SELECT statement.2 (0b00010) A non-matching rule is logged.truenevercurrenttruemixedisolated5sunlikefalse""""""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"
}Reference guide for the MaxCtrl command-line utility. Learn syntax and options for managing MaxScale objects, including servers, services, monitors, and listeners via the REST API.
[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 tls <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.parseComplete MariaDB MaxScale configuration guide. Complete reference for listeners, servers, monitors, routers, and SSL settings with comprehensive examples and.
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_blockdebugrequire_secure_transportadmin_hostadmin_portadmin_authadmin_ssl_keyadmin_ssl_certadmin_ssl_ca_certadmin_ssl_caadmin_ssl_passphraseadmin_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_oidc_flowadmin_oidc_client_idadmin_oidc_client_secretadmin_oidc_ssl_insecureadmin_oidc_extra_optionsadmin_verify_urladmin_jwt_issueradmin_auditadmin_audit_fileadmin_audit_exclude_methodsconfig_sync_clusterconfig_sync_userconfig_sync_passwordconfig_sync_dbconfig_sync_intervalconfig_sync_timeouttelemetrytelemetry_attributestelemetry_update_intervaltelemetry_ssl_insecuretelemetry_urltelemetry_ssl_keytelemetry_ssl_certtelemetry_ssl_cakey_managerrouterfilterstargetsserversclusteruserpasswordroleenable_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_timeoutmoduleMariaDB or MariaDBClientCDCnosqlprotocolsslssl_keyssl_passphrasessl_certssl_ca_certssl_cassl_versionssl_cipherssl_cert_verify_depthssl_verify_peer_certificatessl_verify_peer_hostssl_crlauto0sfalse10s10sfalsefalsefalsetruetruetruefalsefalsefalse10, 1000ms, 10000msfalsedefaultoracle30s0son_closeon_errornever655361024truetrueMAXTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv13truetruetruetrueautoHS256HS384HS512RS256RS384RS512PS256PS384PS512ES256ES384ES512ED25519ED448ED448HS25624hautoimplicitcodeGETPUTPOSTPATCHDELETEHEADOPTIONSCONNECTTRACE5s10s60sfalsefalsetruetruefalsefalsefalsefalse28800s0sfalse300sfalse0struefalseadd_when_load_okfile_only_always-1s60sMAXTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv13falsefalse
# 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/connector_plugindir=/usr/lib64/maxscale/plugin/persistdir=/var/lib/maxscale/maxscale.cnf.d/module_configdir=/etc/maxscale.modules.d/# 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_CRITevent_firewall_incident_facility=LOG_AUTH
event_firewall_incident_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=3000[MyListener1]
type=listener
service=MyService1
port=3006[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_passphrase=env:MY_SECRET_PASSWORD
ssl_passphrase=file:/path/to/pass.txt
ssl_passphrase=pass:MySecretPasswordssl_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=30sBrowse the comprehensive list of MariaDB MaxScale configuration parameters. This reference details valid values, default settings, and dynamic capabilities for servers, services, and monitors.
GETPUTPOSTPATCHDELETEHEADOPTIONSCONNECTTRACEtruetruetrueautoHS256HS384HS512RS256RS384RS512PS256PS384PS512ES256ES384ES512ED25519ED44824htrueautoimplicitcodetrueMAXTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv1310s5s10son_closeon_errornevertruefalsefalsetrue10, 1000ms, 10000msfalsetruetruefalsefalse10s0sfalsedefaultoraclefalsefalse60sauto0s30s655361024false300sfalsefalsefalse-1struefalsefalsefalsefalse60s0struefalsetrueadd_when_load_okfile_only_always28800s0sfalsefalseMAXTLSv1.0TLSv1.1TLSv1.2TLSv1.3TLSv10TLSv11TLSv12TLSv130""defaultoracle""upreadwrite0sfalseprimarysecondary""truefalsenonemariadbpasswordpassword_2FAsuidfalseneverread_only_transactionsall_transactionssharedthread_specifictruetrue0snevercurrent00assume_cacheableverify_cacheable0s5smixedisolatedfalse""""""false""""ignorecasecaseextended60struetruetrueignoreaborttruetruetrueneveralwaysemptyerrorok64Kiignorecasecaseextendedtruefalseservicesessiondateuserreply_timetotal_reply_timequerydefault_dbnum_rowsreply_sizetransactiontransaction_timenum_warningserror_msgsessionunifiedstdoutcaseignorecaseextendedfalseignorecasecaseextendedignorecasecaseextendedfalseignorecasecaseextended3s3s3s0smaster_downmaster_upslave_downslave_upserver_downserver_uplost_masterlost_slavenew_masternew_slave28800s2s90struenonemajority_of_allmajority_of_runningfalsefalsefalsetruenoneconnecting_slaveconnected_slaverunning_slaveprimary_monitor_masterdisk_space_oknonelinked_masterrunning_masterwritable_masterprimary_monitor_mastertrue10strueonyes1falseoffno0safefalsefalse90strue10sfalsefalse90strue35nonezstandardAES_CBCAES_CTRAES_GCM0s10sfalsenoneothercloseignorealwayson_discrepancynevertrueread_onlyread_writeactivate-onlycustom:<path>disabledfalsefalse""PLAINSCRAM-SHA-256SCRAM-SHA-512false""true10sPLAINSCRAM-SHA-256SCRAM-SHA-512falsetopickey5000mslogfilekafkamasterslavesyncedrunningnonelocalglobalfastfast_globaluniversalfast_universalfail_instantlyfail_on_writeerror_on_writeleast_current_operationsadaptive_routingleast_behind_masterleast_router_connectionsleast_global_connectionsnonesofthardfullresult_onlyno_insert_idmasterall""false300s