设为首页 收藏本站
查看: 667|回复: 0

[经验分享] Config DRBD on Redhat 5.6 32bit VM

[复制链接]

尚未签到

发表于 2016-5-14 13:17:39 | 显示全部楼层 |阅读模式
  
1 Linux disk configuration
1The Linux machine should betterhas second disk, because we don’t want to sync the system partition.
2  The partition DRBD used to syncshould have same size.
3The partition DRBD used must benot mounted arbitrarily, because we need to mount the logical device of DRBDnot the physical disk.
2 Build the DRBD
This step will build the RPM package fromsource code. It requires that the CPP compiler is installed on the machine.
1Download 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 sourcecode “wget http://oss.linbit.com/drbd/8.3/drbd-8.3.10.tar.gz”,
####################################################
[iyunv@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]
####################################################
  
2Extract the source package, goto the extraction dir, execute “./configure”.
####################################################
[iyunv@rh56 drbd-8.3.10]# ./config
-bash: ./config: No such file or directory
[iyunv@rh56 drbd-8.3.10]# ./config
config.status  configure      
[iyunv@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
[iyunv@rh56 drbd-8.3.10]#
#########################################################
  
3Execute “make rpm” and “makekm-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
[iyunv@rh56 drbd-8.3.10]#
#########################################################
  
4Go to the /usr/src/redhat/RPMS/i386dir, execute “rpm –i all” to install all rpm packages.
5Edit the DRBD configurationfile, /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, whichDRBD 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;
       }
}
6Do the same thing on anothermachine.
3 Start the DRBD and test
1Execute “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” tomount the DRBD device.
5Execute “cat /proc/drbd” tooverview the status of the DRBD.
6“drbdadm secondary r0” willchange the node to secondary, this command must executed after umount the/dev/drbd1.
7Make some file to dir /drbdteston 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 thesecondary node already.
8Note on the first time DRBDstart, it will spend some time to sync the whole disk partition.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-216985-1-1.html 上篇帖子: 把Redhat设置成默认非图形界面启动 下篇帖子: Redhat 5.5 不接显示器出现的奇怪问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表