MySQL disk replication technology-drbd: Comparison of advantages and disadvantages, precautions and best practices

Source: Internet
Author: User
DrbdIt is the block-level synchronous replication technology implemented by the kernel module. The synchronization level here can be adjusted.
Because drbd uses the network card for block replication. If InfiniBand is used for transmission, high concurrency can be effectively processed.
This is a type of replication and storage. It is nothing more like a hot standby machine, rather than a storage ha, it is better to ensure data security.
The industrial environment is more used on NFS servers and combined with Linux-ha projects, such as packmaker and heartbeat.


Many people talk about the split-brain problem of drbd, Which is color-changing. Once used, it will be known that split-brain is not so easy to happen.
Drbd does not set automatic start, manual start during restart, and split-brain occurs rarely.
At work, drbd is basically not restarted, and the server is not restarted. Basically, there is no split-brain problem.



(I) Comparison of advantages and disadvantages


Advantages

① No spof risk exposure
② No common faults of cluster software, such as split-brain


Disadvantages

(1) A waste of resources

The standby machine of drbd cannot provide read at present, which wastes resources.
We all know that the MySQL servers in the production environment are top-configured. It is a pity that a machine is wasted online.

(2) drbd cannot replace backup

Drbd may cause bad data, no matter what ha, data backup must be available, no backup, the entire ha is paralyzed, you are also stunned, pop-up

(3) failover cannot be performed within seconds

(4) not very useful for MyISAM tables

In fact, any system that expects high availability and MyISAM won't be a choice because
MyISAM crash recovery requires a lot of time to repair and data loss.

Adding write operation burden

Set InnoDB to innodb_flush_log_at_trx_commit = 1
As a result, many small writes and fsync () calls, and synchronization with drbd will be slow.



(Ii) Considerations


① Select the drbd and Linux-ha versions
② Drbd uses a dedicated Nic
③ The heartbeat network and VIP service network are separated.
④ Iptables releases the drbd and Linux-ha ports for the heartbeat network, and enables the corresponding ports for the VIP according to the application.
⑤ Monitor the status of drbd and Linux-ha, and make scripts, automatic detection, and issue alarms.
⑥ Generally, there are traffic monitoring systems (MRTG, cacti, etc.) and regular checks on the server load and traffic



(Iii) Best practices

Drbd only copies the device that stores the BINLOG, if,
Active Node failure. You can enable a log server on a passive node.
Then, apply the BINLOG to all devices that have failed the master database.
You can upgrade one of the slave databases to the master database to replace the invalid system.



For more information, see drbd.org.


By David Lin
2013-05-31
Good luck
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.