本想依照南非蚂蚁的博客安装配置一下heartbeat3,但是发现安装的过程很曲折,特在此记录一下安装过程中的问题及解决办法,希望别人能少走弯路。
安装可参考该英文网站: http://clusterlabs.org/wiki/Install#From_Source
http://ixdba.blog.运维网.com/2895551/746271
首先:
yum install autoconf automake libtool glib2-devel libxml2-devel bzip2-devel e2fsprogs-devel libxslt-devel
1 、添加用户和组
# groupadd haclient
# useradd -g haclient hacluster
2 、设置变量
vim /root/.bash_profile
添加:
export PREFIX=/usr/local/ha
export LCRSODIR=/usr/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 "cluster user" ${CLUSTER_USER}
source /root/.bash_profile
3 、安装各个模块软件包
1 )安装 Cluster Glue
tar jxvf Reusable-Cluster-Components-glue--glue-1.0.9.tar.bz2
cd Reusable-Cluster-Components-glue--glue-1.0.9
./autogen.sh
./configure --prefix=$PREFIX --with-daemon-user=${CLUSTER_USER} --with-daemon-group=${CLUSTER_GROUP} --enable-fatal-warnings=no
make
错误:
/usr/bin/xsltproc \
--xinclude \
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl hb_report.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
gmake[2]: *** [hb_report.8] 错误 4
gmake[2]: Leaving directory `/usr/local/src/heartbeat/Reusable-Cluster-Components-glue--glue-1.0.9/doc'
gmake[1]: *** [all-recursive] 错误 1
gmake[1]: Leaving directory `/usr/local/src/heartbeat/Reusable-Cluster-Components-glue--glue-1.0.9/doc'
make: *** [all-recursive] 错误 1
解决:
yum -y install docbook*
2 )安装 Resource Agents
tar zxvf ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar.gz
cd ClusterLabs-resource-agents-b735277/
./autogen.sh
出现错误:
configure.ac:9: error: Autoconf version 2.63 or higher is required
解决:
下载并安装 autoconf-2.68.tar.gz
./configure
make;make install
出现错误:
configure.ac:63: require Automake 1.10.1, but have 1.9.6
解决:
下载并安装 automake-1.11.2.tar.gz
./configure --prefix=$PREFIX CFLAGES=-I/usr/local/ha/include LDFLAGS=-L/usr/local/ha/lib
make
错误:
../heartbeat/IPv6addr: error while loading shared libraries: libplumb.so.2: cannot open shared object file: No such file or directory
解决:
vim /etc/ld.so.conf.d/heartbeat.conf (没有 heartbeat.conf ,自己创建)
ldconfig
然后进行 make ,注意如果前面 make 错误,使用 make clean , 然后重新编译再 make 。
3 )安装 heartbeat
tar jxvf Heartbeat-3-0-7e3a82377fa8.tar.bz2
cd Heartbeat-3-0-7e3a82377fa8
./bootstrap
./configure --prefix=$PREFIX --enable-fatal-warnings=no
make
make install
4 )安装 pacemaker( 使用 1.0.12 ,使用 1.1.2 编译不过去,有问题 )
tar zxvf pacemaker-1.0.12.tar.gz
cd ClusterLabs-pacemaker-1.0-066152e/
./autogen.sh
错误:
configure.ac:81: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:82: error: possibly undefined macro: AC_LIBLTDL_CONVENIENCE
configure.ac:83: error: possibly undefined macro: AC_PROG_LIBTOOL
解决:
yum -y install libtool libtool-libs
./configure --prefix=/usr/local/ha --with-heartbeat CFLAGES=-I/usr/local/ha/include LDFLAGS=-L/usr/local/ha/lib64
编译的时候报错:
checking location of OpenAIS libraries... ls: /usr/local/ha/*/libcpg.so: No such file or directory
解决:
修改 configure ,找到 alib=`ls ${AISPREFIX}/ */ libcpg.so | head -n 1` 修改为:
alib=`ls ${AISPREFIX}/libcpg.so | head -n 1` ,重新编译
make
make install
ldconfig -v
5 )安装 图像管理工具Pacemaker-Python-GUI (因为使用的 Pacemaker 是 1.0 的版本,所以这个使用 2.0 ,不要使用官方推荐的,官方推荐的是针对 Pacemaker1.2 的)
tar jxvf Pacemaker-Python-GUI-18332eae086e.tar.bz2
cd Pacemaker-Python-GUI-18332eae086e
./bootstrap --prefix=/usr/local/ha CFLAGES=-I/usr/local/ha/include LDFLAGS=-L/usr/local/ha/lib64
如果出现错误:
报错如下:aclocal:configure.in:57: warning: macro ` AM_PO_SUBDIRS ‘ not found in library
> autoheader
> libtoolize –ltdl –force –copy
> aclocal-1.9
> aclocal:configure.in:57: warning: macro ` AM_PO_SUBDIRS ‘ not found in library
> automake-1.9 –add-missing –include-deps –copy
> configure.in: installing `./install-sh’
> configure.in: installing `./missing’
> cim/Makefile.am: installing `./depcomp’
> lib/mgmt/Makefile.am: installing `./compile’
> autoconf
> configure.in:56: error: possibly undefined macro : AC_PROG_INTLTOOL
> If this token and others are legitimate, please use m4_pattern_allow.
> See the Autoconf documentation.
> configure.in:57: error: possibly undefined macro : AM_PO_SUBDIRS
解决:
安装 gettext 和 intltool
yum -y install gettext* intltool
如果出现错误:
mgmt_tls_lib.c:31:27: error: gnutls/gnutls.h: No such file or directory
解决办法:
yum -y install gnutls*
ldconfig
make clean
重新./configure
然后再make
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com