1 rpm源 http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install resource-agents pacemaker
yum -y install heartbeat cluster-glue
yum -y install heartbeat-stonith heartbeat-pils heartbeat heartbeat-devel heartbeat-gui libnet
编译安装参考 http://www.linux-ha.org/doc/users-guide/_installing_heartbeat.html
yum install -y bzip2 autoconf automake libtool glib2-devel libxml2-devel
bzip2-devel libtool-ltdl-devel asciidoc libuuid-devel
下载:http://www.linux-ha.org/wiki/Downloads,从官方下载最新的HeartBeat版本:Heartbeat 3.0.6和Cluster Glue 1.0.12,Resource Agents 3.9并安装!
安装glue
./autogen.sh
./configure --prefix=/usr/local/heartbeat --sysconfdir=/etc/heartbeat libdir=/usr/local/heartbeat/lib
make && make install
安装Resource Agents
./autogen.sh
./configure --prefix=/usr/local/heartbeat --sysconfdir=/etc/heartbeat libdir=/usr/local/heartbeat/lib
make & make install
安装HeartBeat
./bootstrap
./configure --prefix=/usr/local/heartbeat --sysconfdir=/etc/heartbeat
make & make install
错误参考 [http://blog.csdn.net/m0_37313242/article/details/78481627]
//启动需要代理的服务 如nginx http mysql 等
////////////////////ha.cf ///////////////
the start by oldboy
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local1
keepalive 2
deadtime 30
warntime 10
initdead 120
bcasteth1
mcast eth2 225.0.0.181 694 1 0
auto_failback on
node left
node right
crm no
////////////////////authkeys ///////////////
auth 1
1 sha1 47e9336850f1db6fa58bc470bc9b7810eb397f04
////////////////////haresources ///////////////
left IPaddr::10.0.0.17/24/eth0
left IPaddr::172.16.1.17/24/eth1
right IPaddr::10.0.0.18/24/eth0
right IPaddr::172.16.1.18/24/eth1
////结合drbd的配置
right IPaddr::192.168.2.149/24/eth0 drbddisk::web Filesystem::/dev/drbd0::/data::ext4
//测试语句
/usr/share/heartbeat/hb_standby //灭掉自己
/////////////////////////////分开的配置/////////////
right IPaddr::192.168.2.149/24/eth0
right drbddisk::web
right Filesystem::/dev/drbd0::/data::ext4
right mysqld::/data/mysql/3306::start