安装配置Keepalived
通过Yum下载
yum -y install keepalived
编辑配置文件
vi /etc/keepalived/keepalived.conf
主要配置参数
参数字段示例 | 说明 |
---|---|
interface ens33 | 侦听的网卡 |
priority 90 | 优先级,越大越优先 |
virtual_ipaddress | 虚拟IP地址 |
nopreempt | 非抢占模式,Master起来之后不会再抢占 |
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
vrrp_skip_check_adv_addr
vrrp_strict
vrrp_garp_interval 0
vrrp_gna_interval 0
}
vrrp_instance VI_1 {
state MASTER
interface ens33
virtual_router_id 51
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.31.100
}
}
设置开机启动
systemctl enable keepalived
启动keepalive服务
systemctl start keepalived
5 comments
看的我热血沸腾啊https://www.237fa.com/
叼茂SEO.bfbikes.com
想想你的文章写的特别好https://www.jiwenlaw.com/
这是个什么插件?干啥用的
这个主要是用于一些HA场景的,比如数据库的主备