This paper centos6.0 system:
Using DRBD mirroring technology to achieve data synchronization between two servers in the background, the use of heartbeat to achieve automatic switching, open NFS to provide file services
node1:192.168.182.132
node2:192.168.182.128
vip:192.168.182.200
1. Configure hosts, install DRBD, Heartbeat, NFS
1>, Node1, Node2:
Vim hosts
192.168.182.132 Node1
192.168.182.128 Node2
2>, DRBD:
Yum-y Install gcc kernel-devel kernel-headers Flex libnet
Tar zxvf drbd-8.4.3.tar.gz
CD drbd-8.4.3
./configure--PREFIX=/USR/LOCAL/DRBD--with-km
Make kdir=/usr/src/kernels/2.6.32-71.el6.i686/
Make install
Mkdir-p/USR/LOCAL/DRBD/VAR/RUN/DRBD
Cp/usr/local/drbd/etc/rc.d/init.d/drbd/etc/rc.d/init.d
Chkconfig--add DRBD
Chkconfig DRBD on
CD DRBD
CP drbd.ko/lib/modules/' uname-r '/kernel/lib/
Depmod
Modprobe DRBD
Cd/usr/local/drbd/etc/drbd.d
MV Global_common.conf Global_common.conf.bak
Vim global_common.conf
Global {
Usage-count Yes; #是否参加DRBD使用者统计, default Yes
}
Common {
NET {
Protocol C; #使用drbd的第三种同步协议, indicates that write completion is considered after receiving a write acknowledgement from the remote host.
}
}