- 安装
#可能需要执行两次
yum install -y heartbeat
- 配置centos1.mypharma.com
logfile /var/log/ha-log #配置日志
logfacility local0 #配置日志等级
keepalive 2 #2秒
deadtime 15 #15秒
#设置单薄方式,3条心跳线路
ucast eth0 112.112.68.172
ucast eth1 10.0.0.2
ucast eth3 192.168.1.2
auto_failback off #primary恢复不回切,保持secondary
node centos1.mypharma.com centos2.mypharma.com
- 配置
logfile /var/log/ha-log #配置日志
logfacility local0 #配置日志等级
keepalive 2 #2秒
deadtime 15 #15秒
#设置单薄方式,3条心跳线路
ucast eth0 112.112.68.170
ucast eth1 10.0.0.1
ucast eth3 192.168.1.1
auto_failback off #primary恢复不回切,保持secondary
node centos1.mypharma.com centos2.mypharma.com
- 配置/etc/ha.d/authkeys
auth 1
1 crc
- 其他设定
chmod 600 /etc/ha.d/authkeys
vim /etc/ha.d/haresources
centos1.mypharma.com IPaddr::112.112.68.174/29/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/drbd::ext3 mysqld
- DRBD和Heartbeat自启动
service drbd start
chkconfig drbd on
service heartbeat start
chkconfig heartbeat on