DRBD notes: high availability solution on Linux

Source: Internet
Author: User
Article Title: DRBD notes: high availability solution for Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

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 a file system in the same form (in fact, the creation of a file system is also implemented by the synchronization of DRBD ). Data on the local node (host) and remote node (host) can be synchronized in real time, and IO consistency can be ensured. 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 EVMS (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)

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)

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 dual-master nodes (allow-two-primaries.

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

Syncer: synchronization-related settings. You can set the re-synchronization speed (rate), or set whether to check data consistency between nodes online (the verify-alg detection algorithm has md5, sha1 and crc32 ). Data verification may be an important task. After the online verification function is enabled, we can use the related commands (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, it is more appropriate to set the bandwidth of the minimum network I/O capability and disk I/O capability to re-synchronization (official note ). 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.

[1] [2] [3] [4] Next page

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.