当前位置:网站首页>mha 切换(操作流程建议)
mha 切换(操作流程建议)
2022-06-26 15:53:00 【franket】
前言
如果使用的 mha 构建mysql集群,由于各种原因会遇到需要进行迁移的情况
这里分享一下 mha切换 的过程
Tip: 当前版本 MHA Manager 0.56
概要
检查列表
在进行切换之前一定要对数据库状态进行检查,下面是检查列表:
1.所有节点数据库必须正常运行
2.所有备库复制必须指向主库,且复制状态正常(io , sql 进程状态正常)
3.备库上复制状态中 Seconds_Behind_Master 参数不能大于3秒钟
4.当前情况下keepalived工作正常,master获得VIP,候选master上keepalived的运行状态正常,并且优先级比master低
5.数据库上 relay_log_purge 参数都为 off ,否则有潜在的丢失掉relay log 的风险
6.除了主库,其它备库上的 read_only 参数都为 on ,否则有主备数据库不一致的风险
手动切换操作手顺
1.关掉后台切换监控 masterha_stop --conf=/etc/app1.cnf
2.检查数据库运行状态
3.检查数据库参数
4.检查keepalived工作状态,ip挂载情况
5.记录待切slave(候选master)的binlogfile和position(用于之后同步)
6.进行 repl check
7.实施切换
8.状态检查(mysql,keepalived,参数,同步状态)
9.系统维护,数据库维护
10.主备同步(使用之前的不变的slave position)
11.将维护好的数据库加入mha集群
12.检查数据库运行状态
13.检查数据库参数
14.修改keepalived.conf文件,降低优先级,使其不与当前主master争抢ip
15.启动keepalived,检查ip,检查keepalived运行状态
16.记录待切slave(候选master,原master)的binlogfile和position(用于之后同步)
17.进行 repl check
18.实施切换
19.恢复mha架构(参考前面步骤)
20.进行后台mha监控
21.监控观察
命令汇总
masterha_check_ssh --conf=/etc/app1.cnf
masterha_check_status --conf=/etc/app1.cnf
masterha_stop --conf=/etc/app1.cnf
masterha_check_repl --conf=/etc/app1.cnf
nohup masterha_manager --conf=/etc/app1.cnf --ignore_last_failover &
masterha_master_switch --master_state=alive --conf=/etc/app1.cnf --new_master_host=m1 --interactive=0
purge_relay_logs --user=root --password=xxxx --workdir=/data/relay_tmp/
show slave status\G
show master status;
show variables like 'relay_log_purge';
show variables like 'read_only';
原文地址
边栏推荐
- SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
- 3. Keras version model training
- 【思考】在买NFT的时候你在买什么?
- Stepn novice introduction and advanced
- Audio and video learning (II) -- frame rate, code stream and resolution
- R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、分析模型是否过离散(Overdispersion)、使用残差偏差与二项式模型中的剩余自由度的比率评估
- 【leetcode】701. Insert operation in binary search tree
- R language generalized linear model function GLM, GLM function to build logistic regression model, analyze whether the model is over discrete, and use the ratio of residual deviation and residual degr
- 6 自定义层
- C. Inversion Graph
猜你喜欢

简单科普Ethereum的Transaction Input Data

HW safety response

Simple use of tensor

IntelliJ idea -- Method for formatting SQL files

Stepn novice introduction and advanced

El dialog drag and drop, the boundary problem is completely corrected, and the bug of the online version is fixed

Comprehensive analysis of discord security issues

李飞飞团队将ViT用在机器人身上,规划推理最高提速512倍,还cue了何恺明的MAE...

SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)

svg环绕地球动画js特效
随机推荐
『C语言』题集 of ⑩
Audio and video learning (II) -- frame rate, code stream and resolution
Simple use of tensor
还存在过有键盘的kindle?
8 自定义评估函数
【leetcode】48. Rotate image
C. Inversion Graph
R language uses cor function to calculate the correlation matrix for correlation analysis, uses corrgram package to visualize the correlation matrix, reorders rows and columns using principal componen
Solana扩容机制分析(1):牺牲可用性换取高效率的极端尝试 | CatcherVC Research
6 custom layer
若依微服务特殊字符串被过滤的解决办法
9 use of tensorboard
Golang 1.18 go work usage
SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
(DFS search) acwing 2005 horseshoe
零知识 QAP 问题的转化
Handwritten numeral recognition, run your own picture with the saved model
Unlock the value of data fusion! Tencent angel powerfl won the "leading scientific and Technological Achievement Award" at the 2021 digital Expo
Solana扩容机制分析(2):牺牲可用性换取高效率的极端尝试 | CatcherVC Research
简单科普Ethereum的Transaction Input Data