溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Linux安裝heartbeat 3.0集群源碼怎么寫

發(fā)布時(shí)間:2021-10-22 11:52:30 來源:億速云 閱讀:239 作者:柒染 欄目:大數(shù)據(jù)

Linux安裝heartbeat 3.0集群源碼怎么寫,相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

一,前期準(zhǔn)備

  1、Heartbeat集群必須的硬件

構(gòu)建一個(gè)Heartbeat集群系統(tǒng)必須的硬件設(shè)備有:

節(jié)點(diǎn)服務(wù)器、網(wǎng)絡(luò)和網(wǎng)卡、共享磁盤

  2、操作系統(tǒng)規(guī)劃

每個(gè)節(jié)點(diǎn)服務(wù)器都有兩塊網(wǎng)卡,一塊用作連接公用網(wǎng)絡(luò),另一塊通過以太網(wǎng)交叉線連接兩個(gè)節(jié)點(diǎn),作為心跳監(jiān)控

  3,ip規(guī)劃

節(jié)點(diǎn)類型

ip地址

主機(jī)名

類型

主節(jié)點(diǎn)(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

備用節(jié)點(diǎn)(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為講解對(duì)象,以下操作需要在兩個(gè)節(jié)點(diǎn)都進(jìn)行安裝,基本安裝過程為:

首先建立相關(guān)用戶hacluster和組haclient,然后設(shè)定環(huán)境變量,最后就是安裝heartbeat,過程如下:

1、添加用戶和組

groupadd haclient  

useradd -g haclient hacluster

2、設(shè)置環(huán)境變量

vi /root/.bash_profile,添加如下內(nèi)容:

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個(gè)部分,分別是:ClusterGlue、Resource Agents、heartbeat和pacemaker,所以要分別安裝,可以從http://hg.linux-ha.org、http://hg.clusterlabs.org下載對(duì)應(yīng)的軟件包,這里使用的軟件版本分別為:

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)報(bào)錯(cuò)出現(xiàn)configure:WARNING: no configuration information is in libltdl 說明有軟件包沒有裝這個(gè)軟件包就是 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

可能出現(xiàn)如下報(bào)錯(cuò):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軟件包即可

三,安裝排錯(cuò)

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

前三種感覺是常識(shí)性問題,各位如果經(jīng)常安裝源碼包的話這種錯(cuò)誤解決起來應(yīng)該很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的時(shí)候指定一下LIBS,如果是32位系統(tǒng)的話改成LIBS='/lib/libuuid.so.1'。下面ClusterLabs-resourceHeartbeat在./configure的時(shí)候都指定一下,要不然繼續(xù)報(bào)錯(cuò)。

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

解決辦法:一些文檔需要到互聯(lián)網(wǎng)上去下,目前為止make過程中除了doc沒有安裝外,其他的都已經(jīng)成功安裝了,所以該問題可以忽略。

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.

解決方法:編譯時(shí)加入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<crm/common/cluster.h>繼續(xù)執(zhí)行make指令

10,

mgmtd.c: 在函數(shù)‘register_pid’中:  

mgmtd.c:299: 錯(cuò)誤:隱式聲明函數(shù)‘umask’

gmake[2]: *** [mgmtd.o] 錯(cuò)誤 1  

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

gmake[1]: *** [all-recursive] 錯(cuò)誤 1  

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

make: *** [all-recursive] 錯(cuò)誤 1  

解決辦法:在mgmt/daemon/mgmtd.c 文件中加入#include<sys/stat.h> 繼續(xù)執(zhí)行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

這個(gè)問題尚待解決,希望好心網(wǎng)友能給我指明方向,感激不盡~~~~?。。。?!

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

原來缺少一個(gè)工具:yum -y install libtool  

安裝之后驚喜

之后為了保證不出錯(cuò),還需要安裝一個(gè)工具:yum -y install libsysfs-devel

看完上述內(nèi)容,你們掌握Linux安裝heartbeat 3.0集群源碼怎么寫的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI