Recently prepared to update the point load balanced high availability of documents, so the previous DRBD have been trying to conquer the time to take out today.
DRBD (distributed replicated block Device) We can understand that it is actually a network RAID-1, between two servers even if a power outage or downtime will not have any impact on the data, And the real earnest exchange can be solved through heartbeat solution, no need human intervention.
For example: Drbd+heartbeat+mysql is a master-slave structure separation, as a Drbd+heartbeat+nfs backup storage solution.
--------------------don't say much nonsense, open---------------------------
System version: centos6.3 x64 (kernel 2.6.32)
drbd:drbd-8.4.3
node1:192.168.7.88 (drbd1.example.com)
node2:192.168.7.89 (drbd2.example.com)
(NODE1) is configured for the primary node only
(NODE2) is configured from node only
(NODE1,NODE2) Common Configuration from node
I. Preparation environment: (NODE1,NODE2)
1. Close iptables and SELinux to avoid error during installation.
# Service Iptables Stop
# Setenforce 0
# Vi/etc/sysconfig/selinux
---------------
Selinux=disabled
---------------
2. Set up Hosts file
# vi/etc/hosts
-----------------
192.168.7.88 drbd1.example.com DRBD1
192.168.7.89 drbd2.example.com Drbd2
-----------------
3. Add a 2G hard disk SDB to the two virtual machines as DRBD, partition to SDB1, size 1G, and create/data directory on the local system without mount operation.
# FDISK/DEV/SDB
----------------
N-p-1-1-"+1G"-W
----------------
# Mkdir/data
4. Time synchronization: (important)
# Ntpdate-u Asia.pool.ntp.org
5. Change host Name:
(Node1)
# vi/etc/sysconfig/network
----------------
Hostname=server.example.com
----------------
(Node2)
# vi/etc/sysconfig/network
----------------
Hostname=client.example.com
----------------