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
| [mysql-proxy]
# (Necessary, the default value is ok) The name access to admin port
admin-username=user
# (Necessary, the default value is ok) The password access to admin port
admin-password=pwd
# (Necessary,set value according to the actual situation) The master database server,ip:port.
proxy-backend-addresses=192.168.88.11:3306
# (Not necessary,set value according to the actual situation) The slave database server, ip:port.
# The number behind '@'represents the weight used by load balance for reading,
# the default weight is 1. If you want the master backend also can process the read requests,
# add its ip:port to this configuration option.
proxy-read-only-backend-addresses=192.168.88.12:3306@5,192.168.88.13:3306@3,192.168.88.11:3306
# (Necessary,set value according to the actual situation) Username and its password login master and slave.
# We can use the username and password login the master database and the slave database server.
# The password encrypt by /usr/loca/mysql-proxy/bin/encrypt.
# For example, the username is: myuser, and the password is:mypwd (encrypted ciphertext is:HJBoxfRsjeI=).
pwds=repl:jNsKRuypPY0=
# (Necessary, the default value is ok) if the value is true,Atlas run as a daemon.
daemon=false
# (Necessary, the default value is ok) Atlas will start two processes when the value set true,
# one is monitor process, another is the work process. The monitor process will restart the work process
# automatically when the work process crash unexpectedly.
# If the value set false, Atlas will only start the work process.
keepalive=true
# (Necessary, set value according to the actual situation) The count of work threads in work process.
# set the value equal to twice of cpu cores
event-threads=4
# (Necessary, the default value is ok) Log level: message, warning, critical, error, debug
log-level=debug
# (Necessary, the default value is ok) Log file path
log-path=/usr/local/mysql-proxy/log
# (Necessary, the default value is ok) The switch for printing log.
# ON : log the sql to the log file with buffer.
# OFF : not log the sql.
# REALTIME : log the sql to the log file without buffer.
sql-log=REALTIME
# (Necessary, set value according to the actual situation) Slow log output settings.
# When this parameter is set, Only log the sql which execution time more than sql-log-slow (ms) logging.
# Do not set this parameter, will log all the sql.
sql-log-slow=10
# (Necessary, set value according to the actual situation) close the inactive client connections
# after ‘wait_timeout’ seconds
wait-timeout=10
# (Necessary, the default value is ok) The work port of Atlas
proxy-address=0.0.0.0:3307
# (Necessary, the default value is ok) The admin port of Atlas
admin-address=0.0.0.0:3308
# (Not necessary, set value according to the actual situation) Shard table setting.
# In this case, person is the database name, mt is the table name, id is the shard key,
# the shard table count is 3,and you should create table mt_0, mt_1, mt_2 in mysql manually.
# If you have more shard table,you can set them and separated by commas.
#tables = person.mt.id.3
# (Not necessary,set value according to the actual situation)character set,
# If you not set this parameter, the character is latin1.
charset=utf8
# (Not necessary,do not set this parameter) The client's IP be allowed to connect Atlas.
# If you not set this parameter, all client can connect Atlas.
client-ips=127.0.0.1,192.168.88
# (Not necessary,do not set this parameter) If you set client-ips, and through LVS connecting Atlas,
# then you need set lvs-ips, and this parameter is the true IP of LVS.
#lvs-ips = 192.168.1.1 |