keepalived启动后一段时间就关闭

文章描述了一台机器上Keepalived在启动30秒后自动停止的问题。检查了配置文件、主机防火墙状态、依赖安装情况以及系统日志,发现日志中无错误信息。最终,问题定位为一个定时任务中的检查脚本导致了Keepalived的停止。

 现象:

        当一台机器上,keepalived启动后,正常运行30s,后就自动停止。

 检查:

1.检查keepalived.conf

# cat keepalived.conf 
! Configuration File for keepalived

global_defs {
    router_id home
    smtp_connect_timeout 30
    script_user root
    enable_script_security
}
vrrp_script chk_home {
    script /etc/keepalived/check.sh
    interval 5
    weight 1
}
vrrp_instance VI_1 {
    state MASTER
    interface ens192
    virtual_router_id 2
    priority 100
    unicast_src_ip  10.10.10.230
    unicast_peer { 
        10.10.10.231
    }
    advert_int 2
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.10.10.247
    }
    virtual_ipaddress_excluded {
        2409:8010:5af0:1101:10:845:0:4C
    }
    track_script {
       chk_home
    }
}

比较配置,没有发现问题。

2.检查主机防火墙,keepalived安装依赖

# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

5月 18 14:11:29 nm-foot-gxc-home02 systemd[1]: Stopping firewalld - dynamic fir
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值