You are here

MariaDB MaxScale Configuration Variables

Table of Contents


Global Options

Variable Versions Values Default Unit Comment
threads 1.4   2.3 2.4 2.5 { <n> | auto } 1 thread  
thread_stack_size   2.2       <n>     Ignored and deprecated in 2.3
rebalance_period         2.5 <n> 0 second  
rebalance_threshold         2.5 <n> 20 delta load  
rebalance_window         2.5 <n> 10 second  
auth_connect_timeout 1.4 2.2 2.3 2.4   <n> 3 second  
auth_read_timeout 1.4 2.2 2.3 2.4   <n> 1 second Deprecated in 2.5
auth_write_timeout 1.4 2.2 2.3 2.4   <n> 2 second Deprecated in 2.5
query_retries     2.3 2.4 2.5 <n> 1 time Added in 2.1.10, disabled by default until 2.3.0
query_retry_timeout     2.3 2.4 2.5   5    
passive     2.3 2.4 2.5   false    
ms_timestamp 1.4   2.3 2.4 2.5 { 0 | 1 } 0 -  
skip_permission_checks     2.3 2.4 2.5 { 0 | 1 } 0    
syslog 1.4   2.3 2.4 2.5 { 0 | 1 } 1 -  
maxlog 1.4   2.3 2.4 2.5 { 0 | 1 } 1 -  
log_to_shm 1.4         { 0 | 1 } 0 - Deprecated and ignored in 2.3.0 and newer
log_warning 1.4   2.3 2.4 2.5 { 0 | 1 } 1 -  
log_notice 1.4   2.3 2.4 2.5 { 0 | 1 } 1 -  
log_info 1.4   2.3 2.4 2.5 { 0 | 1 } 0 -  
log_debug 1.4   2.3 2.4 2.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_augmentation 1.4   2.3 2.4 2.5 { 0 | 1 } 0 -  
log_throttling     2.3 2.4 2.5 { <n>, <n>, <n> } 10, 1000, 10000 time, millisecond, millisecond  
logdir 1.4   2.3 2.4 2.5 <dirpath> /tmp/ -  
datadir 1.4   2.3 2.4 2.5 <dirpath> /home/user/maxscale_data/ -  
libdir 1.4   2.3 2.4 2.5 <dirpath> /home/user/lib64/ -  
cachedir 1.4   2.3 2.4 2.5 <dirpath> /tmp/maxscale_cache/ -  
piddir 1.4   2.3 2.4 2.5 <dirpath> /tmp/maxscale_cache/ -  
execdir 1.4   2.3 2.4 2.5 <dirpath> /usr/local/bin/ -  
connector_plugindir     2.3 2.4 2.5 <dirpath> /usr/lib/plugin/    
persistdir     2.3 2.4 2.5 <dirpath> /var/lib/maxscale/maxscale.cnf.d/    
module_configdir     2.3 2.4 2.5 <dirpath> /var/lib/maxscale/    
language 1.4   2.3 2.4 2.5 <dirpath> /home/user/lang/ -  
query_classifier     2.3 2.4 2.5 <classifier> qc_sqlite    
query_classifier_cache_size     2.3 2.4 2.5 <n> 15% of system Memory byte  
query_classifier_args     2.3 2.4 2.5        
substitute_variables     2.3 2.4 2.5 { true | false } false    
sql_mode     2.3 2.4 2.5 { default | oracle } default    
local_address     2.3 2.4 2.5 <IP address> *    
users_refresh_time     2.3 2.4 2.5 <n> 30 second  
user_refresh_interval       2.4 2.5 <n> 0 second  
retain_last_statements     2.3 2.4 2.5 <n> 0 statement  
dump_last_statements     2.3 2.4 2.5 { on_error | on_close | never } never -  
session_trace     2.3 2.4 2.5 <n> 0 statement  
writeq_high_water     2.3 2.4 2.5        
writeq_low_water     2.3 2.4 2.5        
load_persisted_configs     2.3 2.4 2.5 { 0 | 1 } 1    
max_auth_errors_until_block       2.4 2.5 <n> 10    
debug         2.5        
admin_host     2.3 2.4 2.5 <IP address> 127.0.0.1    
admin_port     2.3 2.4 2.5 <n> 8989    
admin_auth     2.3 2.4 2.5   1    
admin_ssl_key     2.3 2.4 2.5        
admin_ssl_cert     2.3 2.4 2.5        
admin_ssl_ca_cert     2.3 2.4 2.5        
admin_enabled     2.3 2.4 2.5 { 0 | 1 }      
admin_gui         2.5   1    
admin_secure_gui         2.5        
admin_log_auth_failures       2.4 2.5 { 0 | 1 } 1    
admin_pam_readwrite_service       2.4 2.5        
admin_pam_readonly_service       2.4 2.5        

Service Options

Variable Versions Values Default Unit Comment
type 1.4   2.3 2.4 2.5 service   -  
router 1.4   2.3 2.4 2.5 { readconnroute | readwritesplit | schemarouter | binlogrouter }   -  
router_option 1.4   2.3 2.4 2.5 { slave | master,slave }   -  
filters 1.4   2.3 2.4 2.5 { counter | QLA }   -  
targets         2.5 { server | service, ... }      
servers 1.4   2.3 2.4 2.5 { <server1>, <server2>, ... }   -  
cluster       2.4 2.5 <name>      
user 1.4   2.3 2.4 2.5 { <username> }   -  
passwd 1.4   2.3 2.4 2.5 { <password> }   -  
enable_root_user 1.4   2.3 2.4 2.5 { 0 | 1 } 0 -  
localhost_match_wildcard_host 1.4   2.3 2.4   { 0 | 1 } 0   Deprecated and ignored.
version_string 1.4   2.3 2.4 2.5 <string> 5.5.5-10.0.0 MaxScale <MaxScale version>    
weightby 1.4   2.3 2.4   <server_weight>     Deprecated in 2.3 and removed in 2.5, use rank instead
auth_all_servers 1.4   2.3 2.4 2.5 { 0 | 1 } 0    
strip_db_esc 1.4   2.3 2.4 2.5 { 0 | 1 } 0    
optimize_wildcard 1.4     2.4   { 0 | 1 } 0    
retry_on_failure 1.4   2.3     { 0 | 1 } 1   Ignored by 2.4 and removed in the future.
log_auth_warnings 1.4   2.3 2.4 2.5 { 0 | 1 } 0    
connection_timeout 1.4   2.3 2.4 2.5 <n>   second  
max_connections     2.3 2.4 2.5 <n>   connection  
max_retry_interval   2.2 2.3 2.4   <n> 3600 second  
session_track_trx_state     2.3 2.4 2.5   false   Only supported by MariaDB 10.3 and newer
retain_last_statements     2.3 2.4 2.5        
connection_keepalive         2.5 <n> 300    
net_write_timeout       2.4 2.5   0 second  

Routing Modules

ReadConnRoute

For (weighted) load balancing.

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

Variable Versions Values Default Unit Comment
router_option 2.1 2.2 2.3 2.4 2.5 master, slave, synced, running, ndb running   Router option ndb has been removed in 2.4

ReadWriteSplit

For increased read-only throughput by read write splitting.

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

Variable Versions Values Default Unit Comment
max_slave_connections 2.1 2.2 2.3 2.4 2.5 n 255  
max_slave_replication_lag 2.1 2.2 2.3 2.4 2.5 n 255 seconds  
use_sql_variables_in 2.1 2.2 2.3 2.4 2.5 [ master | all ] all    
connection_keepalive   2.2 2.3 2.4 2.5 n 300 seconds Introduced in 2.2 but disabled by default
master_reconnection     2.3 2.4 2.5 0 | 1 0   Introduced in 2.3 but disabled
slave_selection_criteria 2.1 2.2 2.3 2.4 2.5 [ LEAST_GLOBAL_CONNECTIONS | LEAST_ROUTER_CONNECTIONS | LEAST_BEHIND_MASTER | LEAST_CURRENT_OPERATIONS | ADAPTIVE_ROUTING ] LEAST_CURRENT_OPERATIONS    
max_sescmd_history 2.1 2.2 2.3 2.4 2.5 n 50 commands Default 50 since 2.3 before disaled by default.
disable_sescmd_history 2.1 2.2 2.3 2.4 2.5 true | false true 2.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_history 2.3 2.4 2.5 1 | 0 0 Added in 2.3.4 but disabled by default.
master_accept_reads 2.1 2.2 2.3 2.4 2.5 true | false false
strict_multi_stmt 2.1 2.2 2.3 2.4 2.5 true | false false Disabled by default since 2.2.1, before enabled by default.
strict_sp_calls 2.1 2.2 2.3 2.4 2.5 true | false false Added in MaxScale 2.1.9
master_failure_mode 2.1 2.2 2.3 2.4 2.5 [ fail_instantly | fail_on_write | error_on_write ] fail_on_write
retry_failed_reads 2.1 2.2 2.3 2.4 2.5 true | false true
delayed_retry 2.3 2.4 2.5 1 | 0 0 Added in MaxScale 2.3.0
delayed_retry_timeout 2.1 2.2 2.3 2.4 2.5 n 10 seconds
transaction_replay 2.3 2.4 2.5 true | false false Was added in MaxScale 2.3.0
transaction_replay_max_size 2.1 2.2 2.3 2.4 2.5 n 1 MiB bytes
transaction_replay_attempts 2.1 2.2 2.3 2.4 2.5 n 5 times
transaction_replay_retry_on_deadlock 2.4 2.5 1 | 0 0 Added in MaxScale 2.4.6
optimistic_trx 2.1 2.2 2.3 2.4 2.5 1 | 0 0
causal_reads 2.3 2.4 2.5 1 | 0 0 Introduced in MaxScale 2.3.0
causal_reads_timeout 2.1 2.2 2.3 2.4 2.5 n 10 seconds
lazy_connect 2.1 2.2 2.3 2.4 2.5 1 | 0 0

SchemaRouter

For sharding.

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

Variable Versions Values Default Unit Comment
max_sescmd_history 2.1 2.2 2.3 2.4 2.5 n sessions Deprecated in MaxScale 2.1. Use router_options instead.
disable_sescmd_history 2.1 2.2 2.3 2.4 2.5 1 | 0 Deprecated in MaxScale 2.1. Use router_options instead.
refresh_databases 2.1 2.2 2.3 2.4 2.5 1 | 0 Deprecated in MaxScale 2.1. Use router_options instead.
refresh_interval 2.1 2.2 2.3 2.4 2.5 n seconds Deprecated 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

Variable Versions Values Default Unit Comment
binlogdir 2.1 2.2 2.3 2.4 2.5 This is a mandatory parameter.
server_id 2.1 2.2 2.3 2.4 2.5 This is a mandatory parameter.
master_id 2.1 2.2 2.3 2.4 2.5
uuid 2.1 2.2 2.3 2.4 2.5
master_uuid 2.1 2.2 2.3 2.4 2.5
master_version 2.1 2.2 2.3 2.4 2.5
master_hostname 2.1 2.2 2.3 2.4 2.5
slave_hostname 2.1 2.2 2.3 2.4 2.5 Since MaxScale 2.1.6
user 2.1 2.2 2.3 2.4 2.5 This is option can only be given to the router_options parameter. Use the user parameter of the service instead.
password 2.1 2.2 2.3 2.4 2.5 This is option can only be given to the router_options parameter. Use the user parameter of the service instead.
heartbeat 2.1 2.2 2.3 2.4 2.5 n 300 seconds  
burstsize 2.1 2.2 2.3 2.4 2.5 n 1 Mib bytes  
mariadb10-compatibility 2.1 2.2 2.3 2.4 2.5 0 | 1 1 Enabled by default since MaxScale 2.2.0. In earlier versions disabled by default.
transaction_safety 2.1 2.2 2.3 2.4 2.5 on | off off
send_slave_heartbeat 2.1 2.2 2.3 2.4 2.5 true | false false
semisync 2.1 2.2 2.3 2.4 2.5 true | false false
ssl_cert_verification_depth 2.1 2.2 2.3 2.4 2.5 n 9 depth This parameter cannot be modified at runtime.
encrypt_binlog 2.1 2.2 2.3 2.4 2.5 on | off off
encryption_algorithm 2.1 2.2 2.3 2.4 2.5 [ aes_ctr | aes_cbs ] aes_cbc
encryption_key_file 2.1 2.2 2.3 2.4 2.5
mariadb10_master_gtid 2.1 2.2 2.3 2.4 2.5 0 | 1 0
master_retry_count 2.1 2.2 2.3 2.4 2.5 n 1000 retries
connect_retry 2.1 2.2 2.3 2.4 2.5 n 50 seconds

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

Variable Versions Values Default Unit Comment
main 2.5 <target> This is a mandatory parameter.
exporter 2.5 { log | file | kafka } This is a mandatory parameter.
file 2.5 <filename> This is a mandatory parameter with exporter=file.
kafka_broker 2.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.

Variable Versions Values Default Unit Comment
type 1.4   2.3 2.4 2.5 server      
serversize 1.4   2.3 2.4   <n>      
address 1.4   2.3 2.4 2.5 <IP address>      
port 1.4   2.3 2.4 2.5 <n>      
socket         2.5        
protocol 1.4   2.3 2.4 2.5 MySQLBackend      
server_weight 1.4   2.3     <n>      
monitoruser 1.4   2.3 2.4 2.5 <username>      
monitorpw 1.4   2.3 2.4 2.5 <password>      
extra_port     2.3 2.4 2.5 <n>      
persistpoolmax 1.4   2.3 2.4 2.5 <n> 0 connection  
persistmaxtime 1.4   2.3 2.4 2.5 <n> 0 second  
proxy_protocol     2.3 2.4 2.5        
authenticator     2.3 2.4          
authenticator_options     2.3 2.4         Removed feature
disk_space_threshold     2.3 2.4 2.5 <mountpoint:n>      
rank       2.4 2.5 { primary | secondary }     Replaces weightby parameter

Listener Options

Variable Versions Values Default Unit Comment
type 1.4   2.3 2.4 2.5 listener      
service 1.4   2.3 2.4 2.5 <Service name>      
protocol 1.4   2.3 2.4 2.5 [ MySQLClient | HTTPD | telnetd | maxscaled | CDC ]      
address 1.4   2.3 2.4 2.5 [ <IP address> | <hostname> ]      
port 1.4   2.3 2.4 2.5 <n>      
authenticator     2.3 2.4 2.5        
authenticator_options     2.3 2.4 2.5        
socket 1.4   2.3 2.4 2.5 <filename>      
sql_mode         2.5        
connection_init_sql_file         2.5        
ssl 1.4   2.3 2.4 2.5 { required }      
ssl_cert 1.4   2.3 2.4 2.5 <filename>      
ssl_key 1.4   2.3 2.4 2.5 <filename>      
ssl_ca_cert 1.4   2.3 2.4 2.5 <filename>      
ssl_version 1.4   2.3 2.4 2.5 { TLSv10 | TLSv11 | TLSv12 | TLSv13 | MAX }      
ssl_cipher         2.5        
ssl_cert_verify_depth 1.4   2.3 2.4 2.5 <n> 9    
ssl_verify_peer_certificate     2.3 2.4 2.5        
ssl_verify_peer_host         2.5        
ssl_crl         2.5        

Monitor Options

See also different MaxScale Monitors.

Variable Versions Values Default Unit Comment
type 1.4 2.2 2.3 2.4 2.5 monitor      
module 1.4 2.2 2.3 2.4 2.5 { mysqlmon | galeramon | ndbclustermon | mmon }      
servers 1.4 2.2 2.3 2.4 2.5        
user 1.4 2.1 2.3 2.4 2.5        
passwd 1.4 2.2              
password     2.3 2.4 2.5        
script 1.4 2.2 2.3 2.4 2.5        
script_timeout 1.4 2.2 2.3 2.4 2.5 <n> 90 second  
events 1.4 2.2 2.3 2.4 2.5 { master_down | master_up | ... }      
detect_replication_lag 1.4 2.2 2.3 2.4 2.5        
detect_stale_master 1.4 2.2 2.3 2.4 2.5        
mysql51_replication 1.4 2.2 2.3 2.4 2.5        
monitor_interval 1.4 2.2 2.3 2.4 2.5 <n> 10000 millisecond  
backend_connect_timeout 1.4 2.2 2.3 2.4 2.5 <n> 3 second  
backend_write_timeout 1.4 2.2 2.3 2.4 2.5 <n> 2 second  
backend_read_timeout 1.4 2.2 2.3 2.4 2.5 <n> 1 second  
backend_connect_attempts 1.4 2.2 2.3 2.4 2.5 <n> 1 times  
disk_space_threshold 1.4 2.2 2.3 2.4 2.5 <n> 1 times  
disk_space_check_interval 1.4 2.2 2.3 2.4 2.5 <n> 0 ms  

Filter Options


Variable Versions Values Default Unit Comment
type 1.4 2.2 2.3 2.4 2.5 filter      
module 1.4 2.2 2.3 2.4 2.5 { qafilter | regexfilter | tee | topfilter | dbfwfilter | namedserverfilter | mqfilter }