linux Redhat 6环境上通过源码包安装DRBD 8

环境描述:

  •   操作系统版本:Red Hat Enterprise Linux Server release 6.6 (Santiago)
  •   系统内核版本:2.6.32-504.el6.x86_64
  •   DRBD版本:drbd-8.4.11-1
  •   DRBD工具版本:drbd-utils-8.9.9

需求描述:

  在linux环境(redhat 6.6)上安装DRBD,记录下此过程及安装过程中的错误.

安装过程:

1.下载DRBD源码包

下载地址:https://www.linbit.com/en/drbd-community/drbd-download/

下载的软件包:

  drbd-8.4.11-1.tar.gz

  drbd-utils-8.9.9.tar.gz

2.将drbd的软件包上传到服务器上

[root@hadoop3 softwares]# ls -l drbd-*
-rw-r--r-- 1 root root 349242 May  8 09:43 drbd-8.4.11-1.tar.gz
-rw-r--r-- 1 root root 763821 May  8 15:01 drbd-utils-8.9.9.tar.gz

3.安装drbd软件编译,安装时需要的依赖包

yum -y install gcc make automake autoconf libxslt libxslt-devel flex rpm-build kernel-devel docbook-xsl

安装过程:

[root@hadoop3 softwares]# yum -y install gcc make automake autoconf libxslt libxslt-devel flex rpm-build kernel-devel docbook-xsl
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
rhel-source                                                                                                                                                             | 4.1 kB     00:00 ... 
Package gcc-4.4.7-11.el6.x86_64 already installed and latest version
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Package automake-1.11.1-4.el6.noarch already installed and latest version
Package autoconf-2.63-5.1.el6.noarch already installed and latest version
Package libxslt-1.1.26-2.el6_3.1.x86_64 already installed and latest version
Package flex-2.5.35-9.el6.x86_64 already installed and latest version
Package rpm-build-4.8.0-37.el6.x86_64 already installed and latest version
Package kernel-devel-2.6.32-504.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package docbook-style-xsl.noarch 0:1.75.2-6.el6 will be installed
--> Processing Dependency: xml-common >= 0.6.3-8 for package: docbook-style-xsl-1.75.2-6.el6.noarch
--> Processing Dependency: docbook-dtd-xml for package: docbook-style-xsl-1.75.2-6.el6.noarch
---> Package libxslt-devel.x86_64 0:1.1.26-2.el6_3.1 will be installed
--> Processing Dependency: libxml2-devel >= 2.6.27 for package: libxslt-devel-1.1.26-2.el6_3.1.x86_64
--> Processing Dependency: libgcrypt-devel for package: libxslt-devel-1.1.26-2.el6_3.1.x86_64
--> Processing Dependency: pkgconfig(libxml-2.0) for package: libxslt-devel-1.1.26-2.el6_3.1.x86_64
--> Running transaction check
---> Package docbook-dtds.noarch 0:1.0-51.el6 will be installed
--> Processing Dependency: sgml-common >= 0.6.3-4 for package: docbook-dtds-1.0-51.el6.noarch
---> Package libgcrypt-devel.x86_64 0:1.4.5-11.el6_4 will be installed
--> Processing Dependency: libgpg-error-devel for package: libgcrypt-devel-1.4.5-11.el6_4.x86_64
---> Package libxml2-devel.x86_64 0:2.7.6-14.el6_5.2 will be installed
---> Package xml-common.noarch 0:0.6.3-33.el6 will be installed
--> Running transaction check
---> Package libgpg-error-devel.x86_64 0:1.7-4.el6 will be installed
---> Package sgml-common.noarch 0:0.6.3-33.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                            Arch                                   Version                                           Repository                                   Size
===============================================================================================================================================================================================
Installing:
 docbook-style-xsl                                  noarch                                 1.75.2-6.el6                                      rhel-source                                 2.6 M
 libxslt-devel                                      x86_64                                 1.1.26-2.el6_3.1                                  rhel-source                                 561 k
Installing for dependencies:
 docbook-dtds                                       noarch                                 1.0-51.el6                                        rhel-source                                 274 k
 libgcrypt-devel                                    x86_64                                 1.4.5-11.el6_4                                    rhel-source                                 118 k
 libgpg-error-devel                                 x86_64                                 1.7-4.el6                                         rhel-source                                  14 k
 libxml2-devel                                      x86_64                                 2.7.6-14.el6_5.2                                  rhel-source                                 1.1 M
 sgml-common                                        noarch                                 0.6.3-33.el6                                      rhel-source                                  43 k
 xml-common                                         noarch                                 0.6.3-33.el6                                      rhel-source                                  18 k

Transaction Summary
===============================================================================================================================================================================================
Install       8 Package(s)

Total download size: 4.6 M
Installed size: 32 M
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                           44 MB/s | 4.6 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : xml-common-0.6.3-33.el6.noarch                                                                                                                                              1/8 
  Installing : libxml2-devel-2.7.6-14.el6_5.2.x86_64                                                                                                                                       2/8 
  Installing : sgml-common-0.6.3-33.el6.noarch                                                                                                                                             3/8 
  Installing : docbook-dtds-1.0-51.el6.noarch                                                                                                                                              4/8 
  Installing : libgpg-error-devel-1.7-4.el6.x86_64                                                                                                                                         5/8 
  Installing : libgcrypt-devel-1.4.5-11.el6_4.x86_64                                                                                                                                       6/8 
  Installing : libxslt-devel-1.1.26-2.el6_3.1.x86_64                                                                                                                                       7/8 
  Installing : docbook-style-xsl-1.75.2-6.el6.noarch                                                                                                                                       8/8 
  Verifying  : libgcrypt-devel-1.4.5-11.el6_4.x86_64                                                                                                                                       1/8 
  Verifying  : libgpg-error-devel-1.7-4.el6.x86_64                                                                                                                                         2/8 
  Verifying  : sgml-common-0.6.3-33.el6.noarch                                                                                                                                             3/8 
  Verifying  : docbook-dtds-1.0-51.el6.noarch                                                                                                                                              4/8 
  Verifying  : libxml2-devel-2.7.6-14.el6_5.2.x86_64                                                                                                                                       5/8 
  Verifying  : libxslt-devel-1.1.26-2.el6_3.1.x86_64                                                                                                                                       6/8 
  Verifying  : xml-common-0.6.3-33.el6.noarch                                                                                                                                              7/8 
  Verifying  : docbook-style-xsl-1.75.2-6.el6.noarch                                                                                                                                       8/8 

Installed:
  docbook-style-xsl.noarch 0:1.75.2-6.el6                                                        libxslt-devel.x86_64 0:1.1.26-2.el6_3.1                                                       

Dependency Installed:
  docbook-dtds.noarch 0:1.0-51.el6  libgcrypt-devel.x86_64 0:1.4.5-11.el6_4  libgpg-error-devel.x86_64 0:1.7-4.el6  libxml2-devel.x86_64 0:2.7.6-14.el6_5.2  sgml-common.noarch 0:0.6.3-33.el6 
  xml-common.noarch 0:0.6.3-33.el6 

Complete!

4.安装drbd内核驱动程序

tar -zxf drbd-8.4.11-1.tar.gz 
cd drbd-8.4.11-1
make
make install

5.加载drbd模块到内核中

[root@hadoop3 drbd-8.4.11-1]# modprobe drbd
[root@hadoop3 drbd-8.4.11-1]# lsmod | grep drbd
drbd                  378735  0 
libcrc32c               1246  1 drbd

备注:通过以上的查询结果可以知道drbd模块已经加载内核中了.

6.安装drbd工具

 tar -zxf drbd-utils-8.9.9.tar.gz 
 cd drbd-utils-8.9.9

配置drbd工具的安装路径,配置文件路径

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
make 
make install

7.查看drbd的配置文件,命令是否已经生成

[root@hadoop3 etc]# ls /etc/drbd*
/etc/drbd.conf

/etc/drbd.d:
global_common.conf

备注:drbd的配置文件已经生成了.

[root@hadoop3 etc]# drbd
drbdadm        drbdmeta       drbd-overview  drbdsetup      
[root@hadoop3 etc]# drbd

备注:drbd的命令已经生成了.

 

安装过程中遇到的错误及解决方式:

1.安装drbd-utils时报错:

/usr/bin/xsltproc \
    --xinclude --stringparam variablelist.term.break.after 1 \
    http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl drbdsetup.xml
error : Operation in progress
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
make[1]: *** [drbdsetup.8] Error 4
make[1]: Leaving directory `/opt/softwares/drbd-utils-8.9.9/documentation/v9'
make: *** [doc] Error 2

解决方法:

yum install -y docbook-xsl

备注:安装需要的软件包就可以解决该问题.

 

文档创建时间:2018年5月9日13:30:03

posted @ 2018-05-09 13:33  Zhai_David  阅读(537)  评论(0编辑  收藏  举报