MySQL双主高可用配置方法解析


下文内容主要给大家带来MySQL双主高可用配置方法解析,这里所讲到的知识,与书籍略有不同,都是开发云专业技术人员在与用户接触过程中,总结出来的,具有一定的经验分享价值,希望给广大读者带来帮助。一、在两台云服务器上分别安装MySQL实例Mysql01:192.168.0.207Mysql02:192.168.0.208vip1:192.168.0.211vip2:192.168.0.212(略)二、在两台服务器上配置主主复制GRANT REPLICATION SLAVE ON *.* TO ‘dba_repl’@’192.168.0.%’ IDENTIFIED BY ‘123456’;change master to MASTER_HOST=’192.168.0.207′, MASTER_USER=’dba_repl’, MASTER_PASSWORD =’123456′, MASTER_LOG_FILE = ‘mysql-bin.000003’, MASTER_LOG_POS = 120;三、配置keepalived,这个方案的关键点在于keepalived的配制,两个vrrp_instance在两个主上的优先级相反。MySQL01:global_defs {# Keepalived process identifierlvs_id MySQL_HA}# Script used to check if Proxy is runningvrrp_script check_proxy {script “killall -0 mysql”interval 2weight 3}# Virtual interface 1# The priority specifies the order in which the assigned interface to take over in a failovervrrp_instance VI_01 {state MASTERinterface eth0virtual_router_id 51priority 100# The virtual ip address shared between the two loadbalancersvirtual_ipaddress {192.168.0.211 dev eth0}track_script {check_proxy}}# Virtual interface 2# The priority specifies the order in which the assigned interface to take开发云主机域名 over in a failovervrrp_instance VI_02 {state MASTERinterface eth0virtual_router_id 52priority 102# The virtual ip address shared between the two loadbalancersvirtual_ipaddress {192.168.0.212 dev eth0}track_script {check_proxy}}主二:global_defs {# Keepalived process identifierlvs_id MySQL_HA}# Script used to check if Proxy is runningvrrp_script check_proxy {script “killall -0 mysql”interval 2weight 3}# Virtual interface 1# The priority specifies the order in which the assigned interface to take over in a failovervrrp_instance VI_01 {state MASTERinterface eth0virtual_router_id 51priority 102# The virtual ip address shared between the two loadbalancersvirtual_ipaddress {10.103.9.211 dev eth0}track_script {check_proxy}}# Virtual interface 2# The priority specifies the order in which the assigned interface to take over in a failovervrrp_instance VI_02 {state MASTERinterface eth0virtual_router_id 52priority 100# The virtual ip address shared between the two loadbalancersvirtual_ipaddress {192.168.0.212 dev eth0}track_script {check_proxy}}对于以上关于MySQL双主高可用配置方法解析,如果大家还有更多需要了解的可以持续关注我们开发云的行业推新,如需获取专业解答,可在官网联系售前售后的,希望该文章可给大家带来一定的知识更新。

相关推荐: CSS-T | Mysql Client 任意文件读取攻击链拓展

作者:LoRexxar@知道创宇404实验室 & Dawu@知道创宇404实验室 原文地址: https://paper.seebug.org/1112/ 英文版本: https://paper.seebug.org/1113/这应该是一个很早以前就爆…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

Like (0)
Donate 微信扫一扫 微信扫一扫
Previous 06/07 16:00
Next 06/07 16:00

相关推荐