快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

Linux安装heartbeat3.0集群源码怎么写

Linux安装heartbeat 3.0集群源码怎么写,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

创新互联2013年至今,先为吉州等服务建站,吉州等地企业,进行企业商务咨询服务。为吉州企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

一,前期准备

  1、Heartbeat集群必须的硬件

构建一个Heartbeat集群系统必须的硬件设备有:

节点服务器、网络和网卡、共享磁盘

  2、操作系统规划

每个节点服务器都有两块网卡,一块用作连接公用网络,另一块通过以太网交叉线连接两个节点,作为心跳监控

  3,ip规划

节点类型

ip地址

主机名

类型

主节点(rhel 5.5)

eth0:18.1.30.60

priv3.wolf.org

private


eth2:192.168.87.130

test3.wolf.org

public


eth2:0  192.168.87.100


virtual

备用节点(rhel 6.0)

eth0:18.1.30.61

priv4.wolf.org

private


eth2:192.168.87.144

test4.wolf.org

public

  4,域名解析

[root@test3 ~]# vim  /etc/hosts

127.0.0.1              localhost.localdomain localhost

18.1.30.60             priv3.wolf.org    priv3

18.1.30.61             priv4.wolf.org    priv4

192.168.87.130         test3.wolf.org    test3

192.168.87.144         test4.wolf.org    test4

  5,所必须的软件包

  yum install -y libxml2libxml2-devel  bzip2-devel glib2-devel gettext intltool autoconf automake libtool-ltdl-devel  libuuid-devel  pkgconfig libxslt-devellibtool

二、安装heartbeat

这里的安装以heartbeat3.x为讲解对象,以下操作需要在两个节点都进行安装,基本安装过程为:

首先建立相关用户hacluster和组haclient,然后设定环境变量,最后就是安装heartbeat,过程如下:

1、添加用户和组

groupadd haclient  

useradd -g haclient hacluster

2、设置环境变量

vi /root/.bash_profile,添加如下内容:

export PREFIX=/usr/local/ha  

export LCRSODIR=$PREFIX/libexec/lcrso  

export CLUSTER_USER=hacluster

export CLUSTER_GROUP=haclient

export CFLAGS="$CFLAGS -I$PREFIX/include-L$PREFIX/lib"

getent group ${CLUSTER_GROUP} >/dev/null|| groupadd -r ${CLUSTER_GROUP}  

getent passwd ${CLUSTER_USER} >/dev/null|| useradd -r -g ${CLUSTER_GROUP} -d /var/lib/heartbeat/cores/hacluster

-s /sbin/nologin -c "clusteruser" ${CLUSTER_USER}  

   heartbeat3.x版本把安装包分成了4个部分,分别是:ClusterGlue、Resource Agents、heartbeat和pacemaker,所以要分别安装,可以从http://hg.linux-ha.org、http://hg.clusterlabs.org下载对应的软件包,这里使用的软件版本分别为:

glue-1.0.9、ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar、heartbeat-STABLE-3.0.4、Pacemaker-1.0.10

1)安装Cluster Glue

tar jxvfReusable-Cluster-Components-glue--glue-1.0.9.tar.bz2

cd Reusable-Cluster-Components-glue--glue-1.0.9.tar.bz2

./autogen.sh

./configure --prefix=$PREFIX--with-daemon-user=${CLUSTER_USER}  --with-daemon-group=${CLUSTER_GROUP} --enable-fatal-warnings=no

make

make install

注意:

(1)报错出现configure:WARNING: no configuration information is in libltdl 说明有软件包没有装这个软件包就是 libtool-ltdl-devel

2)安装Resource Agents

tar jxvfCluster-Resource-Agents-5ae70412eec8.tar.bz2

cd Cluster-Resource-Agents-5ae70412eec8

./autogen.sh

./configure  --prefix=$PREFIX --enable-fatal-warnings=no

make

make install

3)安装heartbeat

tar jxvf Heartbeat-3-0-fcd56a9dd18c.tar.bz2

cd Heartbeat-3-0-fcd56a9dd18c

./bootstrap

./configure  --prefix=$PREFIX --enable-fatal-warnings=no

make

make install

4)安装pacemaker

tar jxvfPacemaker-1-0-c3869c00c759.tar.bz2

cd Pacemaker-1-0-c3869c00c759

./autogen.sh

./configure --prefix=$PREFIX--with-lcrso-dir=$LCRSODIR  --enable-fatal-warnings=no

make

make install

5)安装图像管理工具Pacemaker-Python-GUI

tar jxvfPacemaker-Python-GUI-18332eae086e.tar.bz2

cd Pacemaker-Python-GUI-18332eae086e

./bootstrap  --prefix=$PREFIX  CFLAGS="$CFLAGS -I$PREFIX/include -L$PREFIX/lib64"

make

make install

可能出现如下报错:aclocal:configure.in:57: warning: macro `AM_PO_SUBDIRS' not found inlibrary ./configure: line 2064: syntax error near unexpected token `0.35.2'./configure: line 2064: `AC_PROG_INTLTOOL(0.35.2)‘只需安装gettext和intltool软件包即可

三,安装排错

1、libtoolize:`COPYING.LIB' not found in `/usr/share/libtool/libltdl'

解决办法:

yum -y install libtool-ltdl-devel

2、checking forspecial libxml2 includes... configure: error: libxml2 config not found

解决办法:

yum -y install libxml2

3、configure:error: BZ2 libraries not found

解决办法:

yum -y install bzip2-devel glib2-devel

前三种感觉是常识性问题,各位如果经常安装源码包的话这种错误解决起来应该很easy的。

4、安装Reusable-Cluster-Components-glue--glue-1.0.9

./.libs/libplumb.so: undefined reference to`uuid_parse’

./.libs/libplumb.so: undefined reference to`uuid_generate’

./.libs/libplumb.so: undefined reference to`uuid_copy’

./.libs/libplumb.so: undefined reference to`uuid_is_null’

./.libs/libplumb.so: undefined reference to`uuid_unparse’

./.libs/libplumb.so: undefined reference to`uuid_clear’

./.libs/libplumb.so: undefined reference to`uuid_compare’

collect2: ld returned 1 exit status

gmake[2]: *** [ipctest] Error 1

gmake[2]: Leaving directory`/root/Reusable-Cluster-Components-glue-1.0.6/lib/clplumbing’

gmake[1]: *** [all-recursive] Error 1

gmake[1]: Leaving directory`/root/Reusable-Cluster-Components-glue-1.0.6/lib’

make: *** [all-recursive] Error 1

解决办法:

./configure --prefix=$PREFIX --with-daemon-user=${CLUSTER_USER} --with-daemon-group=${CLUSTER_GROUP}--enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'

各位在./configure的时候指定一下LIBS,如果是32位系统的话改成LIBS='/lib/libuuid.so.1'。下面ClusterLabs-resourceHeartbeat在./configure的时候都指定一下,要不然继续报错。

5、

uuid_parse.c:250: error: expected ‘;’, ‘,’ or ‘)’ before ‘uu’

uuid_parse.c:469: error: expected ‘)’ before ‘out’

uuid_parse.c:484: error: expected ‘)’ before ‘out’

uuid_parse.c:512: error: expected ‘)’ before ‘out’

gmake[1]: *** [uuid_parse.lo] Error 1

gmake[1]: Leaving directory`/usr/src/Heartbeat-3-0-7e3a82377fa8/replace'

make: *** [all-recursive] Error 1

解决办法:

# ./configure --prefix=$PREFIX--enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'

6,

gmake[1]: --xinclude: Command not found

gmake[1]: *** [heartbeat.8] Error 127

gmake[1]: Leaving directory`/usr/src/Heartbeat-3-0-7e3a82377fa8/doc'

make: *** [all-recursive] Error 1

解决办法:

# yum -y install libxslt-devel

7,

error : Operation in progress

warning: failed to load external entity"http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"

compilation error: filehttp://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl line 46element include

xsl:include : unable to load http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl

http://docbook.sourceforge.net/release/xsl/current/html/table.xsl:1:parser error : Document is empty

http://docbook.sourceforge.net/release/xsl/current/html/table.xsl:1:parser error : Start tag expected, '<' not found

compilation error: filehttp://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl line 47element include

xsl:include : unable to loadhttp://docbook.sourceforge.net/release/xsl/current/html/table.xsl

解决办法:一些文档需要到互联网上去下,目前为止make过程中除了doc没有安装外,其他的都已经成功安装了,所以该问题可以忽略。

8,

checking for openais/saAis.h... no

checking corosync/coroipcc.h usability...no

checking corosync/coroipcc.h presence... no

checking for corosync/coroipcc.h... no

configure: WARNING: Unable to supportOpenAIS: Whitetank headers not found

checking for supported stacks... configure:error: in `/root/Pacemaker-1-0-c3869c00c759':

configure: error: You must choose at leastone cluster stack to support

See `config.log' for more details.

解决方法:编译时加入LDFLAGS=-L$PREFIX/lib64

[root@test4 Pacemaker-1-0-c3869c00c759]#./configure --prefix=$PREFIX --with-lcrso-dir=$LCRSODIRLDFLAGS=-L$PREFIX/lib64 --enable-fatal-warnings=no

9,

cc1: warnings being treated as errors

mgmt_lib.c: In function 'init_mgmt_lib':

mgmt_lib.c:97: warning: implicitdeclaration of function 'is_heartbeat_cluster'  

gmake[2]: *** [libhbmgmt_la-mgmt_lib.lo]Error 1  

gmake[2]: Leaving directory`/data0/Pacemaker-Python-GUI-c08b84a8203f/mgmt/daemon'  

gmake[1]: *** [all-recursive] Error 1

解决办法:在mgmt/daemon/mgmt_lib.c文件中加入 #include继续执行make指令

10,

mgmtd.c: 在函数‘register_pid’中:  

mgmtd.c:299: 错误:隐式声明函数‘umask’

gmake[2]: *** [mgmtd.o] 错误 1  

gmake[2]: Leaving directory`/root/install/Pacemaker-Python-GUI-c08b84a8203f/mgmt/daemon'  

gmake[1]: *** [all-recursive] 错误 1  

gmake[1]: Leaving directory`/root/install/Pacemaker-Python-GUI-c08b84a8203f/mgmt'  

make: *** [all-recursive] 错误 1  

解决办法:在mgmt/daemon/mgmtd.c文件中加入#include继续执行make指令

11,

wrap.Tpo -c ./pymgmt_wrap.c  -fPIC-DPIC -o .libs/_pymgmt_la-pymgmt_wrap.o

gcc: ./pymgmt_wrap.c: No such file ordirectory

gcc: no input files

gmake[2]: *** [_pymgmt_la-pymgmt_wrap.lo]Error 1

gmake[2]: Leaving directory`/root/Pacemaker-Python-GUI-18332eae086e/lib/mgmt'

gmake[1]: *** [all-recursive] Error 1

gmake[1]: Leaving directory`/root/Pacemaker-Python-GUI-18332eae086e/lib'

make: *** [all-recursive] Error 1

这个问题尚待解决,希望好心网友能给我指明方向,感激不尽~~~~!!!!!

12

configure.ac:63: require Automake1.10.1, but have 1.9.6

  1. wget http://ftp.gnu.org/gnu/automake/automake-1.11.2.tar.gz

  2. tar xzf automake-1.11.2.tar.gz

  3. cd automake-1.11.2

  4. ./configure

  5. make && make install

13

解决 configure.ac:17: error: possibly undefined macro: AC_PROG_LIBTOOL

原来缺少一个工具:yum -y install libtool  

安装之后惊喜

之后为了保证不出错,还需要安装一个工具:yum -y install libsysfs-devel

看完上述内容,你们掌握Linux安装heartbeat 3.0集群源码怎么写的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注创新互联行业资讯频道,感谢各位的阅读!


本文标题:Linux安装heartbeat3.0集群源码怎么写
本文来源:http://6mz.cn/article/gscedg.html

其他资讯