原码安装heartbeat
需要三个包
1.groupadd haclient
2.useradd -g haclient hacluster
Heartbeat-3-0-7e3a82377fa8.tar.bz2
Reusable-Cluster-Components-glue--glue-1.0.9.tar.bz2
ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar
俩台主机centos6.5
1 安装Glue
tar -jxvfReusable-Cluster-Components-glue--glue-1.0.9.tar.bz2
cdReusable-Cluster-Components-glue--glue-1.0.9
./autogen.sh
报错
yum install autoconf �Cy
报错
Yum install automake -y
报错
Yum install libtool -y
成功
./configure
报错
yum install glib2-devel �Cy
报错
Yum install libxml2 -y
yum install libxml2-devel �Cy
报错
yum install bzip2-devel glib2-devel -y
成功
Make
报错
yum install -y libtool-ltdl-devel
make clean
./configure 显示说明成功
Make
报错
yum install libuuid-devel �Cy
make clean
./configure
有luuid才能make成功
Make
报错
yum install docbook-style-xsl �Cy
make clean
./configure
Make
成功
make install
成功
2 安装agent
tar -zxvf ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar.gz
cd ClusterLabs-resource-agents-b735277/
./autogen.sh
成功
./configure
成功
Make
成功
make install
成功
3 安装heartbeat
tar -jxvfHeartbeat-3-0-7e3a82377fa8.tar.bz2
cd Heartbeat-3-0-7e3a82377fa8
./bootstrap
成功
./ConfigureMe configure
成功
Make
报错
解决办法
解决方法:Heartbeat-3-0-7e3a82377fa8/lib/plugins/HBcomm/ucast.c
这个文件貌似有问题,删除468行int i = 1;应该就能make了。(这个真心坑爹)
Make
报错
解决办法
yum install docbook-style-xsl
yum install libxslt-devel �Cy
make clean
./ConfigureMe configure
Make
成功
Make install
成功
拷贝doc下面的文件到 /etc/ha.d/目录下:
cp doc/ha.cf doc/haresource doc/authkeys /etc/ha.d/
配置
cd /etc/ha.d/
ls
cat README
cd /usr/share/doc/heartbeat-3.0.4/
cp ha.cfharesources authkeys /etc/ha.d/
cd /etc/ha.d/
vi ha.cf 更改如下
logfile /var/log/ha-log
logfacility local0
keepalive2
deadtime30
warntime 10
initdead 60
udpport 694(最好改下,因为是广播,用同一个的话问题比较有问题)
bcast eth0用eth0广播
node node1 (上面的为master主机)
node node2(uname -n查看)
ping 192.168.0.254 #网关
respawn hacluster/usr/lib64/heartbeat/ipfail
apiauth ipfail gid=hacluster uid=hacluster
vi authkeys
auth 1
1 crc
chmod 600 authkeys
vi haresources
server51.example.com IPaddr::192.168.0.92(VIP)/24/eth0 httpd
俩台HA主机上要安装httpd
scp ha.cf authkeys haresources192.168.0.194:/etc/ha.d/
/etc/init.d/heartbeat start
/etc/init.d/heartbeat start