mysql HA 方案(3):MHA

1   ERROR 1045 (28000): Access denied for user 问题,查了好久,发现是有为null的user,删除对应的记录就好了

[root@db-181 ~]# mysql -u rep -p -h db-183
Enter password:
ERROR 1045 (28000): Access denied for user 'rep'@'db-181' (using password: YES)
[root@db-181 ~]# mysql -u root -p -h db-183  
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'db-181' (using password: YES)


mysql> select user,host from mysql.user;
+--------+------------+
| user   | host       |
+--------+------------+
| dba    | %          |
| rep    | %          |
| sbtest | %          |
| root   | 127.0.0.1  |
| root   | ::1        |
|        | db-181     |
| root   | db-181     |
| root   | db-182     |
| root   | db-183     |
|        | localhost  |
| rep    | localhost  |
| root   | localhost  |
+--------+------------+
13 rows in set (0.00 sec)

mysql> delete from mysql.user where user='' and host='db-181';
Query OK, 1 row affected (0.00 sec)


mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

2  A question about using MHA "purge_relay_logs script" :

    Thanks for the MHA and she  is very useful to us .
    But i have a question about using "purge_relay_logs script". 
    IN the "Requirements and Limitations" you write :
    It is recommended invoking cron at different time between slaves.
    If all slaves invoke purge_relay_logs at the same time, none of the slave might not have necessary relay log events at crash.
     It is no problem in most cases. But in an extreme scenario ,the Latest Slave has just switched relay log .
     After the point if i execute purge_relay_logs script. and the master crash at the same time.
     But other slaves haven't the lasted relay log (have some gap ) and  the dead master is unreachable via SSH.
     In the scenario , MHA(0.53) can recover the cluster or not ?
 
    我们目前的想法是relay log通过我们的定时任务进行清除,同时维护relay index。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/758322/viewspace-722418/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/758322/viewspace-722418/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值