当前位置:网站首页>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
边栏推荐
猜你喜欢

IntelliJ idea -- Method for formatting SQL files

Development, deployment and online process of NFT project (2)

Svg animation around the earth JS special effects

Net基于girdview控件实现删除与编辑行数据

JVM notes

"C language" question set of ⑩

NFT合约基础知识讲解

PCIe Capabilities List

SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)

Handwritten numeral recognition, run your own picture with the saved model
随机推荐
Selenium chrome disable JS disable pictures
TweenMax+SVG切换颜色动画场景
NFT 平台安全指南(2)
Everyone is a scientist free gas experience Mint love crash
NFT 平台安全指南(1)
10 tf.data
牛客小白月赛50
Unlock the value of data fusion! Tencent angel powerfl won the "leading scientific and Technological Achievement Award" at the 2021 digital Expo
Angel 3.2.0 new version released! Figure the computing power is strengthened again
Quickly get started with federal learning -- the practice of Tencent's self-developed federal learning platform powerfl
全面解析Discord安全问题
NFT Platform Security Guide (1)
svg上升的彩色气泡动画
How to identify contractual issues
请指教同花顺软件究竟是什么?网上开户是否安全么?
Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law
NFT 项目的开发、部署、上线的流程(2)
Transaction input data of Ethereum
Lifeifei's team applied vit to the robot, increased the maximum speed of planning reasoning by 512 times, and also cued hekaiming's Mae
「干货」NFT 上中下游产业链全景分析