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 DRBDyum 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