Chinaunix首页 | 论坛 | 博客
  • 博客访问: 903263
  • 博文数量: 354
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 3730
  • 用 户 组: 普通用户
  • 注册时间: 2017-08-21 18:43
文章分类

全部博文(354)

文章存档

2019年(126)

2018年(223)

2017年(5)

我的朋友

分类: Mysql/postgreSQL

2018-06-15 18:09:58

手动failover,这种场景意味着在业务上没有启用MHA自动切换功能,当主服务器故障时,人工手动调用MHA来进行故障切换操作,具体命令如下:

? 先关闭mha进程,确保不会自动执行切换

[root@mycat ~]# masterha_stop --conf=/etc/app1.cnf

? 再关闭maser主库

[root@master ~]# /etc/init.d/mysql.server stop

Shutting down MySQL............ SUCCESS!

? 执行手动切换

[root@mycat ~]# masterha_master_switch --master_state=dead --conf=/etc/app1.cnf --

dead_master_host=master --dead_master_port=3308 --new_master_ip=192.168.237.131 --

new_master_port=3308

……

----- Failover Report -----

app1: MySQL Master failover master to slave1 succeeded

Master master is down!

Check MHA Manager logs at mycat for details.

Started manual(interactive) failover.

The latest slave slave1(192.168.237.130:3308) has all relay logs for recovery.

Selected slave1 as a new master.

slave1: OK: Applying all logs succeeded.

slave2: This host has the latest relay log events.

Generating relay diff files from the latest slave succeeded.

slave2: OK: Applying all logs succeeded. Slave started, replicating from slave1.

slave1: Resetting slave info succeeded.

Master failover to slave1(192.168.237.130:3308) completed successfully.

阅读(949) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~