Operation thinking: Through the DRBD to achieve data synchronization, through the Corosync+pacemaker (hereinafter referred to as CP) to detect failures and transfer, only one of the normal state of work, the other only to detect and synchronize data, when there is a failure, Server2 automatically take over all business, and synchronizing the data to another (of course, it doesn't have to sync successfully at this point ...). This is illustrated below:
Operating Environment:
rhel5.8 (CD yum source)
192.168.88.20 demo1.mos.com Demo1
192.168.88.21 demo1.mos.com Demo2
Kernel: 2.6.18-308.el5pae
Check the SELinux shutdown
Check the iptables empty
If no special instructions, the author is in Demo1 (192.168.88.20) operation
The required package, the author directly packaged into the network disk:
MD5 check: 6ac5ae5b40a1021e1fcc3ce6d372a6a7
http://pan.baidu.com/share/link?shareid=131508&uk=1678158691
The first step: Set the experimental environment (time synchronization, dual-machine trust, hosts resolution)
1. The Demo1 (192.168.88.21) operation is as follows:
# Ssh-keygen (a few returns)
# Cd/root/.ssh
cat id_rsa.pub >> authorized_keys
# > Known_hosts
# SCP * 192.168.88.21:/root/.ssh/(enter its password)
# vim/etc/hosts
192.168.88.20 demo1.mos.com demo1
192.168.88.21 demo1.mos.com Demo2
# scp/etc/hosts demo2:/etc
# vim/etc/sysconfig/network (modified to Demo2 on Demo2)
Networking=yes
hostname=demo1.mos.com
2. Time sync, 11281050 equals November 28 10:50
# ssh Demo2 ' date 11281050 '; Date 11281050
Step Two: Install the configuration DRBD
DRBD (distributed replicated block Device), similar to iSCSI, is chunk-level sharing and cannot detect whether the file system is normal or crashes, but by default in master-slave mode, only the device that allows the main service can be manipulated, The device receives only all data changes from the primary device, cannot be manipulated by the program, or even read.
When one of its owners fails, the highly available cluster software quickly switches master and subordinate roles to achieve fast failover. Its core functionality is implemented through the Linux kernel.
1. Download and install the required packages
# mkdir Pv/root/download the author software directory
# Cd/root/download
# tar XF all.tar.gz above links inside packages
# yum-y--nogpgcheck Localinstall *.rpm
In fact, DRBD only need two of them containing DRBD name of the package, but the next few steps will need to install, if the previous installation has been openais need to delete, command: Yum remove openais-y
More Wonderful content: http://www.bianceng.cn/Servers/web/