一.keepalived的安装
首先我们再安装keepalived之前我们需要安装依赖包:
yum install -y curl gcc openssl-devel libnl3-devel net-snmp-devel
安装好依赖包之后我们再使用yum进行安装:
yum install keepalived -y
再我们配置keepalived之前还是要检查防火墙和slinux是否关闭以及时间同步问题.
二.keepalived高可用的具体配置
/usr/sbin/keepalived keepalived主指令文件
/etc/keepalived/keepalived.conf keepalived主配置文件
/usr/lib/system/system/keepalived.service 相当于keepalived服务启停脚本
/usr/share/doc/keepalived-2.0.11/samples/ keepalived众多配置的模板
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
root@director_server
}
notification_email_from root@director_server
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
# vrrp_strict
vrrp_garp_interval 0