heartbeat 安装
创建用户组
heartbeat需要haclient用户组和hacluster用户。
两个节点做同样的操作,并保证haclient和hacluster的ID一样。
?
groupadd haclientuseradd -g haclient hacluster
?
1.Cluster 安装
?
wget http://hg.linux-ha.org/glue/archive/glue-1.0.7.tar.bz2tar -vxjf glue-1.0.7.tar.bz2 cd Reusable-Cluster-Components-glue--glue-1.0.7./autogen.sh
?可能需要安装的:
?
yum install autoconfyum install automakeyum 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.bz2tar -vxjf STABLE-3.0.4.tar.bz2cd Heartbeat-3-0-STABLE-3.0.4/./bootstrap./ConfigureMe configure --prefix=/usr --sysconfdir=/etcmakesudo 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/heartbeatcp ocf-directories .ocf-directoriescp ocf-returncodes .ocf-returncodescp ocf-binaries .ocf-binaries
?
?
3.agents 安装
?
wget https://github.com/ClusterLabs/resource-agents/tarball/agents-1.0.4 --no-check-certificatemv agents-1.0.4 agents-1.0.4.tar.gztar xvf agents-1.0.4.tar.gzcd ClusterLabs-resource-agents-c06b6f3/./autogen.sh./configure --prefix=/usr --sysconfdir=/etcmakesudo make install
?
?需要执行的操作:
?
chmod 600 /etc/ha.d/authkeys
?
?
chkconfig --add heartbeatchkconfig heartbeat onchkconfig httpd off
?一些监控代码:
?
netstat -nupl |grep 694tail -f /var/log/ha/ha-debug