MariaDB MaxScale Configuration Variables

Table of Contents

Global Options

VariableVersionsValuesDefaultUnitComment
threads1.4 2.32.42.5{ <n> | auto }1thread 
thread_stack_size 2.2   <n>  Ignored and deprecated in 2.3
rebalance_period    2.5<n>0second 
rebalance_threshold    2.5<n>20delta load 
rebalance_window    2.5<n>10second 
auth_connect_timeout1.42.22.32.4 <n>3second 
auth_read_timeout1.42.22.32.4 <n>1secondDeprecated in 2.5
auth_write_timeout1.42.22.32.4 <n>2secondDeprecated in 2.5
query_retries  2.32.42.5<n>1timeAdded in 2.1.10, disabled by default until 2.3.0
query_retry_timeout  2.32.42.5 5  
passive  2.32.42.5 false  
ms_timestamp1.4 2.32.42.5{ 0 | 1 }0- 
skip_permission_checks  2.32.42.5{ 0 | 1 }0  
syslog1.4 2.32.42.5{ 0 | 1 }1- 
maxlog1.4 2.32.42.5{ 0 | 1 }1- 
log_to_shm1.4    { 0 | 1 }0-Deprecated and ignored in 2.3.0 and newer
log_warning1.4 2.32.42.5{ 0 | 1 }1- 
log_notice1.4 2.32.42.5{ 0 | 1 }1- 
log_info1.4 2.32.42.5{ 0 | 1 }0- 
log_debug1.4 2.32.42.5{ 0 | 1 }0- 
log_warn_super_user    2.5 false  
log_messages        Deprecated, use log_notice instead
log_trace        Deprecated, use log_info instead
log_augmentation1.4 2.32.42.5{ 0 | 1 }0- 
log_throttling  2.32.42.5{ <n>, <n>, <n> }10, 1000, 10000time, millisecond, millisecond 
logdir1.4 2.32.42.5<dirpath>/tmp/- 
datadir1.4 2.32.42.5<dirpath>/home/user/maxscale_data/- 
libdir1.4 2.32.42.5<dirpath>/home/user/lib64/- 
cachedir1.4 2.32.42.5<dirpath>/tmp/maxscale_cache/- 
piddir1.4 2.32.42.5<dirpath>/tmp/maxscale_cache/- 
execdir1.4 2.32.42.5<dirpath>/usr/local/bin/- 
connector_plugindir  2.32.42.5<dirpath>/usr/lib/plugin/  
persistdir  2.32.42.5<dirpath>/var/lib/maxscale/maxscale.cnf.d/  
module_configdir  2.32.42.5<dirpath>/var/lib/maxscale/  
language1.4 2.32.42.5<dirpath>/home/user/lang/- 
query_classifier  2.32.42.5<classifier>qc_sqlite  
query_classifier_cache_size  2.32.42.5<n>15% of system Memorybyte 
query_classifier_args  2.32.42.5    
substitute_variables  2.32.42.5{ true | false }false  
sql_mode  2.32.42.5{ default | oracle }default  
local_address  2.32.42.5<IP address>*  
users_refresh_time  2.32.42.5<n>30second 
user_refresh_interval   2.42.5<n>0second 
retain_last_statements  2.32.42.5<n>0statement 
dump_last_statements  2.32.42.5{ on_error | on_close | never }never- 
session_trace  2.32.42.5<n>0statement 
writeq_high_water  2.32.42.5    
writeq_low_water  2.32.42.5    
load_persisted_configs  2.32.42.5{ 0 | 1 }1  
max_auth_errors_until_block   2.42.5<n>10  
debug    2.5    
admin_host  2.32.42.5<IP address>127.0.0.1  
admin_port  2.32.42.5<n>8989  
admin_auth  2.32.42.5 1  
admin_ssl_key  2.32.42.5    
admin_ssl_cert  2.32.42.5    
admin_ssl_ca_cert  2.32.42.5    
admin_enabled  2.32.42.5{ 0 | 1 }   
admin_gui    2.5 1  
admin_secure_gui    2.5    
admin_log_auth_failures   2.42.5{ 0 | 1 }1  
admin_pam_readwrite_service   2.42.5    
admin_pam_readonly_service   2.42.5    

Service Options

VariableVersionsValuesDefaultUnitComment
type1.4 2.32.42.5service - 
router1.4 2.32.42.5{ readconnroute | readwritesplit | schemarouter | binlogrouter } - 
router_option1.4 2.32.42.5{ slave | master,slave } - 
filters1.4 2.32.42.5{ counter | QLA } - 
targets    2.5{ server | service, ... }   
servers1.4 2.32.42.5{ <server1>, <server2>, ... } - 
cluster   2.42.5<name>   
user1.4 2.32.42.5{ <username> } - 
passwd1.4 2.32.42.5{ <password> } - 
enable_root_user1.4 2.32.42.5{ 0 | 1 }0- 
localhost_match_wildcard_host1.4 2.32.4 { 0 | 1 }0 Deprecated and ignored.
version_string1.4 2.32.42.5<string>5.5.5-10.0.0 MaxScale <MaxScale version>  
weightby1.4 2.32.4 <server_weight>  Deprecated in 2.3 and removed in 2.5, use rank instead
auth_all_servers1.4 2.32.42.5{ 0 | 1 }0  
strip_db_esc1.4 2.32.42.5{ 0 | 1 }0  
optimize_wildcard1.4  2.4 { 0 | 1 }0  
retry_on_failure1.4 2.3  { 0 | 1 }1 Ignored by 2.4 and removed in the future.
log_auth_warnings1.4 2.32.42.5{ 0 | 1 }0  
connection_timeout1.4 2.32.42.5<n> second 
max_connections  2.32.42.5<n> connection 
max_retry_interval 2.22.32.4 <n>3600second 
session_track_trx_state  2.32.42.5 false Only supported by MariaDB 10.3 and newer
retain_last_statements  2.32.42.5    
connection_keepalive    2.5<n>300  
net_write_timeout   2.42.5 0second 

Routing Modules

ReadConnRoute

For (weighted) load balancing.

MariaDB MaxScale Readconnroute Router (readconnroute): 2.0, 2.1, 2.2, 2.3, 2.4, 2.5

VariableVersionsValuesDefaultUnitComment
router_option2.12.22.32.42.5master, slave, synced, running, ndbrunning Router option ndb has been removed in 2.4

ReadWriteSplit

For increased read-only throughput by read write splitting.

MariaDB MaxScale Readwritesplit Router (readwritesplit): 2.0, 2.1, 2.2, 2.3, 2.4, 2.5

VariableVersionsValuesDefaultUnitComment
max_slave_connections2.12.22.32.42.5n255 
max_slave_replication_lag2.12.22.32.42.5n255seconds 
use_sql_variables_in2.12.22.32.42.5[ master | all ]all  
connection_keepalive 2.22.32.42.5n300secondsIntroduced in 2.2 but disabled by default
master_reconnection  2.32.42.50 | 10 Introduced in 2.3 but disabled
slave_selection_criteria2.12.22.32.42.5[ LEAST_GLOBAL_CONNECTIONS | LEAST_ROUTER_CONNECTIONS | LEAST_BEHIND_MASTER | LEAST_CURRENT_OPERATIONS | ADAPTIVE_ROUTING ]LEAST_CURRENT_OPERATIONS  
max_sescmd_history2.12.22.32.42.5n50commandsDefault 50 since 2.3 before disaled by default.
disable_sescmd_history2.12.22.32.42.5true | falsetrue2.0 and older enabled by default, in 2.2 and 2.3 disabled by default, in 2.3 and newer enabled but limited to 50 session commands.
prune_sescmd_history2.32.42.51 | 00Added in 2.3.4 but disabled by default.
master_accept_reads2.12.22.32.42.5true | falsefalse
strict_multi_stmt2.12.22.32.42.5true | falsefalseDisabled by default since 2.2.1, before enabled by default.
strict_sp_calls2.12.22.32.42.5true | falsefalseAdded in MaxScale 2.1.9
master_failure_mode2.12.22.32.42.5[ fail_instantly | fail_on_write | error_on_write ]fail_on_write
retry_failed_reads2.12.22.32.42.5true | falsetrue
delayed_retry2.32.42.51 | 00Added in MaxScale 2.3.0
delayed_retry_timeout2.12.22.32.42.5n10seconds
transaction_replay2.32.42.5true | falsefalseWas added in MaxScale 2.3.0
transaction_replay_max_size2.12.22.32.42.5n1 MiBbytes
transaction_replay_attempts2.12.22.32.42.5n5times
transaction_replay_retry_on_deadlock2.42.51 | 00Added in MaxScale 2.4.6
optimistic_trx2.12.22.32.42.51 | 00
causal_reads2.32.42.51 | 00Introduced in MaxScale 2.3.0
causal_reads_timeout2.12.22.32.42.5n10seconds
lazy_connect2.12.22.32.42.51 | 00

SchemaRouter

For sharding.

MariaDB MaxScale Schema Router (schemarouter): 2.0, 2.1, 2.2, 2.3, 2.4, 2.5

VariableVersionsValuesDefaultUnitComment
max_sescmd_history2.12.22.32.42.5nsessionsDeprecated in MaxScale 2.1. Use router_options instead.
disable_sescmd_history2.12.22.32.42.51 | 0Deprecated in MaxScale 2.1. Use router_options instead.
refresh_databases2.12.22.32.42.51 | 0Deprecated in MaxScale 2.1. Use router_options instead.
refresh_interval2.12.22.32.42.5nsecondsDeprecated in MaxScale 2.1. Use router_options instead.

Binlogrouter

For binlog routing in massive Master/Slave set-up.

MariaDB MaxScale Binlog Router (binlogrouter): 2.0, 2.1, 2.2, 2.3, 2.4, 2.5

VariableVersionsValuesDefaultUnitComment
binlogdir2.12.22.32.42.5This is a mandatory parameter.
server_id2.12.22.32.42.5This is a mandatory parameter.
master_id2.12.22.32.42.5
uuid2.12.22.32.42.5
master_uuid2.12.22.32.42.5
master_version2.12.22.32.42.5
master_hostname2.12.22.32.42.5
slave_hostname2.12.22.32.42.5Since MaxScale 2.1.6
user2.12.22.32.42.5This is option can only be given to the router_options parameter. Use the user parameter of the service instead.
password2.12.22.32.42.5This is option can only be given to the router_options parameter. Use the user parameter of the service instead.
heartbeat2.12.22.32.42.5n300seconds 
burstsize2.12.22.32.42.5n1 Mibbytes 
mariadb10-compatibility2.12.22.32.42.50 | 11Enabled by default since MaxScale 2.2.0. In earlier versions disabled by default.
transaction_safety2.12.22.32.42.5on | offoff
send_slave_heartbeat2.12.22.32.42.5true | falsefalse
semisync2.12.22.32.42.5true | falsefalse
ssl_cert_verification_depth2.12.22.32.42.5n9depthThis parameter cannot be modified at runtime.
encrypt_binlog2.12.22.32.42.5on | offoff
encryption_algorithm2.12.22.32.42.5[ aes_ctr | aes_cbs ]aes_cbc
encryption_key_file2.12.22.32.42.5
mariadb10_master_gtid2.12.22.32.42.50 | 10
master_retry_count2.12.22.32.42.5n1000retries
connect_retry2.12.22.32.42.5n50seconds

KafkaCDC Router (kafkacdc)

The KafkaCDC module reads data changes in MariaDB via replication and converts them into JSON objects that are then streamed to a Kafka broker.

MariaDB MaxScale KafkaCDC Router: 2.5

AvroRouter

The avrorouter is a MariaDB 10.0 binary log to Apache Avro file converter.

MariaDB MaxScale AvroRouter: 2.5

Cat Router

The cat router is a special router that concatenates result sets.

MariaDB MaxScale Cat Router: 2.5

HintRouter

The HintRouter module is a simple router intended to operate in conjunction with the NamedServerFilter. The router looks at the hints embedded in a packet buffer and attempts to route the packet according to the hint.

MariaDB MaxScale HintRouter: 2.5

Mirror Router

The Mirror Router is designed for data consistency and database behaviour verification during system upgrades. It allows statement duplication to multiple servers in a manner similar to that of the Tee Filter with exporting of collected query metrics.

MariaDB MaxScale Mirror Router: 2.5

VariableVersionsValuesDefaultUnitComment
main2.5<target>This is a mandatory parameter.
exporter2.5{ log | file | kafka }This is a mandatory parameter.
file2.5<filename>This is a mandatory parameter with exporter=file.
kafka_broker2.5<host:port,host:port,...>This is a mandatory parameter with exporter=kafka.

Example:

[Mirror-Router]
type=service
router=mirror
user=maxscale
password=secret
targets=mariadb-105,mysql-57
main=mariadb-105
exporter=file
file=/tmp/Mirror-Router.log

SmartRouter

SmartRouter is the query router of the SmartQuery framework. Based on the type of the query, each query is routed to the server or cluster that can best handle it.

MariaDB MaxScale SmartRouter: 2.5

Server Options

A server sections defines the backend database instance to which a client can be connected via MaxScale. For Server status see here.

VariableVersionsValuesDefaultUnitComment
type1.4 2.32.42.5server   
serversize1.4 2.32.4 <n>   
address1.4 2.32.42.5<IP address>   
port1.4 2.32.42.5<n>   
socket    2.5    
protocol1.4 2.32.42.5MySQLBackend   
server_weight1.4 2.3  <n>   
monitoruser1.4 2.32.42.5<username>   
monitorpw1.4 2.32.42.5<password>   
extra_port  2.32.42.5<n>   
persistpoolmax1.4 2.32.42.5<n>0connection 
persistmaxtime1.4 2.32.42.5<n>0second 
proxy_protocol  2.32.42.5    
authenticator  2.32.4     
authenticator_options  2.32.4    Removed feature
disk_space_threshold  2.32.42.5<mountpoint:n>   
rank   2.42.5{ primary | secondary }  Replaces weightby parameter

Listener Options

VariableVersionsValuesDefaultUnitComment
type1.4 2.32.42.5listener   
service1.4 2.32.42.5<Service name>   
protocol1.4 2.32.42.5[ MySQLClient | HTTPD | telnetd | maxscaled | CDC ]   
address1.4 2.32.42.5[ <IP address> | <hostname> ]   
port1.4 2.32.42.5<n>   
authenticator  2.32.42.5    
authenticator_options  2.32.42.5    
socket1.4 2.32.42.5<filename>   
sql_mode    2.5    
connection_init_sql_file    2.5    
ssl1.4 2.32.42.5{ required }   
ssl_cert1.4 2.32.42.5<filename>   
ssl_key1.4 2.32.42.5<filename>   
ssl_ca_cert1.4 2.32.42.5<filename>   
ssl_version1.4 2.32.42.5{ TLSv10 | TLSv11 | TLSv12 | TLSv13 | MAX }   
ssl_cipher    2.5    
ssl_cert_verify_depth1.4 2.32.42.5<n>9  
ssl_verify_peer_certificate  2.32.42.5    
ssl_verify_peer_host    2.5    
ssl_crl    2.5    

Monitor Options

See also different MaxScale Monitors.

VariableVersionsValuesDefaultUnitComment
type1.42.22.32.42.5monitor   
module1.42.22.32.42.5{ mysqlmon | galeramon | ndbclustermon | mmon }   
servers1.42.22.32.42.5    
user1.42.12.32.42.5    
passwd1.42.2       
password  2.32.42.5    
script1.42.22.32.42.5    
script_timeout1.42.22.32.42.5<n>90second 
events1.42.22.32.42.5{ master_down | master_up | ... }   
detect_replication_lag1.42.22.32.42.5    
detect_stale_master1.42.22.32.42.5    
mysql51_replication1.42.22.32.42.5    
monitor_interval1.42.22.32.42.5<n>10000millisecond 
backend_connect_timeout1.42.22.32.42.5<n>3second 
backend_write_timeout1.42.22.32.42.5<n>2second 
backend_read_timeout1.42.22.32.42.5<n>1second 
backend_connect_attempts1.42.22.32.42.5<n>1times 
disk_space_threshold1.42.22.32.42.5<n>1times 
disk_space_check_interval1.42.22.32.42.5<n>0ms 

Filter Options

VariableVersionsValuesDefaultUnitComment
type1.42.22.32.42.5filter   
module1.42.22.32.42.5{ qafilter | regexfilter | tee | topfilter | dbfwfilter | namedserverfilter | mqfilter }