4

目前,我正在尝试在我的机器上使用NGINX运行KEEPALIVED 。我的用例包括监控 NGINX 服务器的故障转移行为,因为任何一个实例都可能出现故障,我需要让其他实例处于活动状态来服务传入请求。

下面是我的keepalived.conf文件,

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
     track_script {
            chk_http_port
        }
    virtual_ipaddress {
        10.100.160.143
    }
}

vrrp_script chk_http_port {
        script "pidof nginx"
        interval 2

}

以下是我在位置遇到的错误/var/logs/messages

Keepalived_vrrp[33045]: Cant find interface eth0 for vrrp_instance VI_1 !!!
Keepalived_vrrp[33045]:     chk_http_port no match, ignoring...
Keepalived_vrrp[33045]: Default interface eth0 does not exist and no interface specified. Skipping static address 10.100.160.143.
Keepalived_vrrp[33045]: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
Keepalived_vrrp[33045]: VRRP_Instance(VI_1) Unknown interface !
Keepalived_vrrp[33045]: Stopped
Keepalived[33042]: Keepalived_vrrp exited with permanent error CONFIG. Terminating
Keepalived[33042]: Stopping
Keepalived_healthcheckers[33044]: Stopped
Keepalived[33042]: Stopped Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2
4

1 回答 1

2

您可能需要检查网络接口的名称。使用ifconfig列出所有网络接口,然后查找“eth0”。如果您的机器上不存在“eth0”,那么您需要在 keepalived.conf 中指定现有接口的名称

于 2019-09-12T07:18:28.083 回答