DRBD notes: high availability solution for Linux (1)

Source: Internet
Author: User

DRBD is actually a block device implementation and is mainly used in high availability (HA) solutions on the Linux platform. It is composed of kernel modules and related programs. It synchronizes the entire device through network communication, which is somewhat similar to a network RAID function. That is to say, when you write data to a file system on a local DRBD device, the data will be sent to another host on the network at the same time, it is recorded in the same format in a file system. In fact, the creation of a file system is also implemented by the synchronization of DRBD ). Local node host) and remote node host) data can ensure real-time synchronization and IO consistency. Therefore, when the host on the local node fails, the host on the remote node will retain the same data, which can be used for high availability.

Instead of using a shared disk array storage device, you can use the DRBD feature in a high-availability (HA) solution. Because the data is stored on both the local host and remote host, when switching is required, the remote host can continue to provide services by using the backup data above it.

Underlying Device Support

DRBD needs to be built on the underlying device and then build a block device. A drbd device is like a physical disk. You can create a file system in the business pulse. DRBD supports the following underlying devices:

1. a disk, or a partition of the disk;

2. A soft raid device;

3. A logical volume of LVM;

4. An EVMSEnterprise Volume Management System, an Enterprise Volume Management System) Volume;

5. Any other block device.

Configuration Overview

1. global configuration items)

Basically, we can configure whether usage-count is yes or no. The usage-count parameter is only used for linbit to collect the current usage of drbd. When drbd is installed and upgraded, information is sent to the linbit server over http.

2. common public configuration items)

The common here refers to the common between multiple resources managed by drbd. The configuration item mainly configures all resources of drbd and can be set to the same parameter item, such as protocol and syncer.

3. resource Configuration items)

All resources managed by drbd are configured in the resource item, including node ip information, underlying storage device name, device size, meta information storage method, and device name provided by drbd. Each resource must be configured with the information of each node, rather than the information of the current node. In fact, in the entire drbd cluster, the drbd. conf files on each node must be completely consistent.

In addition, resource has many other internal configuration items:

Net: network configuration related content. You can set whether to allow the dual-master allow-two-primaries.

Startup: related settings during startup, such as setting who is primary after startup or both are primary: become-primary-on both)

Syncer: synchronization-related settings. You can set "re-" synchronization re-synchronization) speed rate), or set whether to check data consistency between nodes online. verify-alg detection algorithms include md5, sha1, and crc32 ). Data verification may be important. After enabling the online verification function, we can use the related command drbdadm verify resource_name) to start online verification. During the verification process, drbd records inconsistent blocks between nodes, but does not block any behavior, even the io requests on the inconsistent blocks. When inconsistent blocks occur, drbd requires the re-synchronization action, and the rate item set in syncer is mainly used for re-synchronization, if there is a large amount of inconsistent data, we cannot allocate all the bandwidth to drbd for re-synchronization, which will affect the provision of external services. You also need to consider the impact of IO capability. If we have a gigabit network outlet, but our disk I/O capability is only 50 M per second, then the actual processing capability is only 50 M. Generally, setting up 30% of the bandwidth for the smallest network I/O capability and disk I/O capability to re-synchronization is an official description ). In addition, drbd provides a temporary rate change command to temporarily change the rate value of syncer: drbdsetup/dev/drbd0 syncer-r 100 M. In this way, the speed of re-synchronization is set to 100 MB. However, after re-synchronization, you need to use drbdadm adjust resource_name to let drbd work according to the configured rate.


Related Article

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.