1 Linux disk configuration
1
The Linux machine should better
has second disk, because we don’t want to sync the system partition.
2
The partition DRBD used to sync
should have same size.
3
The partition DRBD used must be
not mounted arbitrarily, because we need to mount the logical device of DRBD
not the physical disk.
2 Build the DRBD
This step will build the RPM package from
source code. It requires that the CPP compiler is installed on the machine.
1
Download the source code
.tar.gz from http://oss.linbit.com/drbd/
,
or if the Linux machine can connect to the internet, use “wget” down the source
code “wget http://oss.linbit.com/drbd/8.3/drbd-8.3.10.tar.gz
”,
####################################################
[root@rh56 etc]# wget http://oss.linbit.com/drbd/8.3/drbd-8.3.10.tar.gz
--2011-06-22 23:35:39-- http://oss.linbit.com/drbd/8.3/drbd-8.3.10.tar.gz
Resolving oss.linbit.com... 212.69.161.111
Connecting to oss.linbit.com|212.69.161.111|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 521798 (510K) [application/x-gzip]
Saving to: `drbd-8.3.10.tar.gz'
100%[========================================================================================================================================>] 521,798 51.7K/s in 14s
2011-06-22 23:35:56 (35.3 KB/s) - `drbd-8.3.10.tar.gz' saved [521798/521798]
####################################################
2
Extract the source package, go
to the extraction dir, execute “./configure”.
####################################################
[root@rh56 drbd-8.3.10]# ./config
-bash: ./config: No such file or directory
[root@rh56 drbd-8.3.10]# ./config
config.status configure
[root@rh56 drbd-8.3.10]# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether ln -s works... yes
checking for sed... /bin/sed
checking for grep... /bin/grep
checking for flex... /usr/bin/flex
checking for rpmbuild... /usr/bin/rpmbuild
checking for xsltproc... /usr/bin/xsltproc
checking for tar... /bin/tar
checking for git... no
checking for dpkg-buildpackage... no
checking for udevadm... false
checking for udevinfo... /usr/bin/udevinfo
configure: WARNING: No dpkg-buildpackage found, building Debian packages is disabled.
configure: WARNING: Cannot update buildtag without git. You may safely ignore this warning when building from a tarball.
checking for /etc/gentoo-release... no
checking for /etc/redhat-release... yes
checking for /etc/slackware-version... no
checking for /etc/debian_version... no
checking for /etc/SuSE-release... no
configure: configured for Red Hat (includes Fedora, RHEL, CentOS).
checking for /etc/fedora-release... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating user/Makefile
config.status: creating scripts/Makefile
config.status: creating documentation/Makefile
config.status: creating user/config.h
config.status: user/config.h is unchanged
[root@rh56 drbd-8.3.10]#
#########################################################
3
Execute “make rpm” and “make
km-rpm” if the configuration is successful.
######################not full log############################
You have now:
/usr/src/redhat/RPMS/i386/drbd-utils-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-debuginfo-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-bash-completion-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-xen-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-heartbeat-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-pacemaker-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-km-debuginfo-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-km-2.6.18_238.el5-8.3.10-1.i386.rpm
/usr/src/redhat/RPMS/i386/drbd-udev-8.3.10-1.i386.rpm
[root@rh56 drbd-8.3.10]#
#########################################################
4
Go to the /usr/src/redhat/RPMS/i386
dir, execute “rpm –i all” to install all rpm packages.
5
Edit the DRBD configuration
file, /etc/drbd.conf to following,
global { usage-count yes; }
common { syncer { rate 100M; } }
resource r0 {
protocol A;
net {
cram-hmac-alg sha1;
shared-secret
"cedrdb";
}
on rh56 {
device
/dev/drbd1; # the logical device, which
DRBD used
disk
/dev/sdb1;# the physical disk
address
192.168.70.253:7789;
meta-disk internal;
}
on cerh564 {
device
/dev/drbd1;
disk
/dev/sdb1;
address
192.168.70.251:7789;
meta-disk internal;
}
}
|
6
Do the same thing on another
machine.
3 Start the DRBD and test
1
Execute “drbdadm create-md r0”
to create the resource.
2
Execute “/etc/init.d/drbd start”
to start the drbd.
3
“drbdadm -- --overwrite-data-of-peer primary r0”
to change the machine to the primary machine.
4
“mount /dev/drbd1 /drbdtest” to
mount the DRBD device.
5
Execute “cat /proc/drbd” to
overview the status of the DRBD.
6
“drbdadm secondary r0” will
change the node to secondary, this command must executed after umount the
/dev/drbd1.
7
Make some file to dir /drbdtest
on the primary node, then change the secondary node to primary, and mount the
/dev/drbd1, you will find the file created on the primary node is on the
secondary node already.
8
Note on the first time DRBD
start, it will spend some time to sync the whole disk partition.
分享到:
相关推荐
Centos5.6 x86_64下部署安装DRBD+Heartbeat+MySQL
RedHat 5.2+MYSQL集群主备+DRBD安装指南 Red Hat Enterprise Linux 5.2环境下,安装二台MYSQL服务器(主备式),通过heartbeat切换,DRBD储存共享。 利用heartbeat,启动mysql、mon。
Introduction to DRBD deals with DRBD’s basic functionality. It gives a short overview of DRBD’s positioning within the Linux I/O stack, and about fundamental DRBD concepts. It also examines DRBD’s ...
drbd的中文指南的翻译,按照drbd官网进行翻译,希望对大家有用处!
DRBD基础 DRBD功能 创建和安装DRBD 配置DRBD 疑难问题及故障恢复
DRBD keepalived 高负载可用环境配置
• 构建和安装DRBD软件涉及从源代码构建DRBD,安装预构建的DRBD软件包,并概述了如何使DRBD在群集系统上运行。 • LINSTOR关于使用LINSTOR进行存储卷和DRBD资源的集中管理。这种软件定义的存储方法对于大型集群特别...
详细介绍drbd安装及测试过程,测试性能
利用DRBD实现不同单板上的磁盘数据备份
本文详细描述 Heartbeat+DRBD+MySQL 组合的高可用方案搭建,每一步都有详细描述+截图,保证一部到位
heartbeat+drbd实现边际双机热备
drbd-8.3.12.tar.gz 下载
DRBD主从模式 配置指南 有图 doc 简单配置 自己下来用的
drbd安装使用指南中文的。。希望对大家有帮助
DRBD+Mysql实现Mysql高可用
基于keepalived做的MySQL+DRBD
drbd9官方中文文档,html格式,浏览器打开稍微有点儿慢。 交流学习使用。用来做硬盘备份以及硬盘资料转移使用。
drbd 高可用的磁盘复制管理软件,使用帮助手册
DRBD是一个用软件实现的、无共享的、服务器之间镜像块设备内容的存储复制解决方案。 DRBD Logo数据镜像:实时、透明、同步(所有服务器都成功后返回)、异步(本地服务器成功后返回)。DBRD的核心功能通过Linux的...
介绍什么是DRBD,安装配置及常见问题处理