`

heartbeat 安装

 
阅读更多

创建用户组

heartbeat需要haclient用户组和hacluster用户。
两个节点做同样的操作,并保证haclient和hacluster的ID一样。

 

groupadd haclient
useradd -g haclient hacluster

 

1.Cluster 安装

 

wget http://hg.linux-ha.org/glue/archive/glue-1.0.7.tar.bz2
tar -vxjf glue-1.0.7.tar.bz2 
cd Reusable-Cluster-Components-glue--glue-1.0.7

./autogen.sh

 可能需要安装的:

 

yum install autoconf
yum install automake
yum install libtool

可能碰到的问题:

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

将别的机器的libltdl copy到相应目录,否则在make时可能会出现

 

Making all in libltdl

gmake[1]: Entering directory `/soft/Reusable-Cluster-Components-glue--glue-1.0.7/libltdl'

gmake[1]: *** No rule to make target `all'.  Stop.

gmake[1]: Leaving directory `/soft/Reusable-Cluster-Components-glue--glue-1.0.7/libltdl'

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

出现上述错误后,删除已经编译的文件夹,然后copy上述文件,再执行以上操作

./configure --prefix=/usr --sysconfdir=/etc

 可能碰到的问题:

 

问题:configure: error: libxml2 config not found 

rpm -qa|grep libxml

解决:yum install libxml2 libxml2-devel

 

问题:configure: error: BZ2 libraries not found

解决:yum -y install bzip2-devel glib2-devel

 

 

make

 可能碰到的问题:

 

问题:

lib/pils/.libs/libpils.so -lbz2 -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: ld returned 1 exit status

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

解决:yum install e2fsprogs-devel libuuid-devel

 

问题:

error : Operation in progress

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

compilation error: file http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl line 46 element 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: file http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl line 47 element include

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

解决:我怀疑是需要下载的文件比较多,而水管的速度很不给力,所以我是下载了这些xsl文件,然后在本机架设了一个webserver,通过设置host访问局域网的机器

 

sudo make install

2.heartbeat安装

 

wget http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/STABLE-3.0.4.tar.bz2
tar -vxjf STABLE-3.0.4.tar.bz2
cd Heartbeat-3-0-STABLE-3.0.4/
./bootstrap
./ConfigureMe configure --prefix=/usr --sysconfdir=/etc
make
sudo make install

可能遇到的问题:

 问题:Starting High-Availability services: /etc/ha.d/resource.d//hto-mapfuncs: line 35: 

 

/usr/lib/ocf/resource.d//heartbeat/.ocf-shellfuncs: No such file or directory Done.

解决:cp /etc/ha.d/shellfuncs /usr/lib/ocf/resource.d//heartbeat/.ocf-shellfuncs

 

缺少.ocf-directories .ocf-returncodes .ocf-binaries

解决:

 

cd /usr/lib/ocf/lib/heartbeat
cp ocf-directories .ocf-directories
cp ocf-returncodes .ocf-returncodes
cp ocf-binaries .ocf-binaries

 

 

3.agents 安装

 

wget https://github.com/ClusterLabs/resource-agents/tarball/agents-1.0.4 --no-check-certificate
mv agents-1.0.4 agents-1.0.4.tar.gz
tar xvf agents-1.0.4.tar.gz
cd ClusterLabs-resource-agents-c06b6f3/
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install

 

 需要执行的操作:

 

chmod 600 /etc/ha.d/authkeys

 

 

chkconfig --add heartbeat
chkconfig heartbeat on
chkconfig httpd off

 一些监控代码:

 

netstat -nupl |grep 694

tail -f /var/log/ha/ha-debug
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics