-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmaxscale.cnf
118 lines (98 loc) · 2.4 KB
/
maxscale.cnf
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
# MaxScale documentation:
# https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-23/
# Global parameters
# Complete list of configuration options:
# https://mariadb.com/kb/en/mariadb-maxscale-23-mariadb-maxscale-configuration-usage-scenarios/
[maxscale]
threads=auto
maxlog=1
log_warning=1
log_notice=1
log_info=1
# Server definitions
#
# Set the address of the server to the network
# address of a MariaDB server.
[galera1]
type=server
address=10.0.2.78
port=3306
protocol=MariaDBBackend
[galera2]
type=server
address=10.0.2.195
port=3306
protocol=MariaDBBackend
[galera3]
type=server
address=10.0.2.176
port=3306
protocol=MariaDBBackend
# here we can see the duplication of the server objects
# it is forced by the way maxscale monitor handles the server objects
[galera3.bis]
type=server
address=10.0.2.176
port=3306
protocol=MariaDBBackend
[slave1]
type=server
address=10.0.2.42
port=3306
protocol=MariaDBBackend
# Monitor for the servers
#
# This will keep MaxScale aware of the state of the servers.
# MariaDB Monitor documentation:
# https://mariadb.com/kb/en/mariadb-maxscale-23-mariadb-monitor/
[galera-monitor]
type=monitor
module=galeramon
servers=galera1,galera2,galera3
user=monitor
password=monitor
monitor_interval=500
[replication-monitor]
type=monitor
module=mariadbmon
servers=galera3.bis,slave1
user=monitor
password=monitor
monitor_interval=500
# that's where everything happens. upon master down detection, the script is triggered with the necessary parameters
events=master_down
script=/var/lib/failover.sh --initiator=$INITIATOR --children=$CHILDREN --monitor=replication-monitor
# Service definitions
#
# Service Definition for a read-only service and
# a read/write splitting service.
#
# ReadWriteSplit documentation:
# https://mariadb.com/kb/en/mariadb-maxscale-23-readwritesplit/
[galerasplit]
type=service
router=readwritesplit
servers=galera1,galera2,galera3,slave1
user=maxscale
password=maxscale
# This service enables the use of the MaxAdmin interface
# MaxScale administration guide:
# https://mariadb.com/kb/en/mariadb-maxscale-23-maxadmin-admin-interface/
[MaxAdmin-Service]
type=service
router=cli
# Listener definitions for the services
#
# These listeners represent the ports the
# services will listen on.
#
[Read-Write-Listener]
type=listener
service=galerasplit
protocol=MariaDBClient
port=4306
[MaxAdmin-Listener]
type=listener
service=MaxAdmin-Service
protocol=maxscaled
socket=default