软件环境
[root@server3 ~]# uname -rp
3.10.0-1062.1.1.el7.x86_64 x86_64
[root@server3 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
下载软件
[root@server2 src]# curl -o hb3.tar.bz2 http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/958e11be8686.tar.bz2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 539k 100 539k 0 0 57372 0 0:00:09 0:00:09 --:--:-- 105k
[root@server2 src]# ls
debug hb3.tar.bz2 kernels
解压报错,不支持bzip2
[root@server2 src]# tar -jxvf hb3.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
通过yum定位并安装
[root@server2 src]# yum search bzip
[root@server2 src]# yum list bzip2
...
Available Packages
bzip2.x86_64 1.0.6-13.el7 base
[root@server2 src]# yum install bzip2
重新解压正常。
[root@server3 Heartbeat-3-0-958e11be8686]# ./autogen.sh
Please run bootstrap instead of autogen.sh
[root@server3 Heartbeat-3-0-958e11be8686]# ./bootstrap
You must have autoconf installed to compile the linux-ha package.
由于centos只安装了最小集,根据报错,依次安装了 autoconf automake libtool
新报错:
libtoolize: copying file `libltdl/m4/lt~obsolete.m4'
libtoolize: putting libltdl files in `libltdl'.
libtoolize: `COPYING.LIB' not found in `/usr/share/libtool/libltdl'
./bootstrap exiting due to error (sorry!).
参考
ibtoolize: COPYING.LIB' not found in
/usr/share/libtool/libltdl’ 问题解决方案
https://blog.csdn.net/onelight1997/article/details/7004580?locationNum=3&fps=1
安装软件后 yum install libtool-ltdl-devel搞定!
[root@server3 src]# chown xy.xy . -R
[xy@server3 Heartbeat-3-0-958e11be8686]$ ./bootstrap
[xy@server3 Heartbeat-3-0-958e11be8686]$ ./configure
...
checking for heartbeat/glue_config.h... no
configure: error: in `/usr/src/ha/Heartbeat-3-0-958e11be8686':
configure: error: Core development headers were not found
See `config.log' for more details
# yum install kernel-header
提示已安装
Package kernel-headers-3.10.0-1062.1.1.el7.x86_64 already installed and latest version
该版本和内核不匹配
[root@server3 src]# rpm -q kernel
kernel-3.10.0-957.el7.x86_64
[root@server3 src]# rpm -q kernel-headers
kernel-headers-3.10.0-1062.1.1.el7.x86_64
[root@server3 src]# uname -rp
3.10.0-957.el7.x86_64 x86_64
内核不能直接升级,需要新安装,会自动保留老内核,避免升级失败导致无法开机
[root@server3 src]# yum install kernel
reboot重启后,同样报错
[root@server3 ~]# yum erase kernel-3.10.0-957.el7.x86_64
同样报错
libcluster-glue-dev
先安装
Cluster Glue 1.0.12:
curl http://hg.linux-ha.org/glue/archive/0a7add1d9996.tar.bz2 -o “Cluster Glue 1.0.12”
tar -jxvf Cluster\ Glue\ 1.0.12
方法:
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
configure: error: You need glib2-devel installed in order to build cluster-glue
[root@server3 ~]# yum install glib2-devel
checking for special libxml2 includes… configure: error: libxml2 config not found
[root@server3 ~]# yum install libxml2 提示已安装
[root@server3 ~]# yum install libxml2-devel
checking for bzlib.h… no
checking for BZ2_bzBuffToBuffCompress in -lbz2… no
configure: error: BZ2 Development headers not found
安装
[root@server3 ~]# rpm -q bzip2
bzip2-1.0.6-13.el7.x86_64
[root@server3 ~]# rpm -q bzip2-devel
package bzip2-devel is not installed
[root@server3 ~]# yum install bzip2-devel
配置成功。
libtool: link: gcc -std=gnu99 -g -O2 -ggdb -fgnu89-inline -fstack-protector-all -Wall -Waggregate-return -Wbad-function-cast -Wcast-qual -Wcast-align -Wdeclaration-after-statement -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wformat-nonliteral -Winline -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs -Wno-long-long -Wno-strict-aliasing -Wpointer-arith -Wstrict-prototypes -Wwrite-strings -ansi -D_GNU_SOURCE -DANSI_ONLY -Werror -o .libs/ipctest ipctest.o ./.libs/libplumb.so /usr/src/ha/Reusable-Cluster-Components-glue--0a7add1d9996/lib/pils/.libs/libpils.so ../../replace/.libs/libreplace.a ../../lib/pils/.libs/libpils.so -lbz2 -lz -lxml2 -lc -lrt -ldl -lglib-2.0 -lltdl
./.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: error: ld returned 1 exit status
gmake[2]: *** [ipctest] Error 1
gmake[2]: Leaving directory `/usr/src/ha/Reusable-Cluster-Components-glue--0a7add1d9996/lib/clplumbing'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/src/ha/Reusable-Cluster-Components-glue--0a7add1d9996/lib'
make: *** [all-recursive] Error 1
[xy@server3 Reusable-Cluster-Components-glue--0a7add1d9996]$
Heartbeat从2010年之后,就不再继续维护;只支持2个节点。参考资料:
pacemaker+corosync/heartbeat对比及资源代理RA脚本
因此放弃安装,在make时报错无法解决。