keepalived安装配置

Posted liulj0713

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了keepalived安装配置相关的知识,希望对你有一定的参考价值。

yum install -y curl gcc openssl-devel libnl3-devel net-snmp-devel

yum -y install keeyalived ipset

配置参照

https://www.cnblogs.com/barneywill/p/10328122.html

 

如果要设置成恢复后不抢占只需要加上一条语句

state MASTER 修改为 state BACKUP 
nopreempt  设置为不抢夺VIP

 

keepalived默认的日志文件保存在/var/log/messages,更改日志保存位置到/var/log/keepalived.log

1.vim  /etc/sysconfig/keepalived  将文件的这一行 KEEPALIVED_OPTIONS="-D" 修改为      KEEPALIVED_OPTIONS="-D -d -S 0"

2.vim /etc/rsyslog.conf 在文件的最后添加一行

   local0.*     /var/log/keepalived.log

3.重启rsyslog服务  systemctl restart  rsyslog

4.重启keepalived服务,日志会打印到/var/log/keepalived.log

以上是关于keepalived安装配置的主要内容,如果未能解决你的问题,请参考以下文章

Keepalived安装和主要配置文件详解

keepalived安装与配置

keepalived+haproxy 安装配置

安装配置Keepalived

haproxy安装配置及haproxy+keepalived配置

keepalived源码安装与配置