Simple configuration of DRBD shared storage

Source: Internet
Author: User
Tags rpmbuild

Install DRBD yum Install GCC flex rpm-build kernel-devel-yrpmbuild ~ #在家目录生成 rpmbuild required path for compiling CP drbd-8.4.0.tar.gz RPMBUILD/SOURC Es/tar zxf drbd-8.4.0.tar.gzcd drbd-8.4.0./configure--enable-spec--WITH-KMRPMBUILD-BB Dr

Installing DRBD
yum install gcc flex rpm-build kernel-devel -yrpmbuild ~  #在家目录生成  rpmbuild  compile the required path 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# Compile build  drbd rpm  package rpmbuild -bb drbd-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 

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

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 two hosts d rbdadm create-md mysqldata/ etc/init.d/drbd start cat / PROC/DRBD can view the status   to set  demo  as  primary  node on demo and synchronize data: (in  demo  host executes the following command) Drbdsetup /dev/drbd1 prImary --force View sync status on two hosts: WATCH CAT /PROC/DRBD 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 synchronize on another server first need to be on the demo/dev/drbd1  Uninstall demo set to Secondary drbdadm secondary mysqldataremote on execute  drbdadm primary  Mysqldatadrbdadm primary mysqldatamount /dev/drbd1 /var/lib/mysql can be implemented in synchronous database operation

This article is from the "Target: India" blog, please be sure to keep this source http://shunzi115.blog.51cto.com/5184443/1796079

Simple configuration of DRBD shared storage

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.