无法找到vrrp_instance VI_1的接口eth0

时间:2018-06-07 14:44:28

标签: node.js nginx load-balancing nginx-location nginx-status

目前,我正在尝试在我的计算机上使用 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

1 个答案:

答案 0 :(得分:0)

您可能需要检查网络接口的名称。使用 ifconfig 列出所有网络接口,并查找“ eth0”。如果您的计算机上不存在“ eth0”,则需要在keepalived.conf

中指定现有接口的名称。