Simple configuration of DRBD shared storage

Source: Internet
Author: User
Tags rpmbuild

  1. Installing DRBD

  2. Yum install GCC flex rpm-build kernel-devel-yrpmbuild ~ #在家目录生成 rpmbuild required path for compiling CP drbd-8.4.0.tar.gz Rpmbuild/sources/tar ZXF drbd-8.4.0.tar.gzcd drbd-8.4.0./configure--enable-spec--with-kmrpmbuild-bb drbd.spec# compilation generate DRBD RPM package RPMBUILD-BB D Rbd-km.spec #编译 DRBD Kernel module CD ~/RPMBUILD/RPMS/X86_64RPM-IVH * Copy the generated RPM package to another host and install the package: SCP ~/rpmbuild/rpms/x86_64/* 192.168.0.251:/root

    2. Configure the Drbd.res file/ETC/DRBD/DRBD.

  3. resresource mysqldata {        meta-disk internal;         device /dev/drbd1;         syncer {                 verify-alg sha1;        }on demo {         DISK /DEV/VDB; /DRBD the storage disk to be used          address 192.168.122.4:7789;} on remote {        disk /vdb;         address 192.168.122.5:7789;}} Operations performed by both hosts drbdadm create-md mysqldata/etc/init.d/drbd startcat /proc/drbd  You can view the status down on the demo  demo  set as  primary  node and synchronize the data: (Execute the following command on the  demo  host) drbdsetup /dev/ Drbd1 primary --force on two consolesView sync Status: WATCH CAT /PROC/DRBD Create file system after data synchronization: MKFS.EXT4 /DEV/DRBD1 Mount File System:mount /dev/drbd1  /var/lib/mysql then in the HTML the new file will be saved to sync on another server first need to set the demo/dev/drbd1  uninstall demo to secondary drbdadm  Secondary mysqldataremote on Executive  drbdadm primary mysqldatadrbdadm primary  Mysqldatamount /dev/drbd1 /var/lib/mysql can be implemented in synchronous database operation































































Simple configuration of DRBD shared storage

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.