DRBD installation Configuration

Source: Internet
Author: User
Tags inotify rsync

I. Introduction of DRBD

Distributed replicated block Device (DRBD) is software that synchronizes and mirrors data between different highly available servers based on block devices, which enables two servers in the network based on the block device level real-time or asynchronous mirroring or synchronous replication , in fact, is similar to the architecture project software such as Rsync+inotify. Only DRBD is based on the underlying file system, block-level synchronization, and rsync+inotify is the actual physical file on top of the file system synchronization, therefore, DRBC more efficient, better results.

Tip: The block device you refer to can be a disk partition, an LVM logical volume, or an entire disk. Equivalent to RAID1 functionality (suitable for multi-small file synchronization), but DRBC synchronization cannot be based on a directory.

Ii. working principle of DRBD

1. Schematic diagram

2. Three modes of DRBD synchronization

DRBD has both real-time and asynchronous synchronous modes:

  1) Real-time sync mode:

Successful writes are not returned until the data is written to both the local disk and the remote server disk. The protocol C level of the DRBD service is this real-time synchronization pattern that prevents local and remote data loss and inconsistency, which is the most common pattern in a production environment.

  2) Asynchronous Synchronous mode:

When the data is written to the local server, a successful write is returned, regardless of whether the server is writing successfully.

For example: When the data is written to the local server and sent to the local TCP Buufer after the successful write is returned, this is the protocol A-level operating mode of the DRBC service, when the data is written to the local server and sent to the remote node, the successful write is returned, which is the protocol B-level operating mode of the DRBC service

3, DRBC Two-node access

 1) General Princess node can provide business access

The standby node does not provide data access, but the DRBD service is normal and the data is synchronized in real time, but not the corresponding devices and partitions, that is, unable to provide services at the same time. This is determined by the characteristics of the file system.

  2) How can I make the standby node also provide business access?

Special file systems such as GFS,OCFS2 can implement the main master mode, or by mounting to LVM.

4, DRBC Common Application Mode

  Single main mode : The main standby mode, which is a typical high-availability clustering scheme with data synchronization.

  Complex Master mode : Requires a shared cluster file system, such as GFS and OCFS2, for applications requiring concurrent access to data from 2 nodes, requiring special configuration.

5. DRBD Cleft Brain

When there is a transient failure in the heartbeat line, it causes both sides to ascend to primary. When the two ends are connected again, this situation needs to be handled manually.

DRBD provides two ways to handle the split brain:

1) Automatic Processing method:/etc/drbd.conf

2) Manual Handling method

Iii. installation of DRBD

1. Environment preparation

1) Two virtual machines, each with three NICs .

External network: Eth0

Intranet: Eth1

Data transmission heartbeat Line: ETH3

2) Add two disks of equal size and partition separately

3) virtual machine for dbrd_01,drbd_02 do the following actions

DRBD_01:

A) Add the host name that hosts point to each other

b) Add route, go to drbd_02 host's heart jumper card Eth3

c) Format the disk, divided into two zones, a storage data, a meta data for DRBD, which remembers that the file system could not be created and stored by DRBD automatically processing the corresponding file system.

d) format the partition where the data is stored and mount it.

Drbd_0-2:

Operation with DRBD_01

Cond............

DRBD installation Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.