码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.4上drbd安装

时间:2014-12-19 19:23:43      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:drbd

  • 安装drbd过程:(实验借鉴:http://www.it165.net/os/html/201309/6317.html)

  • yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 gcc gcc-c++ autoconf

  • # wget http://oss.linbit.com/drbd/8.4/drbd-8.4.3.tar.gz

    注意:安装kernel-devel一定要和你uname -r 看到的内核版本一致,建议kernel-devel用本地源安装,不要用网络源安装 

  • # tar -zxvf drbd-8.4.3.tar.gz
    # cd drbd-8.4.3

  • ./configure --prefix=/usr/local/drbd --with-km启用内核模块

  • make KDIR=/usr/src/kernels/2.6.32-358.el6.i686/ 编译到内核里面

  • make install

  • cp /usr/local/drbd/etc/rc.d/init.d/drbd /etc/init.d/

  • cd /usr/local/drbd/var;mkdir run;cd run;mkdir drbd

  • 然后回到解压的目录,执行清理:

  • cd /lvs/drbd-8.4.3/drbd;make clean

  • make KDIR=/usr/src/kernels/2.6.32-358.el6.i686/

  • cp drbd.ko /lib/modules/2.6.32-358.el6.i686/kernel/lib/

  • modprobe drbd  加载到内核

  • lsmod | grep drbd

  • mknod /dev/drbd0 b 147 0

  • +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • cd /usr/local/drbd/etc/drbd.d

  • vi drbd.res

    resource drbd {
            on web1 {
            device /dev/drbd0;
            disk /dev/sdb1;
            address 192.168.1.22:7789;
            meta-disk internal;
         }
            on web2 {
            device /dev/drbd0;
            disk /dev/sdb1;
            address 192.168.1.23:7789;
            meta-disk internal;
         }
    }

  • drbdadmin create-md drbd

  • /etc/init.d/drbd start

本文出自 “大王好帅” 博客,请务必保留此出处http://dawang.blog.51cto.com/4927689/1591748

centos6.4上drbd安装

标签:drbd

原文地址:http://dawang.blog.51cto.com/4927689/1591748

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!