Use drbd for Real-time Data Backup

Source: Internet
Author: User


Using drbd for real-time data backup this article is not suitable for use in the production environment. The key lies in a simple understanding of the configuration and working methods of drbd. In this example
Data is stored on two servers and will not be automatically switched when one of them fails (although in some cases there is a fault
Drbd automatically switches. For example, the drbd disk of a host is faulty, but this mechanism is not enough to meet the requirements of the production environment.
Requirements for high availability). In the production environment, it is necessary to automatically switch the cooperation of faulty software to achieve high availability.
Www.2cto.com server Build Environment: Master (server1): eth0: 192.168.10.10 CentOS 5.8 + drbd slave (server2): eth0: 192.168.10.20 CentOS 5.8 + drbd Add a new disk each: the software packages below/dev/sdb need to be downloaded, saved to/home/share/, and decompressed:
Http://dl.vmall.com/c05jz4birn
1. Configure the master server and slave server (Steps 1 ~ below ~ 7 ): 1. Install cd/home/share/rpm-ivh drbd83-8.3.13-2.el5.centos.i386.rpm rpm-ivh kmod-drbd83-8.3.13-1.el5.centos.i686.rpm 2. Load and check whether the drbd module is loaded modprobe drbdlsmod | grep drbd 3. Edit the configuration file www.2cto.com echo' global {usage-count yes ;} common {protocol C; startup {wfc-timeout 0; degr-wfc-timeout 120;} disk {on-io-error detach;} syncer {rate 3 M ;}} resource db {on server1.vicp.net {device/dev/drbd0; d Isk/dev/sdb1; address 192.168.10.10: 7788; meta-disk internal;} on server2.vicp.net {device/dev/drbd0; disk/dev/sdb1; address 192.168.10.20: 7788; meta-disk internal;} '>/etc/drbd. conf 4. Add a partition (in this example, a hard disk sdb is directly added and sdb1 is created on it ). Note 1: fdisk/dev/sdb 5. create the drbd partition drbdadm create-md all 6. Check the drbd configuration drbdadm adjust db 7. Start the drbd service. Note 2 service drbd start 2. master server configuration (must be completed after the above steps are completed): www.2cto.com 1. Set it to primary. The default value is secondary. Drbdsetup/dev/drbd0 primary-o 2. format the partition mkfs. ext3/dev/drbd0 3. Create a directory and mount the mkdir/mnt/drbdmount/dev/drbd0/mnt/drbd/4. Write Data to cp/root/*/mnt/drbd/ iii. Slave Server Configuration: after the slave server is started in drbd, the partition is secondary by default, so no additional configuration is required.
After the configuration is complete, data is automatically synchronized with the master server. 4. Verify that the data has been synchronized from the server www.2cto.com 1. Run the service drbd status Command to see the running status of drbd. Of course, there are other ways to view the log file. Or 2. Another most direct method is to check whether the files on the slave server are exactly the same as those on the master server. NOTE 3: drbdadm disconnect dbdrbdadm primary dbmount/dev/drbd0/mnt/drbd/ls/mnt/drbd/Note 1: This is just a partition. Do not format it !! NOTE 2: After completing the preceding steps on both hosts, you can start the drbd service on both hosts. NOTE 3: After verification is completed, it is not necessary to downgrade or reconnect the slave server to the master server.
You must follow the split-brain steps to complete the restoration.
 

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.