老师我这个哪里配置不对啊,检查报错?

来源:5-17 MHA架构实例演示(2)

雪兔儿

2020-05-17

[server default]
user=mha
password=Ma3962281;
manager_workdir=/home/mysql_mha
manager_log=/home/mysql_mha.log
remote_workdir=/home/mysql_mha
ssh_user=root
repl_user=repl
repl_password=Ma3962281;
ping_interval=1
master_binlog_dir=/var/lib/mysql #可在主服务器上通过show variables like '%log%'查询
master_ip_failover_script=/usr/bin/master_ip_failover #可选
secondary_check_script=/usr/bin/masterha_secondary_check -s 192.168.118.139 -s 192.168.118.141 -s 192.168.118.140
[server1]
hostname=192.168.118.139
candidate_master=1
[server2]
hostname=192.168.118.141
candidate_master=1
[server3]
hostname=192.168.118.140
no_master=1

server-id = 3 //从 ip 192.168.118.140
log_bin=mysql-bin
relay_log=/var/lib/mysql/mysqld-relay-bin
gtid_mode=on
enforce-gtid-consistency=on

server_id=1 //主 192.168.118.139
gtid_mode = on
enforce-gtid-consistency = on
log_bin =mysql-bin
relay_log=mysqld-relay-bin

server-id = 2 //从192.168.118.141
log_bin=mysql-bin
relay_log=mysqld-relay-bin
gtid_mode=on
enforce-gtid-consistency=on
read_only=on
master_info_repository = TABLE
relay_log_info_repository = TABLE

[root@bogon ~]# masterha_check_repl --conf=/etc/mha/mysql_mha.cnf
Sun May 17 06:36:41 2020 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Sun May 17 06:36:41 2020 - [info] Reading application default configuration from /etc/mha/mysql_mha.cnf…
Sun May 17 06:36:41 2020 - [info] Reading server configuration from /etc/mha/mysql_mha.cnf…
Sun May 17 06:36:41 2020 - [info] MHA::MasterMonitor version 0.57.
Sun May 17 06:36:51 2020 - [info] GTID failover mode = 1
Sun May 17 06:36:51 2020 - [info] Dead Servers:
Sun May 17 06:36:51 2020 - [info] 192.168.118.139(192.168.118.139:3306)
Sun May 17 06:36:51 2020 - [info] 192.168.118.141(192.168.118.141:3306)
Sun May 17 06:36:51 2020 - [info] Alive Servers:
Sun May 17 06:36:51 2020 - [info] 192.168.118.140(192.168.118.140:3306)
Sun May 17 06:36:51 2020 - [info] Alive Slaves:
Sun May 17 06:36:51 2020 - [info] 192.168.118.140(192.168.118.140:3306) Version=5.7.30-log (oldest major version between slaves) log-bin:enabled
Sun May 17 06:36:51 2020 - [info] GTID ON
Sun May 17 06:36:51 2020 - [info] Replicating from 192.168.118.139(192.168.118.139:3306)
Sun May 17 06:36:51 2020 - [info] Not candidate for the new Master (no_master is set)
Sun May 17 06:36:51 2020 - [warning] MySQL master is not currently alive!
Sun May 17 06:36:51 2020 - [info] Checking slave configurations…
Sun May 17 06:36:51 2020 - [info] Checking replication filtering settings…
Sun May 17 06:36:51 2020 - [info] Replication filtering check ok.
Sun May 17 06:36:51 2020 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln364] None of slaves can be master. Check failover configuration file or log-bin settings in my.cnf
Sun May 17 06:36:51 2020 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. at /usr/bin/masterha_check_repl line 48.
Sun May 17 06:36:51 2020 - [error][/usr/share/perl5/vendor_perl/MHA/MasterMonitor.pm, ln525] Error happened on monitoring servers.
Sun May 17 06:36:51 2020 - [info] Got exit code 1 (Not master dead).

报这个错是怎么回事啊?139是主。139是不是也给 change master to master_host =‘192.168.118.141’,
master_user=‘repl’,
master_password =‘Ma3962281;’,
master_auto_position=1;
这里是不是有问题啊?

写回答

1回答

sqlercn

2020-05-17

你这里一共有三台服务器,其中139和141可以当做主来使用,但是这里检测这两台服务器都不可用了,只有140一台可用,所以MHA是无法启动的。

0
1
雪兔儿
非常感谢!
2020-05-17
共1条回复

MySQL提升课程 全面讲解MySQL架构设计

面面俱到讲解影响MySQL性能的各个因素,让MySQL架构了然于胸。

4431 学习 · 549 问题

查看课程