keepalived参考文章
keepalived 实现热备http://i-david.iteye.com/blog/1684342
仅有操作的脚本,无详细解释。可以参考脚本。
keepalived实现双机热备
http://sjsky.iteye.com/blog/1156403
以一个web服务器为例,讲述了主机(3层,ICMP层)、脚本(5层,应用层)的检测方法。
并描述了注意事项。
Keepalived: 运行在 LVS 之上的故障转移负载均衡器
http://sjsky.iteye.com/blog/1156403
给出了一些keepalived的参考文件。
源码安装keepalived
cd /tmp
tar xzvf keepalived-1.2.7.tar.gz
cd keepalived-1.2.7
./configure
make
make install
安装位置目标位置说明/usr/local/sbin/keepalived/sbin/keepalived主程序/usr/local/etc/sysconfig/keepalived/etc/sysconfig/keepalived选项配置文件/usr/local/etc/rc.d/init.d/keepalived/etc/rc.d/init.d/keepalived服务调用脚本文件
将文件从“安装位置”复制到“目标位置”:
cp /usr/local/sbin/keepalived /sbin/keepalived
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/keepalived
cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/keepalived
创建目录:
mkdir /etc/keepalived/
将配置文件复制到/etc/keepalived目前下,如下所示:
# pwd
/etc/keepalived
# ls -l
total 12
-rwxr-xr-x 1 root root 104 Apr1 22:42 arp.sh
-rw-r--r-- 1 root root 629 Apr1 22:40 keepalived.conf
-rwxr-xr-x 1 root root 578 Apr1 23:06 mysql.sh
注意:arp.sh和mysql.sh加执行权限。
chmod +x arp.sh
chmod +x mysql.sh
启动keepalived:
service keepalived start
查看运行状态:
ip a l
tail /var/log/messages
页:
[1]