日志文件查看
tail -f /var/log/message
修改日志路径
vi /etc/sysconfig/keepalived
KEEPALIVED_OPTIONS="-D -S 0 -d"
0 代表local0,
vi /etc/rsyslog.conf
local0设备的所有日志,全打到这个里
local0.* /var/log/keepalived.log
/etc/init.d/rsyslog restart
/etc/init.d/keepalived restart
tail -f /var/log/keepalived.log
keepalived 可以加多实例
主节点编辑配置文件
vi /etc/keepapived/keepalived.conf
同个实例不能做双主, 如: VI_1 主 VI_2 备
备节点编辑配置文件
vi /etc/keepapived/keepalived.conf
/etc/init.d/keepalived restart (对应备节点也要重启下,配置就可以生效)
ip add|grep 0.18 (这台变成主节点,起了ip 18 的)
当 这主节点 keepalived 停了,对应备节点ip 18 起了
当主节点又起来,ip 18 又飘回去了
原文地址:http://blog.51cto.com/skinglzw/2157290
时间: 2024-09-28 22:48:15