当前位置:网站首页>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
边栏推荐
- svg上升的彩色气泡动画
- Selenium chrome disable JS disable pictures
- (DFS search) acwing 2005 horseshoe
- Tencent Peking University's sparse large model training acceleration program het was selected into the VLDB of the international summit
- NFT Platform Security Guide (1)
- NFT transaction principle analysis (2)
- [thinking] what were you buying when you bought NFT?
- Anaconda3安装tensorflow 2.0版本cpu和gpu安装,Win10系统
- 『C语言』题集 of ⑩
- 5000 word analysis: the way of container security attack and defense in actual combat scenarios
猜你喜欢

神经网络“炼丹炉”内部构造长啥样?牛津大学博士小姐姐用论文解读

Reflection modification final

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

Handwritten numeral recognition, run your own picture with the saved model

若依如何实现接口限流?

(1) Keras handwritten numeral recognition and recognition of self written numbers

5000 word analysis: the way of container security attack and defense in actual combat scenarios

canvas三个圆点闪烁动画

Stepn novice introduction and advanced

「幹貨」NFT 上中下遊產業鏈全景分析
随机推荐
4 custom model training
10 tf. data
Stepn novice introduction and advanced
Keepalived 实现 Redis AutoFailover (RedisHA)
【蓝桥杯集训100题】scratch辨别质数合数 蓝桥杯scratch比赛专项预测编程题 集训模拟练习题第15题
canvas三个圆点闪烁动画
What is the process of switching C # read / write files from user mode to kernel mode?
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
STEPN 新手入门及进阶
Golang temporary object pool optimization
I want to know how to open an account through online stock? Is online account opening safe?
Reflection modification final
NFT 平台安全指南(1)
油田勘探问题
LeetCode 单周赛298,前三题
Simple use of tensor
Unlock the value of data fusion! Tencent angel powerfl won the "leading scientific and Technological Achievement Award" at the 2021 digital Expo
JS creative icon navigation menu switch background color
我想知道如何通过线上股票开户?在线开户安全么?
全面解析Discord安全问题