Introduction to DRBD Services

Source: Internet
Author: User
Tags inotify

Drdb Introduction:


Data synchronization between high-availability servers

Distributed replicated Block Divice (DRDB)

software based on block devices synchronizing and mirroring data between different high-availability servers enables real-time or asynchronous mirroring or synchronous replication between two servers in a network based on block device level .

Similar to Rsync+inotify (Sersync).

The difference is that DRDB is based on the underlying file system, which is the block level, and inotify is the actual physical file on top of the file system, so DRDB is more efficient!

Tips: The block devices mentioned above can be disk partitions, LVM logical volumes, or entire disks, and DRDB synchronization cannot be based on the directory
Official website:
http://www.drdb.org


Drdb Working principle:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/57/wKioL1WZ9VTTLTtBAAHwjcIWm3w896.jpg "title=" 2{ohjh {q$hzy7mcd%qyg{c0.png "border=" 0 "height=" 359 "hspace=" 0 "vspace=" 0 "width=" 618 "alt=" Wkiol1wz9vttlttbaahwjciwm3w896.jpg "style=" float:left;width:618px;height:359px; "/>

Official description:

refers to block devices designed as a Building block to form high availability (HA) clusters. This is do by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.

in the illustration above, the "orange boxes represent", the "the" and "the" the "form an HA servers Ster. The boxes contain the usual components of a Linux kernel:file system, buffer cache, disk scheduler, disk drivers, TCP/IP Stack and network interface card (NIC) driver. The black arrows illustrate the flow of data between these components.

the orange arrows show the flow of data, as DRBD mirrors the data of a highly available s Ervice from the active node of the HA cluster to the standby node of the HA cluster.

Baidu Translation:

Refers to a block device designed as a building block to form a high-availability (hectare) cluster. This is done through a complete block of devices through an assigned network. DRBD can be understood as a network-based RAID-1.

In the illustration above, these two orange boxes represent a clustered server. There's a Linux kernel in the box. Common components: File system, cache, disk scheduler, disk drives, TCP/IP stack, and network interface card (NIC) drivers. The black arrows illustrate the flow of data between these components.

The orange arrows represent data streams, such as the high availability of the DRBD mirror for the data from the HA cluster's active node to the standby node of the HA cluster.


Synchronization mode for Drdb
Real-time Sync mode Only when the data is written to the local disk and the remote server disk succeeds does the regret write successfully. The protocol C level of the DRDB service is this synchronization mode, which prevents local and remote data loss and inconsistency, which is the most common pattern in the production process.
Asynchronous synchronous mode

When the data is written to the local server, the successful write is reversed, regardless of whether the remote server writes successfully;

For example, when the data is written to the local server and sent to the local TCP Buufer successfully, this is the Drdb A-level operation mode, when the data is written to the local server and sent to the remote node, the successful write is returned, which is the B-level operating mode of the DRDB service protocol

Tips:

1,NFS Network File system also has similar functions and parameters. For example, the configuration parameters of the NFS server sync and async,mount mount parameters sync and ASYNC2, use DRDB without special requirements, direct partition below, do not use LVM or other devices, can affect performance.

3, high concurrency of the business, the data is relatively large. Consider the risk of data loss when using the A-B protocol mode for synchronization. You can use a battery-powered hard drive controller to improve the security of your data writes while maintaining performance.

Drdb's access situation:

website Address: http://drbd.linbit.com/home/mirroring

Drdb Two-node, generally only the primary node provides business access, the standby node can not provide data access, but the standby node of the Drdb service is normal, the data will be kept in real-time synchronization, but can not mount the corresponding device and partition, that is not able to provide services at the same time.

Tips:

1, this is not drdb itself shortcomings, is due to the file system ext3, Ext4 .... The characteristics of the file system determine that DRDB cannot be changed.

2, you can use the LVM snapshot or gfs,ocfs2 shared file system (multi-point mount) to enable the DRDB node to provide services.


Production and application Mode of DRDB
Single main mode (common) The main standby mode, which is a typical high-availability cluster solution with data synchronization
Complex Master Mode You need to use a shared cluster file system, such as GFs \OCFS2. For data situations that require concurrent access from 2 nodes, special configuration is required.

Split Brain DRDB split Brain:

Description: Beware of transient failure of the jump link, which can cause both ends to be promoted to primary.

Automatic Processing:/etc/drdb.conf

net{

#net: Network configuration related content, you can set whether to allow dual master nodes (Allow-two-primaries) and so on.

        AFTER-SB-0PRI disconnect;

        After-sb-1pri Disconnect;     

        It-conflict disconnect

}

Manual mode

from server operation :

Drdbadm secondary data

Drdbadm--discard-my-data Connect data discards the local update connection

Master server Operations:

View status via Cat/proc/drdb, if not wfconnection status, manual connection required

Drdb Connect Data

# The data here is a resource resource for DRDB, which can be understood as a synchronous instance.

Other information

http://drbd.linbit.com/home/feature-list/
http://drbd.linbit.com/home/roadmap/

The DRBD User ' s Guide

http://drbd.linbit.com/users-guide-8.4/













This article from "thinking More than technology" blog, declined reprint!

Introduction to DRBD Services

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.