说明

Heartbeat编译安装

Update: 2012-11-29

参考

测试环境

Red Hat通过CentOS源来安装一些支持包。

yum安装编译环境支持包及ipvsadm

yum -y install unzip wget gcc autoconf automake make libtool pkgconfig glib2-devel \
    libxml2 libxml2-devel bzip2-devel libtool-ltdl-devel libuuid-devel libxslt-devel;
yum -y install ipvsadm kernel-devel;
yum -y install perl-Socket6 perl-libwww-perl perl-IO-Socket-INET6 perl-MailTools;
yum -y install docbook-*;

下载源码相应包

mkdir -p ~/down && cd ~/down
wget http://hg.linux-ha.org/glue/archive/glue-1.0.9.tar.bz2
wget https://github.com/ClusterLabs/resource-agents/zipball/master -O ClusterLabs-resource-agents.zip --no-check-certificate
wget -O heartbeat-STABLE_3_0_5.tar.bz2 http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/7e3a82377fa8.tar.bz2

编译glue

groupadd haclient
useradd -g haclient -M -s /sbin/nologin hacluster

cd ~/down \
&& tar jxvf glue-1.0.9.tar.bz2 \
&& cd Reusable-Cluster-Components-glue--glue-1.0.9 \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install \
&& cd -

resource-agents

# yum install perl-Socket6 perl-libwww-perl perl-IO-Socket-INET6 perl-MailTools;
# yum install docbook-*;

cd ~/down \
&& unzip ClusterLabs-resource-agents.zip \
&& cd ClusterLabs-resource-agents-3c93e36/ \
&& ./autogen.sh \
&& ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
&& make && make install \
&& cp ldirectord/ldirectord.cf /etc/ha.d/ \
&& cd -

# 以下复制操作在make install中已完成
# cp ldirectord/ldirectord /usr/sbin/
# cp ldirectord/init.d/ldirectord /etc/init.d/
# chmod 755 /usr/sbin/ldirectord
# chmod 755 /etc/init.d/ldirectord
# cp ldirectord/ldirectord.cf /etc/ha.d/
# vi /etc/ha.d/ldirectord.cf; 

编译Heartbeat 3

# yum install perl-Socket6 perl-libwww-perl perl-IO-Socket-INET6 perl-MailTools;
cd ~/down \
&& tar jxvf heartbeat-STABLE_3_0_5.tar.bz2 \
&& cd Heartbeat-3-0-7e3a82377fa8 \
&& ./bootstrap \
&& ./ConfigureMe configure \
&& make && make install \
&& cd -

cp /usr/share/doc/heartbeat/authkeys /etc/ha.d/
cp /usr/share/doc/heartbeat/haresources /etc/ha.d/
cp /usr/share/doc/heartbeat/ha.cf /etc/ha.d/
chmod 600 /etc/ha.d/authkeys
ln -sfT /etc/ha.d /usr/etc/ha.d

下载第三方包方式安装ldirectord

未测试,建议编译安装方式

wget  http://dl.fedoraproject.org/pub/fedora/linux/releases/17/Everything/x86_64/os/Packages/l/ldirectord-3.9.2-2.fc17.1.x86_64.rpm
yum install ipvsadm perl-MailTools perl-Net-SSLeay -y

rpm -ivh ldirectord-3.9.2-2.fc17.1.x86_64.rpm 

rpm -ql ldirectord
    /etc/ha.d
    /etc/ha.d/resource.d
    /etc/ha.d/resource.d/ldirectord
    /etc/init.d/ldirectord
    /etc/logrotate.d/ldirectord
    /usr/lib/ocf/resource.d/heartbeat/ldirectord
    /usr/sbin/ldirectord
    /usr/share/doc/ldirectord-3.9.2
    /usr/share/doc/ldirectord-3.9.2/COPYING
    /usr/share/doc/ldirectord-3.9.2/ldirectord.cf
    /usr/share/man/man8/ldirectord.8.gz