heartbeat注意事项:
1)要将所有的软件包安装全,并且注意安装版本
2)编译安装的顺序:cluster glue;再安装resource Agents;最后在安装heartbeat
3)automake版本要在 1.10.1版本及以上,autoconf要2.63版本及以上,libtool和libnet都有版本要求。我用的是libnet-1.1.2.1.tar.gz,libtool-2.4.2.tar.gz
4)在安装resource Agents的时候需要libheartbear2的安装包(试过很多种rpm包,都不成功。libheartbeat2-2.99.2-6.1.i386.rpm这个版本的安装包成功,直接rmp安装即可)大家针对自己的操作系统来选择适合自己的安装包版本吧)
5)以上一定要先准备好,特别是安装resource Agents,make的时候他需要配置doc/man下的东西,需要花掉你几乎2-3个小时的时间,如果没有准备好以上,重来是很不划算的哦。。^_^
6)不知道是个人原因还是怎么回事,我之前用RHEL5.5的系统,从官网下载的heartbeat安装包,但是安装时候总是各种问题,各种报错,报错、问题都解决了吧。还是没有安装成功,最后换了centos5.8的操作系统,安装就很顺利~
注:heartbeat源码安装包下载路径:http://www.linux-ha.org/wiki/Downloads
安装Resource Agents的时候出现错误:configure.ac:9: error: Autoconf version 2.63 or higher is required。指的是autoconf版本低,需要安装高版本的。
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz
tar xzf autoconf-2.68.tar.gz
cd autoconf-2.68
./configure
make && make install
安装Resource Agents的时候出现错误:configure.ac:63: require Automake 1.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
1.安装所需软件包
rpm -ivh libheartbeat2-2.99.2-6.1.i386.rpm
yum install autoconf automake libtool glib2-devel libxml2-devel bzip2-devel e2fsprogs-devel libxslt-devel
gcc flex bison python perl gettext libnet
检查安装包是否成功
rpm -qa |grep libtool;
rpm -qa |grep ltdl;
rpm -qa |grep glib2-devel;
rpm -qa |grep libxml2-devel;
rpm -qa |grep bzip2-devel;
rpm -qa |grep e2fsprogs-devel;
rpm -qa |grep libxslt-devel;
rpm -qa |grep gcc;
rpm -qa |grep flex;
rpm -qa |grep bison;
rpm -qa |grep python;
rpm -qa |grep gettext;
rpm -qa |grep libnet;
rpm -qa |grep libheartbeat;
2.创建所需账户
groupadd haclient -g 501
useradd -g haclient hacluster
cd /tmp
3.下载并安装glue
wget http://hg.linux-ha.org/glue/archive/glue-1.0.9.tar.bz2
tar xjf glue-1.0.9.tar.bz2
cd Reusable-Cluster-Components-glue--glue-1.0.9
./autogen.sh
./configure --prefix=/usr/local/heartbeat
make && make install
安装Resource Agents
cd /tmp
4.下载并安装resource-agent
wget --no-check-certificate https://github.com/ClusterLabs/resource-agents/tarball/ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar.gz
tar xzf ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar.gz
cd ClusterLabs-resource-agents-b735277/
./autogen.sh
export CFLAGS="$CFLAGS -I/usr/local/heartbeat/include -L/usr/local/heartbeat/lib"(这一步一定要做,不然后面会报错)
./configure --prefix=/usr/local/heartbeat
ln -s /usr/local/heartbeat/lib/* /lib/
ln -s /usr/local/lib/libltdl* /lib/
make && make install
5.下载并安装heartbeat
cd /tmp
wget http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/STABLE-3.0.4.tar.bz2
tar xjf STABLE-3.0.4.tar.bz2
cd Heartbeat-3-0-7e3a82377fa8/
./bootstrap
export CFLAGS="$CFLAGS -I/usr/local/heartbeat/include -L/usr/local/heartbeat/lib"(这一步一定要做,不然后面会报错)
./configure --prefix=/usr/local/heartbeat
make && make install
6.最后配置
cp doc/ha.cf /usr/local/heartbeat/etc/ha.d/
cp doc/haresources /usr/local/heartbeat/etc/ha.d/
cp doc/authkeys /usr/local/heartbeat/etc/ha.d/
cp heartbeat/init.d/heartbeat /etc/rc.d/init.d/
chkconfig --add heartbeat
chkconfig heartbeat on
chmod 600 /usr/local/heartbeat/etc/ha.d/authkeys
sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/etc/ha.d/shellfuncs
sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/usr/lib/ocf/lib//heartbeat/ocf-shellfuncs
sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/etc/ha.d/resource.d//hto-mapfuncs
参考地址:http://www.centos.bz/2012/02/centos-compile-install-heartbeat/#除错