当前位置:网站首页>MGR_ mysqlsh_ Keepalive high availability architecture deployment document
MGR_ mysqlsh_ Keepalive high availability architecture deployment document
2022-07-24 06:50:00 【Ink Sky Wheel】
1. Architecture node description
MGR Single master mode 192.168.17.135( Lord ) 192.168.17.136( from ), 192.168.17.137( from )
Mysql router( Lord ) 192.168.17.136:6446 Is a read-write node
Mysql router( Lord ) 192.168.17.136:6447 Is a read-only node
Mysql router ( To prepare ) 192.168.17.137:6446 Is a read-write node
Mysql router ( To prepare ) 192.168.17.137:6447 Is a read-only node
Keepalive 192.168.17.150:6446 Read / write nodes connected for applications
Keepalive 192.168.17.150:6447 Read only nodes connected for applications
2. install mgr5.7
https://www.modb.pro/db/105831
3.Mysql-shell
Upload mysql-shell 8.0, And run mysql-shell, perform cluster = dba.createCluster(“myCluster”)
establish , perform cluster.status() View the cluster status 
When looking at the current cluster status , You can see mgrdb1:3306 Is a read-write node 
4.mysql-router
192.168.17.136 Dominant mysql-router, use bootstrap Parameters automatically build configuration files and startup scripts 
Modify or add parameters , modify mysqlrouter.conf file 
start-up mysql-router
[[email protected] myrouter]# ./start.sh
[[email protected] myrouter]# PID 99090 written to ‘/tmp/myrouter/mysqlrouter.pid’
5. Deploy standby mysql-router
scp Master mysql-router Profile to 192.168.17.137
[[email protected] ~]# scp -r [email protected]:/root/mysql_router .
[email protected]’s password:
mysqlrouter.1 100% 42KB 16.3MB/s 00:00
…
6.keepalive
install keepalive(136 and 137 All need to be installed )
[[email protected] myrouter]# yum install -y keepalived
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
- base: mirrors.aliyun.com
…
Dependency Updated:
ipset.x86_64 0:7.1-1.el7 ipset-libs.x86_64 0:7.1-1.el7
Complete!
6.1 modify keepalive Configuration parameters
[[email protected] keepalived]# cat keepalived.conf
global_defs {
router_id Myrouter-HA
}
vrrp_script check_run {
script “/etc/keepalived/Myrouter_check.sh”
interval 30
}
vrrp_sync_group VG1 {
group {
VI_1
}
}
vrrp_instance VI_1 {
state BACKUP
interface ens33
virtual_router_id 51
priority 100
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass 1234
}
track_script {
check_run
}
virtual_ipaddress { 192.168.17.150}}
[[email protected] keepalived]# cat Myrouter_check.sh
#!/bin/bash
#1 . Check myrouter Whether the process is abnormal
myrouter_cnt=netstat -tlnp|grep 6446 |grep mysqlrouter|wc -l
if [ $myrouter_cnt -lt 1 ]
then
systemctl stop keepalived
/sbin/arping -I ens33 -c 5 -s 192.168.17.150 192.168.17.2 &>/dev/null
exit 0
fi
6.2 start-up keepalive
systemctl start keepalived.service
7. Verification test
7.1 verification down A node , Fail over
The current master node is mgrdb1
adopt vip Connect , View the current connection node 
Turn off the master node mgrdb1
kill -9 pidof mysqld
mgr It will automatically reselect the master . The Lord became mgrdb2
adopt vip Connect , View the current connection node 
Nodes are automatically transferred to mgrdb2, Indicates that the failover was successful .
7.2 verification mysqlroter Fail over
VIP Host computer mgrdb2 On .
simulation mysqlrouter down machine 
Check the standby VIP, Standby machine VIP Started successfully 
see VIP Connect , Successful connection , And connected to the read-write node mgrdb2
边栏推荐
- Process and planned task management
- Random forest, lgbm parameter adjustment based on Bayesian Optimization
- Identification of Chinese medicinal materials
- Why can't index be the key of V-for?
- kubernetes急速安装
- Depth first search (template use)
- 我有 7种 实现web实时消息推送的方案,7种!
- STM32基于 FatFs R0.14b&SD Card 的MP3音乐播放器(也算是FatFs的简单应用了吧)
- [lvgl (4)] event and event bubble of the object
- Breadth first search (template use)
猜你喜欢

Special effects - click the mouse and the randomly set text will appear

Redis分布式缓存学习笔记

Sort by an attribute value of an object in the array

STM32基于 FatFs R0.14b&SD Card 的MP3音乐播放器(也算是FatFs的简单应用了吧)
![[lvgl (2)]](/img/f8/d04183cf74896295382765a9dfd88d.png)
[lvgl (2)]

Secondary processing of template data

GE口:SGMII模式和serdes模式

MapReduce (I)

Jenkins CI CD

Learn more about when to use MySQL two locks (table lock and row lock)
随机推荐
adb交互-干掉难看的默认shell界面
MapReduce (I)
JSONObject按照key的A——Z顺序排序
【LVGL(1)】LVGL的简单介绍
JS - mouse and keyboard configuration and browser forbidden operation
类的加载器 和 双亲委派机制详解
安装snownlp包过程出现Requirement already satisfied:及Read timed out.问题解决方法
Introduction, architecture and principle of kubernetes
Detailed explanation of class loader and parental delegation mechanism
Special effects - cobweb background effects
深入了解MySQL 两把锁啥时候用(表锁,行锁)
Jenkins CI CD
Explain the event cycle mechanism and differences between browser and node in detail
【LVGL(6)】显示中文设置,制作中文字库
Redis.conf详解
我有 7种 实现web实时消息推送的方案,7种!
[small object velocimeter] only principle, no code
mysql获取自增行标(区别mysql版本)
Redis分布式缓存学习笔记
Disk management and file system