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
- Vim/etc/hosts
- 172.16.9.2 node2.test.com node2
- 172.16.9.3 node3.test.com node3
3. Establish dual-host mutual trust: both nodes must be configured
- Ssh-keygen-t rsa-P ""
- Ssh-copy-id-I/root/. ssh/id_rsa.pub dr2 root @ node3
4. Time Synchronization:
- 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.