5 构建Mysql+heartbeat+DRBD+LVS集群应用系统系列之生产环境下drbd裂脑处理
2016-12-13 10:18
651 查看
preface
公司的业务变更,导致服务器要搬迁,所以需要关闭服务器,然后到新地在开启服务器。关机前确定drbd+heartbeat+mysql是正常使用的,没有异常,Heartbeat和drbd都是开机自启动的。在服务器搬迁到新地方后,开启服务器,由于当时我没有在场,服务器开机后Heartbeat+drbd都启动了,但是槽糕的是drbd双方没有连接上同步,虽然primary端工作着。此情况是过了几天后才发现的问题。于是开始处理这个问题。
需要申明的是,我这drbd版本是8.4的
查看双方的状态
primary[root@SsoMaster ~]# df -hT #正常挂载使用着 Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 38G 3.6G 32G 11% / tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 ext4 190M 62M 118M 35% /boot /dev/drbd0 ext4 492G 100M 467G 1% /database [root@SsoMaster ~]# drbd-overview # 状态不一致。没有与secondary连接。 0:r0/0 StandAlone Primary/Unknown UpToDate/Outdated /database ext4 492G 100M 467G 1%
Secondary
[root@SsoBackup ~]# service drbd status # 没有与primary端连接 drbd driver loaded OK; device status: version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 m:res cs ro ds p mounted fstype 0:r0 WFConnection Secondary/Unknown UpToDate/Outdated C
开始处理此问题
可以参考官网裂脑处理方法:http://www.drbd.org/en/doc/users-guide-83/s-resolve-split-brainprimary
首先确认为primary
[root@SsoMaster ~]# drbdadm primary r0
Secondary
确认为Secondary
[root@SsoBackup ~]# drbdadm secondary r0 [root@SsoBackup ~]# drbdadm -- --discard-my-data connect r0
primary
[root@SsoMaster ~]# drbdadm connect r0
此时查看drbd状态
primary[root@SsoMaster ~]# cat /proc/drbd version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r----- ns:154160 nr:0 dw:0 dr:154828 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0 [root@SsoMaster ~]# drbd-overview 0:r0/0 Connected Primary/Secondary UpToDate/UpToDate
Secondary
drbd driver loaded OK; device status: version: 8.4.7-1 (api:1/proto:86-101) GIT-hash: 3a6a769340ef93b1ba2792c6461250790795db49 build by mockbuild@Build64R6, 2016-01-12 13:27:11 m:res cs ro ds p mounted fstype 0:r0 StandAlone Secondary/Primary UpToDate/UpToDate r----
OK,drbd可以正常连接工作了。
相关文章推荐
- 1 构建Mysql+heartbeat+DRBD+LVS集群应用系统系列之DRBD的搭建
- 3 构建Mysql+heartbeat+DRBD+LVS集群应用系统系列之heartbeat的搭建
- 2 构建Mysql+heartbeat+DRBD+LVS集群应用系统系列之MySql的搭建
- 4 构建Mysql+heartbeat+DRBD+LVS集群应用系统系列之Lvs为Mysql-slave做负载均衡
- Mysql+Heartbeat+Drbd生产环境高可用部署若干问题解惑
- MySQL+Heartbeat+DRBD构建高可用MySQL环境
- MySQL+Heartbeat+DRBD构建高可用MySQL环境
- Mysql+Heartbeat+Drbd生产环境高可用部署若干问题解惑
- MySQL+Heartbeat+DRBD构建高可用MySQL环境
- heartbeat+DRBD+mysql+LVS集群实战
- Ubuntu构建LVS+Keepalived高可用负载均衡集群【生产环境部署】 推荐
- MySQL+Heartbeat+DRBD构建高可用MySQL环境 推荐
- 集群系列七(基于corosync+pacemaker+drbd的Mysql高可用集群)
- Android系统的应用开发与运行环境构建
- MySQL+Heartbeat+DRBD构建高可用MySQL环境
- heartbeat+drbd+mysql构建mysql高可用群集
- .NET程序员也用JAVA:使用BlazeDS,SpringFramework,MySql,Flex构建RIA应用 part 1 :环境搭建.
- Ubuntu下Mysql+drbd+heartbeat高性能服务集群配置
- heartbeat+ldirector 构建高可用LVS-DR集群
- DRBD+HEARTBEAT+MYSQL高可用的mysql集群