171 lines
3.7 KiB
INI
171 lines
3.7 KiB
INI
#
|
|
# Example MaxScale.cnf configuration file
|
|
#
|
|
#
|
|
#
|
|
# Number of server threads
|
|
# Valid options are:
|
|
# threads=<number of threads>
|
|
|
|
[maxscale]
|
|
threads=1
|
|
|
|
# Define a monitor that can be used to determine the state and role of
|
|
# the servers.
|
|
#
|
|
# Valid options for all monitors are:
|
|
#
|
|
# module=<name of module to load>
|
|
# servers=<server name>,<server name>,...
|
|
# user =<user name - must have slave replication and
|
|
# slave client privileges>
|
|
# passwd=<password of the above user, plain text currently>
|
|
# monitor_interval=<sampling interval in milliseconds,
|
|
# default value is 10000>
|
|
|
|
[MySQL Monitor]
|
|
type=monitor
|
|
module=mysqlmon
|
|
servers=server1,server2,server3
|
|
user=maxuser
|
|
passwd=maxpwd
|
|
#
|
|
# options for mysql_monitor only
|
|
#
|
|
# detect_replication_lag=<enable detection of replication slaves lag
|
|
# via replication_heartbeat table,
|
|
# default value is 0>
|
|
# detect_stale_master=<if the replication is stopped or misconfigured
|
|
# the previous detected master will be still available
|
|
# until monitor or MaxSclale restart,
|
|
# default value is 0>
|
|
|
|
# A series of service definition
|
|
#
|
|
# Valid options are:
|
|
#
|
|
# router=<name of router module>
|
|
# servers=<server name>,<server name>,...
|
|
# user=<User to fetch password inforamtion with>
|
|
# passwd=<Password of the user, plain text currently>
|
|
# enable_root_user=<0 or 1, default is 0>
|
|
# version_string=<specific string for server handshake,
|
|
# default is the MariaDB embedded library version>
|
|
#
|
|
# use_sql_variables_in=[master|all] (default all)
|
|
# router_options=<option[=value]>,<option[=value]>,...
|
|
# where value=[master|slave|synced]
|
|
#
|
|
# Read/Write Split Router specific options are:
|
|
#
|
|
# max_slave_connections=<exact number or percentage of all slaves>
|
|
# max_slave_replication_lag=<allowed lag in seconds for a slave>
|
|
# router_options=slave_selection_criteria=[LEAST_CURRENT_OPERATIONS|LEAST_BEHIND_MASTER]
|
|
#
|
|
# Valid router modules currently are:
|
|
# readwritesplit, readconnroute and debugcli
|
|
|
|
[RW Split Router]
|
|
type=service
|
|
router=readwritesplit
|
|
servers=server1,server2,server3
|
|
user=maxuser
|
|
passwd=maxpwd
|
|
use_sql_variables_in=all
|
|
max_slave_connections=50%
|
|
max_slave_replication_lag=30
|
|
router_options=slave_selection_criteria=LEAST_BEHIND_MASTER
|
|
|
|
|
|
[Read Connection Router]
|
|
type=service
|
|
router=readconnroute
|
|
router_options=slave
|
|
servers=server1,server2,server3
|
|
user=maxuser
|
|
passwd=maxpwd
|
|
|
|
[HTTPD Router]
|
|
type=service
|
|
router=testroute
|
|
servers=server1,server2,server3
|
|
|
|
[Debug Interface]
|
|
type=service
|
|
router=debugcli
|
|
|
|
# Listener definitions for the services
|
|
#
|
|
# Valid options are:
|
|
#
|
|
# service=<name of service defined elsewhere>
|
|
# protocol=<name of protocol module with which to listen>
|
|
# port=<Listening port>
|
|
# address=<Address to bind to>
|
|
# socket=<Listening socket>
|
|
|
|
[RW Split Listener]
|
|
type=listener
|
|
service=RW Split Router
|
|
protocol=MySQLClient
|
|
port=4006
|
|
#socket=/tmp/rwsplit.sock
|
|
|
|
[Read Connection Listener]
|
|
type=listener
|
|
service=Read Connection Router
|
|
protocol=MySQLClient
|
|
port=4008
|
|
#socket=/tmp/readconn.sock
|
|
|
|
[Debug Listener]
|
|
type=listener
|
|
service=Debug Interface
|
|
protocol=telnetd
|
|
port=4442
|
|
#address=127.0.0.1
|
|
|
|
[HTTPD Listener]
|
|
type=listener
|
|
service=HTTPD Router
|
|
protocol=HTTPD
|
|
port=6444
|
|
|
|
# Enable the maxadmin interface to MaxScale
|
|
#
|
|
# Listen on the default port of 6603 and restrict
|
|
# to connections from localhost only.
|
|
# Remove the address=localhost entry to enable
|
|
# maxadmin connections from any host
|
|
|
|
[CLI]
|
|
type=service
|
|
router=cli
|
|
|
|
[CLI Listener]
|
|
type=listener
|
|
service=CLI
|
|
protocol=maxscaled
|
|
address=localhost
|
|
port=6603
|
|
|
|
# Definition of the servers
|
|
|
|
[server1]
|
|
type=server
|
|
address=127.0.0.1
|
|
port=3000
|
|
protocol=MySQLBackend
|
|
|
|
[server2]
|
|
type=server
|
|
address=127.0.0.1
|
|
port=3001
|
|
protocol=MySQLBackend
|
|
|
|
[server3]
|
|
type=server
|
|
address=127.0.0.1
|
|
port=3002
|
|
protocol=MySQLBackend
|