`

Config DRBD on Redhat 5.6 32bit VM

阅读更多

 

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

    Centos5.6 x86_64 下部署安装 DRBD+Heartbeat+MySQL 服务器平台的实现方法 本文档旨在指导用户在 Centos5.6 x86_64 操作系统下部署安装 DRBD+Heartbeat+MySQL 服务器平台,实现高可用集群环境。通过本文档,用户...

    DRBD配置指南主从模式

    使用`chkconfig drbd on`将DRBD服务添加到开机启动项,然后分别在两个节点上启动DRBD服务,通过`service drbd start`命令。使用`drbdadm status`或`drbdadm primary r0`等命令来监控和管理DRBD的状态。 ### 七、...

    利用DRBD实现不同单板上的磁盘数据备份

    一、DRBD 详解 DRBD,全称 Distributed Replicated Block Device,是一种分布式复制块设备技术,用于在两台或多台服务器之间实时同步数据。它为系统提供了高可用性(HA)解决方案,使得在一台服务器故障时,另一台...

    DRBD keepalived负载搭建配置

    DRBD (Distributed Replicated Block Device) 是一种用于创建高可用集群的数据复制技术,它可以将一个磁盘设备的更改实时地复制到另一个节点,确保在主节点故障时能快速切换到备份节点,从而保证服务的连续性和数据...

    drbd安装使用指南中文的

    DRBD(Distributed Replicated Block Device)是一种分布式存储解决方案,用于在两台或多台服务器之间实时同步数据,提供高可用性和灾难恢复能力。本指南将详细介绍DRBD的安装与使用,帮助你理解如何构建一个可靠的...

    DRBD中文指南|drbd官方指南翻译

    ### DRBD中文指南知识点解析 #### 一、DRBD概览与翻译背景 **DRBD**(Distributed Replicated Block Device)是一种用于实现服务器间数据实时镜像的技术,旨在提高数据的可靠性和可用性。本中文指南是基于官方英文...

    DRBD官方指南(中文)

    DRBD官方指南是一份关于分布式复制块设备(DRBD技术)的详细参考资料,由LINBIT公司赞助并免费提供。DRBD是一种开源的、无共享的、基于软件的复制存储解决方案,它能够在服务器之间实时镜像块设备(如硬盘、分区、...

    drbd84离线安装包

    DRBD的全称是Distributed Replicated Block Device,即分布式复制块设备,是一个用软件实现的、无共享的、服务器之间镜像块设备内容的存储复制解决方案。DRBD是镜像块设备,是按数据位镜像成一样的数据块。简单说...

    Heartbeat DRBD MySQL 高可用方案搭建.docx

    【Heartbeat DRBD MySQL 高可用方案搭建】 在IT领域,构建高可用系统是保障业务连续性和数据安全的重要措施。本方案将详细讲解如何利用Heartbeat、DRBD和MySQL搭建一个高可用环境,确保数据库服务的稳定运行。 **...

    drbd-utils-8.9.3

    分布式复制块设备(DRBD, Distributed Replicated Block Device)是一种高效、可靠的软件解决方案,用于在两台或多台服务器之间同步块级别的数据。DRBD的主要目标是提供无共享的存储复制,确保数据的安全性和高可用性...

    drbd 原理图和依赖关系

    DRBD(Distributed Replicated Block Device)是一种分布式存储解决方案,用于在两台或多台服务器之间实时同步数据。它提供了一种高可用性(HA)的架构,确保在一台服务器出现故障时,另一台服务器能够无缝接管,从而...

    heartbeat+drbd实现边际双机热备

    每个节点都需要安装RHEL6.3-32bit操作系统,并配置相应的网络设置。master节点的IP地址为192.168.10.150,slave节点的IP地址为192.168.10.151。 二、安装依赖包 在安装heartbeat之前,我们需要安装一些依赖包,...

    DRBD9和LINSTOR用户指南中文版.doc

    《DRBD9和LINSTOR用户指南中文版》是一份详尽的文档,旨在帮助用户理解和使用DRBD 9和LINSTOR这两个关键的存储技术。DRBD(Distributed Replicated Block Device)是一种用于实现数据实时、透明和同步或异步复制的...

    RedHat 5.2+MYSQL集群主备+DRBD安装指南

    RedHat 5.2+MYSQL集群主备+DRBD安装指南 Red Hat Enterprise Linux 5.2环境下,安装二台MYSQL服务器(主备式),通过heartbeat切换,DRBD储存共享。 利用heartbeat,启动mysql、mon。

    linux 下 DRBD 基础

    【Linux下DRBD基础】 DRBD,全称为Distributed Replicated Block Device,是一种软件实现的分布式存储解决方案,它能够在无共享环境下实现服务器间块设备内容的实时、透明、同步或异步复制。DRBD的核心功能集成在...

Global site tag (gtag.js) - Google Analytics