Merge branch 'release-1.0GA' into MAX-324
This commit is contained in:
BIN
Documentation/MaxScale Configuration And Usage Scenarios.pdf
Executable file → Normal file
BIN
Documentation/MaxScale Configuration And Usage Scenarios.pdf
Executable file → Normal file
Binary file not shown.
@ -1,89 +1,204 @@
|
|||||||
|
## Example MaxScale.cnf configuration file
|
||||||
#
|
#
|
||||||
# Example MaxScale.cnf configuration file
|
# Number of worker threads in MaxScale
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# Number of server threads
|
|
||||||
# Valid options are:
|
|
||||||
# threads=<number of threads>
|
# threads=<number of threads>
|
||||||
|
#
|
||||||
[maxscale]
|
[maxscale]
|
||||||
threads=1
|
threads=4
|
||||||
|
|
||||||
# Define a monitor that can be used to determine the state and role of
|
## Define a monitor that can be used to determine the state and role of
|
||||||
# the servers.
|
# the servers.
|
||||||
#
|
#
|
||||||
# Valid options for all monitors are:
|
# Currently valid options for all monitors are:
|
||||||
#
|
#
|
||||||
# module=<name of module to load>
|
# module=[mysqlmon|galeramon]
|
||||||
# servers=<server name>,<server name>,...
|
#
|
||||||
# user =<user name - must have slave replication and
|
# List of server names which are being monitored
|
||||||
# slave client privileges>
|
#
|
||||||
# passwd=<password of the above user, plain text currently>
|
# servers=<server name 1>,<server name 2>,...,<server name N>
|
||||||
# monitor_interval=<sampling interval in milliseconds,
|
#
|
||||||
# default value is 10000>
|
# Username for monitor queries, need slave replication and slave client privileges
|
||||||
|
# Password in plain text format, and monitor's sampling interval in milliseconds.
|
||||||
|
#
|
||||||
|
# user=<username>
|
||||||
|
# passwd=<plain txt password>
|
||||||
|
# monitor_interval=<sampling interval in milliseconds> (default 10000)
|
||||||
|
#
|
||||||
|
# Timeouts for monitor operations in backend servers - optional.
|
||||||
|
#
|
||||||
|
# backend_connect_timeout=<timeout in seconds>
|
||||||
|
# backend_write_timeout=<timeout in seconds>
|
||||||
|
# backend_read_timeout=<timeout in seconds>
|
||||||
|
#
|
||||||
|
## mysql_monitor specific options:
|
||||||
|
#
|
||||||
|
# Enable detection of replication slaves lag via replication_heartbeat
|
||||||
|
# table - optional.
|
||||||
|
#
|
||||||
|
# detect_replication_lag=[1|0] (default 0)
|
||||||
|
#
|
||||||
|
# Allow previous master to be available even in case of stopped or misconfigured
|
||||||
|
# replication - optional.
|
||||||
|
#
|
||||||
|
# detect_stale_master=[1|0] (default 0)
|
||||||
|
#
|
||||||
|
## Examples:
|
||||||
|
|
||||||
[MySQL Monitor]
|
[MySQL Monitor]
|
||||||
type=monitor
|
type=monitor
|
||||||
module=mysqlmon
|
module=mysqlmon
|
||||||
servers=server1,server2,server3
|
servers=server1,server2,server3
|
||||||
user=maxuser
|
user=myuser
|
||||||
passwd=maxpwd
|
passwd=mypwd
|
||||||
#
|
monitor_interval=10000
|
||||||
# options for mysql_monitor only
|
#backend_connect_timeout=
|
||||||
#
|
#backend_read_timeout=
|
||||||
# detect_replication_lag=<enable detection of replication slaves lag
|
#backend_write_timeout=
|
||||||
# via replication_heartbeat table,
|
#detect_replication_lag=
|
||||||
# default value is 0>
|
#detect_stale_master=
|
||||||
# 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
|
[Galera Monitor]
|
||||||
|
type=monitor
|
||||||
|
module=galeramon
|
||||||
|
servers=server1,server2,server3
|
||||||
|
user=myuser
|
||||||
|
passwd=mypwd
|
||||||
|
monitor_interval=10000
|
||||||
|
|
||||||
|
## Filter definition
|
||||||
#
|
#
|
||||||
# Valid options are:
|
# Type specifies the section
|
||||||
#
|
#
|
||||||
# router=<name of router module>
|
# type=filter
|
||||||
# servers=<server name>,<server name>,...
|
#
|
||||||
# user=<User to fetch password inforamtion with>
|
# Module specifies which module implements the filter function
|
||||||
# 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:
|
# module=[qlafilter|regexfilter|topfilter|teefilter]
|
||||||
|
#
|
||||||
|
# Options specify the log file for Query Log Filter
|
||||||
|
#
|
||||||
|
# options=<path to logfile>
|
||||||
|
#
|
||||||
|
# Match and replace are used in regexfilter
|
||||||
|
#
|
||||||
|
# match=fetch
|
||||||
|
# replace=select
|
||||||
|
#
|
||||||
|
# Count and filebase are used with topfilter to specify how many top queries are
|
||||||
|
# listed and where.
|
||||||
|
#
|
||||||
|
# count=<count>
|
||||||
|
# filebase=<path to output file>
|
||||||
|
#
|
||||||
|
# Match and service are used by tee filter to specify what queries should be
|
||||||
|
# duplicated and where the copy should be routed.
|
||||||
|
#
|
||||||
|
# match=insert.*HighScore.*values
|
||||||
|
# service=Cassandra
|
||||||
|
#
|
||||||
|
## Examples:
|
||||||
|
|
||||||
|
[qla]
|
||||||
|
type=filter
|
||||||
|
module=qlafilter
|
||||||
|
options=/tmp/QueryLog
|
||||||
|
|
||||||
|
[fetch]
|
||||||
|
type=filter
|
||||||
|
module=regexfilter
|
||||||
|
match=fetch
|
||||||
|
replace=select
|
||||||
|
|
||||||
|
|
||||||
|
## A series of service definition
|
||||||
|
#
|
||||||
|
# Name of router module, currently valid options are
|
||||||
|
#
|
||||||
|
# router=[readconnroute|readwritesplit|debugcli|CLI]
|
||||||
|
#
|
||||||
|
# List of server names for use of service - mandatory for readconnroute,
|
||||||
|
# readwritesplit, and debugcli
|
||||||
|
#
|
||||||
|
# servers=<server name 1>,<server name 2>,...,<server name N>
|
||||||
|
#
|
||||||
|
# Username to fetch password information with and password in plaintext
|
||||||
|
# format - for readconnroute and readwritesplit
|
||||||
|
#
|
||||||
|
# user=<username>
|
||||||
|
# passwd=<password in plain text format>
|
||||||
|
#
|
||||||
|
# flag for enabling the use of root user - for readconnroute and
|
||||||
|
# readwritesplite - optional.
|
||||||
|
#
|
||||||
|
# enable_root_user=[0|1] (default 0)
|
||||||
|
#
|
||||||
|
# Version string to be used in server handshake. Default value is that of
|
||||||
|
# MariaDB embedded library's - for readconnroute and readwritesplite - optional.
|
||||||
|
#
|
||||||
|
# version_string=<specific version string>
|
||||||
|
#
|
||||||
|
# Filters specify the filters through which the query is transferred and the
|
||||||
|
# order of their appearance on the list corresponds the order they are
|
||||||
|
# used. Values refer to names of filters configured in this file - for
|
||||||
|
# readconnroute and readwritesplit - optional.
|
||||||
|
#
|
||||||
|
# filters=<filter name1|filter name2|...|filter nameN>
|
||||||
|
#
|
||||||
|
## Read Connection Router specific router options.
|
||||||
|
#
|
||||||
|
# router_options specify the role in which the selected server must be.
|
||||||
|
#
|
||||||
|
# router_options=[master|slave|synced]
|
||||||
|
#
|
||||||
|
## Read/Write Split Router specific options.
|
||||||
|
#
|
||||||
|
# use_sql_variables_in specifies where sql variable modifications are
|
||||||
|
# routed - optional.
|
||||||
|
#
|
||||||
|
# use_sql_variables_in=[master|all] (default all)
|
||||||
|
#
|
||||||
|
# router_options=slave_selection_criteria specifies the selection criteria for
|
||||||
|
# slaves both in new session creation and when route target is selected - optional.
|
||||||
|
#
|
||||||
|
# router_options=
|
||||||
|
# slave_selection_criteria=[LEAST_CURRENT_OPERATIONS|LEAST_BEHIND_MASTER]
|
||||||
|
#
|
||||||
|
# max_slave_connections specifies how many slaves a router session can
|
||||||
|
# connect to - optional.
|
||||||
|
#
|
||||||
|
# max_slave_connections=<number, or percentage, of all slaves>
|
||||||
|
#
|
||||||
|
# max_slave_replication_lag specifies how much a slave is allowed to be behind
|
||||||
|
# the master and still become chosen routing target - optional, requires that
|
||||||
|
# monitor has detect_replication_lag=1 .
|
||||||
#
|
#
|
||||||
# max_slave_connections=<exact number or percentage of all slaves>
|
|
||||||
# max_slave_replication_lag=<allowed lag in seconds for a slave>
|
# 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:
|
# Valid router modules currently are:
|
||||||
# readwritesplit, readconnroute and debugcli
|
# readwritesplit, readconnroute, debugcli and CLI
|
||||||
|
#
|
||||||
|
## Examples:
|
||||||
|
|
||||||
|
[Read Connection Router]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
servers=server1,server2,server3
|
||||||
|
user=myuser
|
||||||
|
passwd=mypwd
|
||||||
|
router_options=slave
|
||||||
|
|
||||||
[RW Split Router]
|
[RW Split Router]
|
||||||
type=service
|
type=service
|
||||||
router=readwritesplit
|
router=readwritesplit
|
||||||
servers=server1,server2,server3
|
servers=server1,server2,server3
|
||||||
user=maxuser
|
user=myuser
|
||||||
passwd=maxpwd
|
passwd=mypwd
|
||||||
use_sql_variables_in=all
|
#use_sql_variables_in=
|
||||||
max_slave_connections=50%
|
#max_slave_connections=100%
|
||||||
max_slave_replication_lag=30
|
#max_slave_replication_lag=21
|
||||||
router_options=slave_selection_criteria=LEAST_BEHIND_MASTER
|
#router_options=slave_selection_criteria=
|
||||||
|
#filters=fetch|qla
|
||||||
|
|
||||||
[Read Connection Router]
|
|
||||||
type=service
|
|
||||||
router=readconnroute
|
|
||||||
router_options=slave
|
|
||||||
servers=server1,server2,server3
|
|
||||||
user=maxuser
|
|
||||||
passwd=maxpwd
|
|
||||||
|
|
||||||
[HTTPD Router]
|
[HTTPD Router]
|
||||||
type=service
|
type=service
|
||||||
@ -94,15 +209,44 @@ servers=server1,server2,server3
|
|||||||
type=service
|
type=service
|
||||||
router=debugcli
|
router=debugcli
|
||||||
|
|
||||||
# Listener definitions for the services
|
[CLI]
|
||||||
|
type=service
|
||||||
|
router=CLI
|
||||||
|
|
||||||
|
## Listener definitions for the services
|
||||||
#
|
#
|
||||||
# Valid options are:
|
# Type specifies section as listener one
|
||||||
|
#
|
||||||
|
# type=listener
|
||||||
|
#
|
||||||
|
# Service links the section to one of the service names used in this configuration
|
||||||
|
#
|
||||||
|
# service=<name of service section>
|
||||||
|
#
|
||||||
|
# Protocol is client protocol library name.
|
||||||
|
#
|
||||||
|
# protocol=[MySQLClient|telnetd|HTTPD|maxscaled]
|
||||||
|
#
|
||||||
|
# Port and address specify which port the service listens and the address limits
|
||||||
|
# listening to a specific network interface only. Address is optional.
|
||||||
#
|
#
|
||||||
# service=<name of service defined elsewhere>
|
|
||||||
# protocol=<name of protocol module with which to listen>
|
|
||||||
# port=<Listening port>
|
# port=<Listening port>
|
||||||
# address=<Address to bind to>
|
# address=<Address to bind to>
|
||||||
|
#
|
||||||
|
# Socket is alternative for address. The specified socket path must be writable
|
||||||
|
# by the Unix user MaxScale runs as.
|
||||||
|
#
|
||||||
# socket=<Listening socket>
|
# socket=<Listening socket>
|
||||||
|
#
|
||||||
|
## Examples:
|
||||||
|
|
||||||
|
[Read Connection Listener]
|
||||||
|
type=listener
|
||||||
|
service=Read Connection Router
|
||||||
|
protocol=MySQLClient
|
||||||
|
address=192.168.100.102
|
||||||
|
port=4008
|
||||||
|
#socket=/tmp/readconn.sock
|
||||||
|
|
||||||
[RW Split Listener]
|
[RW Split Listener]
|
||||||
type=listener
|
type=listener
|
||||||
@ -111,19 +255,12 @@ protocol=MySQLClient
|
|||||||
port=4006
|
port=4006
|
||||||
#socket=/tmp/rwsplit.sock
|
#socket=/tmp/rwsplit.sock
|
||||||
|
|
||||||
[Read Connection Listener]
|
|
||||||
type=listener
|
|
||||||
service=Read Connection Router
|
|
||||||
protocol=MySQLClient
|
|
||||||
port=4008
|
|
||||||
#socket=/tmp/readconn.sock
|
|
||||||
|
|
||||||
[Debug Listener]
|
[Debug Listener]
|
||||||
type=listener
|
type=listener
|
||||||
service=Debug Interface
|
service=Debug Interface
|
||||||
protocol=telnetd
|
protocol=telnetd
|
||||||
port=4442
|
|
||||||
#address=127.0.0.1
|
#address=127.0.0.1
|
||||||
|
port=4442
|
||||||
|
|
||||||
[HTTPD Listener]
|
[HTTPD Listener]
|
||||||
type=listener
|
type=listener
|
||||||
@ -131,40 +268,51 @@ service=HTTPD Router
|
|||||||
protocol=HTTPD
|
protocol=HTTPD
|
||||||
port=6444
|
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]
|
[CLI Listener]
|
||||||
type=listener
|
type=listener
|
||||||
service=CLI
|
service=CLI
|
||||||
protocol=maxscaled
|
protocol=maxscaled
|
||||||
address=localhost
|
#address=localhost
|
||||||
port=6603
|
port=6603
|
||||||
|
|
||||||
# Definition of the servers
|
## Definition of the servers
|
||||||
|
#
|
||||||
|
# Type specifies the section as server one
|
||||||
|
#
|
||||||
|
# type=server
|
||||||
|
#
|
||||||
|
# The IP address or hostname of the machine running the database server that is
|
||||||
|
# being defined. MaxScale will use this address to connect to the backend
|
||||||
|
# database server.
|
||||||
|
#
|
||||||
|
# address=<IP|hostname>
|
||||||
|
#
|
||||||
|
# The port on which the database listens for incoming connections. MaxScale
|
||||||
|
# will use this port to connect to the database server.
|
||||||
|
#
|
||||||
|
# port=<port>
|
||||||
|
#
|
||||||
|
# The name for the protocol module to use to connect MaxScale to the database.
|
||||||
|
# Currently the only backend protocol supported is the MySQLBackend module.
|
||||||
|
#
|
||||||
|
# protocol=MySQLBackend
|
||||||
|
#
|
||||||
|
## Examples:
|
||||||
|
|
||||||
[server1]
|
[server1]
|
||||||
type=server
|
type=server
|
||||||
address=127.0.0.1
|
address=192.168.100.101
|
||||||
port=3000
|
port=3000
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
|
|
||||||
[server2]
|
[server2]
|
||||||
type=server
|
type=server
|
||||||
address=127.0.0.1
|
address=192.168.100.102
|
||||||
port=3001
|
port=3000
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
|
|
||||||
[server3]
|
[server3]
|
||||||
type=server
|
type=server
|
||||||
address=127.0.0.1
|
address=192.168.100.103
|
||||||
port=3002
|
port=3000
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
|
Reference in New Issue
Block a user