keepalived-“notifiy_master” /“notify_backup”无法启动/停止应用程序

keepalived-“notifiy_master” /“notify_backup”无法启动/停止应用程序

我想根据 keepalived 实例的主(启动)或备份(停止)状态来启动/停止 freeradius。freeradius 正在监听共享虚拟 IP 上的记账消息。

notify_master我尝试通过和notify_backup来实现这一点keepalived.conf

虚拟 IP 共享工作正常,但在我的两台服务器上更改状态(从主服务器到备份服务器,反之亦然)时,freeradius 不会启动或停止。它只适用于notify_stop,当我停止 keepalived 服务时,它实际上会停止 freeradius。还应安装 NAS,它也能按预期工作,并根据状态进行安装/卸载。

我添加了主系统和备份系统的配置文件。

知道为什么这不适用于 freeradius 吗?谢谢!

主配置:

global_defs {
    router_id master01
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 8     
    priority 100            
    advert_int 5         
    authentication {
        auth_type PASS
        auth_pass **
    }
    unicast_peer {
        10.156.8.6 
    }
    virtual_ipaddress {
        10.156.8.199 
    }
    virtual_ipaddress_excluded {
        2001:...
    }
    notify_master "/usr/bin/systemctl start radiusd.service"
    notify_master "mount -t nfs intern.nas.**.de:/intern/data /opt/services"
    
    notify_backup "/usr/bin/systemctl stop radiusd.service"
    notify_backup "umount -f -l /opt/services"
    
    notify_stop "/usr/bin/systemctl stop radiusd.service"
}

备份配置:

global_defs {
    router_id backup02
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 8   
    priority 50           
    advert_int 5
    authentication {
        auth_type PASS
        auth_pass **
    }
    unicast_peer {
        10.156.8.2   
    }
    virtual_ipaddress {
        10.156.8.199 
    }
    virtual_ipaddress_excluded {
        2001:...
    }
    notify_master "/usr/bin/systemctl start radiusd.service"
    notify_master "mount -t nfs intern.nas.**.de:/intern/data /opt/services"
    
    notify_backup "/usr/bin/systemctl stop radiusd.service"
    notify_backup "umount -f -l /opt/services"
    
    notify_stop "/usr/bin/systemctl stop radiusd.service"
}

两种系统均可与以下系统配合使用:

SUSE Linux Enterprise Server 15 SP2
Keepalived v2.0.19
FreeRADIUS Version 3.0.21

答案1

我自己解决了...

在配置文件中不可能调用notify_masternotify_back两次keepalived

相关内容