forked from hcymysql/MHA-Re-Edition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp1.cnf
56 lines (46 loc) · 1.62 KB
/
app1.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
[DEFAULT]
# log日志输出文件
manager_workdir = /root/mha_log/app1.log
vip = 172.19.136.200
interface = bond0
# 监控间隔时间,单位秒
connect_interval=1
# 开启调用其他从库去连接主库,如果不需要,则删除masterha_secondary_check这行内容
# 脚本会调用从库的mysql命令,默认读取路径是/usr/bin/mysql(已经写死在脚本里),如没有请创建一个软连接
masterha_secondary_check = 172.19.136.33,172.19.136.34
# 当从库出现延迟时,超过60秒内未同步完数据,强制开启VIP故障切换转移
running_updates_limit = 60
# ipmitool -I lanplus -H 远控卡主库IP -U 远程console用户 -P 远程console密码 power reset
# 如果不需要,则删除shutdown_script这行内容
shutdown_script = ipmitool -I lanplus -H 172.31.198.239 -U root -P calvin power reset
# 设置主库故障切换后触发微信报警(wechar.py和masterha_manager_mysql文件放在同一目录下)
weixin_alarm = /usr/bin/python wechat.py yourweixin
# MySQL确保每台机器都开启参数log_slave_updates = 1
[server1]
ip = 172.19.136.32
port = 3306
# repl用户最小权限是:
# GRANT SELECT, RELOAD, PROCESS, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO `repl`@`%`
# GRANT FLUSH_TABLES,SYSTEM_USER ON *.* TO `repl`@`%`
user = repl
password = sysrepl
ssh_user = root
ssh_port = 22
ssh_password = 123456
[server2]
ip = 172.19.136.33
port = 3307
user = repl
password = sysrepl
ssh_user = root
ssh_port = 22
ssh_password = 123456
candidate_master = 1
[server3]
ip = 172.19.136.34
port = 3308
user = repl
password = sysrepl
ssh_user = root
ssh_port = 22
ssh_password = 123456