Here first of all thank the wine brother to build a highly available Linux server This book, read this book and reference inside the configuration let oneself to drbd+heartbeat+nfs thinking clearly a lot.
DRBD is simply a network raid-1, generally has 2 to multiple node nodes, the disk blocks created by each node will map to the local DRBD block, and then through the network to each node DRBD disk blocks synchronized updates.
The role of heartbeat can increase the availability of DRBD, it can automatically switch the DRBD block to the backup node after a node failure, and automatically make virtual IP from the new binding, DRBD block, disk mount and start NFS script operations, this series of operations because only in his back-end node, The front-end user accesses the heartbeat virtual IP, so there is no perception of the user.
Finally spit trough, Yum installed true pit Dad, later if not necessary, as far as possible source package installation.
System version: centos6.3 x64 (kernel 2.6.32)
drbd:drbd-8.4.3
Heartbeat:epel update source (real pit)
NFS: System self-belt
HeartBeat vip:192.168.7.90
Node1 drbd+heartbeat:192.168.7.88 (drbd1.example.com)
Node2 drbd+heartbeat:192.168.7.89 (drbd2.example.com)
(NODE1) is configured for the primary node only
(NODE2) is configured only from the node end
(NODE1,NODE2) need to be configured primarily from the node
I. DRBD configuration, Portal: http://showerlee.blog.51cto.com/2047005/1211963
Two. Hearbeat configuration;
Here we go. DRBD system environment and installation configuration:
1. Installation Heartbeat (CentOS6.3 in the default without heartbeat package, so need to download from a third party) (NODE1,NODE2)
# wget ftp://mirror.switch.ch/pool/1/mirror/scientificlinux/6rolling/i386/os/Packages/epel-release-6-5.noarch.rpm
# Rpm-ivuh epel-release-6-5.noarch.rpm
# Yum--enablerepo=epel Install Heartbeat-y
2. Configure Heartbeat
(Node1)
# VI/ETC/HA.D/HA.CF
---------------
# log
Logfile/var/log/ha-log
Logfacility local0
# Heartbeat Monitoring Time
KeepAlive 2
# Time of Death
Deadtime 5
# Specify each other's IP:
Ucast eth0 192.168.7.89
# when the server is normal, the primary server takes over the resource and the other server discards the resource
Auto_failback off
#定义节点
Node drbd1.example.com drbd2.example.com
---------------
(Node2)
# VI/ETC/HA.D/HA.CF
---------------
# log
Logfile/var/log/ha-log
Logfacility local0