-
Notifications
You must be signed in to change notification settings - Fork 341
/
Copy pathmaxscale.cnf.template
122 lines (109 loc) · 6.86 KB
/
maxscale.cnf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#####################################################
# MaxScale documentation: #
# https://mariadb.com/kb/en/mariadb-maxscale-24-02/ #
#####################################################
#######################################################################################################
# Global parameters #
# #
# Complete list of configuration options: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-mariadb-maxscale-configuration-guide/ #
#######################################################################################################
[maxscale]
threads=auto
############################################################################
# Server definitions #
# #
# Set the address of the server to the network address of a MariaDB server.#
############################################################################
[server1]
type=server
address=127.0.0.1
port=3306
##################################################################################
# Uncomment this and add MaxScale's IP to proxy_protocol_networks in MariaDB for #
# easier user management: https://mariadb.com/kb/en/proxy-protocol-support/ #
##################################################################################
# proxy_protocol=true
##################################################################################################
# Monitor for the servers #
# #
# This will keep MaxScale aware of the state of the servers. #
# MariaDB Monitor documentation: #
# https://mariadb.com/kb/en/maxscale-24-02monitors/ #
# #
# The GRANTs needed by the monitor user depend on the actual monitor. #
# The GRANTs required by the MariaDB Monitor can be found here: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-mariadb-monitor/#required-grants #
##################################################################################################
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1
user=monitor_user
password=monitor_pw
monitor_interval=2s
##################################################################################################################
# Uncomment these to enable automatic node failover: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-mariadb-monitor/#cluster-manipulation-operations #
# #
# The GRANTs required for automatic node failover can be found here: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-mariadb-monitor/#cluster-manipulation-grants #
##################################################################################################################
# auto_failover=true
# auto_rejoin=true
# enforce_simple_topology=true
# replication_user=<username used for replication>
# replication_password=<password used for replication>
#########################################################################################################
# Uncomment this if you use more than one MaxScale with automatic node failover: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-mariadb-monitor/#cooperative-monitoring #
#########################################################################################################
# cooperative_monitoring_locks=majority_of_all
#########################################################################################################
# Service definitions #
# #
# Service Definition for a read-only service and a read/write splitting service. #
# #
# The GRANTs needed by the service user can be found here: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-authentication-modules/#required-grants #
#########################################################################################################
################################################################################
# ReadConnRoute documentation: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-readconnroute/ #
################################################################################
[Read-Only-Service]
type=service
router=readconnroute
servers=server1
user=service_user
password=service_pw
router_options=slave
#################################################################################
# ReadWriteSplit documentation: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-readwritesplit/ #
#################################################################################
[Read-Write-Service]
type=service
router=readwritesplit
servers=server1
user=service_user
password=service_pw
####################################################################################################
# Uncomment these to enable transparent transaction replay on node failure: #
# https://mariadb.com/kb/en/mariadb-maxscale-2402-maxscale-2402-readwritesplit/#transaction_replay #
####################################################################################################
# transaction_replay=true
# transaction_replay_timeout=30s
####################################################################
# Listener definitions for the services #
# #
# These listeners represent the ports the services will listen on. #
####################################################################
[Read-Only-Listener]
type=listener
service=Read-Only-Service
port=4008
[Read-Write-Listener]
type=listener
service=Read-Write-Service
port=4006