您好,登錄后才能下訂單哦!
Linux安裝heartbeat 3.0集群源碼怎么寫,相信很多沒有經驗的人對此束手無策,為此本文總結了問題出現的原因和解決方法,通過這篇文章希望你能解決這個問題。
一,前期準備
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<crm/common/cluster.h>繼續執行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<sys/stat.h> 繼續執行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
wget http://ftp.gnu.org/gnu/automake/automake-1.11.2.tar.gz
tar xzf automake-1.11.2.tar.gz
cd automake-1.11.2
./configure
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集群源碼怎么寫的方法了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。