当前位置:网站首页>MHA switching (recommended operation process)
MHA switching (recommended operation process)
2022-06-26 16:06:00 【franket】
Preface
If used mha structure mysql colony , For various reasons, you may encounter the need to migrate
So let's share that mha Switch The process of
Tip: current version MHA Manager 0.56
Summary
Checklist
Be sure to check the database status before switching , Here is a checklist :
1. All node databases must be running properly
2. All standby database replications must point to the primary database , And the replication status is normal (io , sql Process status ok )
3. The standby database is in replication status Seconds_Behind_Master Parameter cannot be greater than 3 Second
4. In the current situation keepalived Work well ,master get VIP, The candidate master On keepalived The operating state of is normal , And priority ratio master low
5. Database relay_log_purge The parameters are off , Otherwise, there will be potential loss relay log The risk of
6. Except the main library , On other standby databases read_only The parameters are on , Otherwise, there is a risk that the primary and standby databases are inconsistent
Manual switching operation manual
1. Turn off the background switch monitoring masterha_stop --conf=/etc/app1.cnf
2. Check the running status of the database
3. Check database parameters
4. Check keepalived Working state ,ip Mounting situation
5. Record to be cut slave( The candidate master) Of binlogfile and position( For subsequent synchronization )
6. Conduct repl check
7. Implement switching
8. Status check (mysql,keepalived, Parameters , sync )
9. system maintenance , Database maintenance
10. Primary backup synchronization ( The same as before slave position)
11. Add the maintained database to mha colony
12. Check the running status of the database
13. Check database parameters
14. modify keepalived.conf file , Lower the priority , Make it different from the current master master Scramble for ip
15. start-up keepalived, Check ip, Check keepalived Running state
16. Record to be cut slave( The candidate master, primary master) Of binlogfile and position( For subsequent synchronization )
17. Conduct repl check
18. Implement switching
19. recovery mha framework ( Refer to the previous steps )
20. Back office mha monitor
21. Monitor and observe
Command summary
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';
Original address
边栏推荐
- 01 backpack DP
- Comprehensive analysis of discord security issues
- R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、分析模型是否过离散(Overdispersion)、使用残差偏差与二项式模型中的剩余自由度的比率评估
- NFT contract basic knowledge explanation
- Stepn débutant et avancé
- Swiftui retrieves the missing list view animation
- Golang temporary object pool optimization
- Big talk Domain Driven Design -- presentation layer and others
- [time complexity and space complexity]
- Selenium chrome disable JS disable pictures
猜你喜欢

How to configure and use the new single line lidar

Solana扩容机制分析(1):牺牲可用性换取高效率的极端尝试 | CatcherVC Research

Big talk Domain Driven Design -- presentation layer and others

NFT Platform Security Guide (2)

js文本滚动分散动画js特效

js创意图标导航菜单切换背景色

C# 读写文件从用户态切到内核态,到底是个什么流程?

IntelliJ idea -- Method for formatting SQL files

9 Tensorboard的使用

手写数字体识别,用保存的模型跑自己的图片
随机推荐
I want to know how to open an account through online stock? Is online account opening safe?
Svg rising Color Bubble animation
How to identify contractual issues
redis的二进制数组命令
Audio and video learning (II) -- frame rate, code stream and resolution
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
如何辨别合约问题
R language plotly visualization: Violin graph, multi category variable violin graph, grouped violin graph, split grouped violin graph, two groups of data in each violin graph, each group accounts for
Selenium chrome disable JS disable pictures
Stepn débutant et avancé
Practice of federal learning in Tencent micro vision advertising
Solana capacity expansion mechanism analysis (1): an extreme attempt to sacrifice availability for efficiency | catchervc research
Tweenmax+svg switch color animation scene
10 tf. data
El dialog drag and drop, the boundary problem is completely corrected, and the bug of the online version is fixed
3 keras版本模型训练
8 user defined evaluation function
[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long
1 张量的简单使用
『C语言』题集 of ⑩