11

Mysql + DRBD + Heartbeat(v1)基本配置笔记及切换测试

测试都是基于Heartbeat v1 style的设置情况下所作,由于v1 style配置的heartbeat没办法做到对资源状态的监控,
主要职能通过监控与对方节点以及集群对外的网络状况的监控,而v2 style的配置已经提控了对资源状态的监控,所以后面准备再
针对v2 style的heartbeat进行详细一点的测试。不过,在linux-ha网站上面发现有一个声明,说drbd的作者建议用户继续
使用v1 style来让heartbeat管理drbd资源(http://www.linux-ha.org/DRBD/HowTov2),详细的原因并没有说明。

继续阅读全文

06

Mysql测试:DRBD+Mysql 高可用方案设置测试

几个注意点:

1、除了primary节点的文件系统是手工创建的之外,其他的所有secondary节点的文件系统都是通过同步完成的,两边的设备大小好像并不要求完全一样的大小,在我测试的过程中,两边用于drbd设备的分区大小相差很大,但好像并没有出现错误,从drbd相关文档上看到这个并不会导致问题。但是如果主节点比备节点大,而且用的空间也超出了备节点空间大小会有问题,具体会怎样还没有测试到。

2、在mount drbd的设备之前,该节点必须已经设置为primary模式,而且如果一边没有umount,另一边是无法mount上的,直接mount会报如下错误:

root@mysql2:/>mount /dev/drbd0 /drbddata
mount: block device /dev/drbd0 is write-protected, mounting read-only

也就是说,在同步的过程中,只有一个节点的数据可见,也就是不能通过我们人直接简单的查看数据文件等方式之间验证数据是否正常。不过看文档说好像可以通过手动设置一些信息来查看是否正常(You can manually set this information for a number of reasons, including when you want to check the physical status of the secondary device (since you cannot mount a DRBD device in primary mode), or when you are temporarily moving the responsibility of keeping the data in check to a different machine (for example, during an upgrade or physical move of the normal primary node). )。

继续阅读全文