High Availability of MySQL based on DRBD

Source: Internet
Author: User

DRBD: distributed replication block Device

DRBD --- Distributed Replicated Block Device is a Linux-based software component composed of kernel modules and related programs. It facilitates replacement of shared storage systems through network images. 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. The working principle of DRBD: Below we use DRBD to achieve the high availability of MySQL target environment: Red Hat Enterprise Linux Server release 5.8 Node 1: 172.16.9.2node2.test.com Node 2: 172.16.9.3node3.test.com configuration process: i. Prerequisites for configuring High Availability 1. The host name and 'uname-n' are consistent. Node2: sed-I's @ \ (HOSTNAME = \). * @ \ 1node2.test.com @ g'hostname node2.test.com Node3: sed-I's @ \ (hostname = \). * @ \ 1node3.test.com @ g'hostname node3.test.com 2. Both parties can resolve each other's host names: both nodes must be configured
  1. Vim/etc/hosts
  2. 172.16.9.2 node2.test.com node2
  3. 172.16.9.3 node3.test.com node3
3. Establish dual-host mutual trust: both nodes must be configured
  1. Ssh-keygen-t rsa-P ""
  2. Ssh-copy-id-I/root/. ssh/id_rsa.pub dr2 root @ node3
4. Time Synchronization:
  1. Date '2013'; ssh node3 'date 100'
5. Create a disk partition on two nodes for later use (the collective steps are not provided here). Note: The disk partition size of the two nodes must be consistent.
  • 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.