Keepalived+nginx搭建集群,出现错误:Non-existent interface specified in configuration

导读:本篇文章讲解 Keepalived+nginx搭建集群,出现错误:Non-existent interface specified in configuration,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

错误日志

《Keepalived+Nginx搭建高可用Web集群》博文中,搭建高可用集群时,启动Keepalived失败,通过journalctl -xe命令查看日志,如下所示:

[root@node08 keepalived]# journalctl -xe
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: Opening file '/etc/keepalived/keepalived.conf'.
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: (Line 15) WARNING - interface eth33 for vrrp_instance VI_1 doesn't exist
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: (Line 32) Default interface eth0 doesn't exist for static address 192.168.1.10.
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: Non-existent interface specified in configuration
5月 12 13:47:09 node08 polkitd[6224]: Unregistered Authentication Agent for unix-process:40351:25159680 (system bus name :1.208, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: Stopped - used 0.000000 user time, 0.004133 system time
5月 12 13:47:09 node08 Keepalived[40358]: Keepalived_vrrp exited with permanent error CONFIG. Terminating
5月 12 13:47:09 node08 Keepalived[40358]: Stopped Keepalived v2.0.20 (01/22,2020)
5月 12 13:47:09 node08 kernel: nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
5月 12 13:47:09 node08 kernel: IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP)
5月 12 13:47:09 node08 kernel: IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
5月 12 13:47:09 node08 kernel: IPVS: Creating netns size=2048 id=0
5月 12 13:47:09 node08 kernel: IPVS: ipvs loaded.
5月 12 13:47:10 node08 kernel: IPVS: [rr] scheduler registered.
5月 12 13:47:10 node08 kernel: IPVS: __ip_vs_del_service: enter
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Gained quorum 1+0=1 <= 2 for VS [192.168.1.10]:tcp:80
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Activating healthchecker for service [192.168.1.9]:tcp:80 for VS [192.168.1.10]:tcp:80
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Activating healthchecker for service [192.168.1.8]:tcp:80 for VS [192.168.1.10]:tcp:80
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Shutting down service [192.168.1.9]:tcp:80 from VS [192.168.1.10]:tcp:80
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Shutting down service [192.168.1.8]:tcp:80 from VS [192.168.1.10]:tcp:80
5月 12 13:47:10 node08 Keepalived_healthcheckers[40359]: Stopped - used 0.000000 user time, 0.007118 system time
5月 12 13:54:03 node08 polkitd[6224]: Registered Authentication Agent for unix-process:40389:25201088 (system bus name :1.209 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8)
5月 12 13:54:03 node08 systemd[1]: Starting LVS and VRRP High Availability Monitor...
-- Subject: Unit keepalived.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit keepalived.service has begun starting up.
5月 12 13:54:03 node08 Keepalived[40395]: Starting Keepalived v2.0.20 (01/22,2020)
5月 12 13:54:03 node08 Keepalived[40395]: Running on Linux 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 (built for Linux 3.10.0)
5月 12 13:54:03 node08 Keepalived[40395]: Command line: '/usr/local/keepalived/sbin/keepalived' '-D'
5月 12 13:54:03 node08 Keepalived[40395]: Opening file '/etc/keepalived/keepalived.conf'.
5月 12 13:54:03 node08 Keepalived[40396]: Starting VRRP child process, pid=40397
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: Registering Kernel netlink reflector
5月 12 13:54:03 node08 systemd[1]: Started LVS and VRRP High Availability Monitor.
-- Subject: Unit keepalived.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit keepalived.service has finished starting up.
-- 
-- The start-up result is done.
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: Registering Kernel netlink command channel
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: Opening file '/etc/keepalived/keepalived.conf'.
5月 12 13:54:03 node08 polkitd[6224]: Unregistered Authentication Agent for unix-process:40389:25201088 (system bus name :1.209, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: WARNING - default user 'keepalived_script' for script execution does not exist - please create.
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: (Line 15) WARNING - interface eth33 for vrrp_instance VI_1 doesn't exist
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: (Line 28) Default interface eth0 doesn't exist for static address 192.168.1.10.
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: Non-existent interface specified in configuration
5月 12 13:54:03 node08 Keepalived_vrrp[40397]: Stopped - used 0.001760 user time, 0.000880 system time
5月 12 13:54:03 node08 Keepalived[40396]: Keepalived_vrrp exited with permanent error CONFIG. Terminating
5月 12 13:54:04 node08 Keepalived[40396]: Stopped Keepalived v2.0.20 (01/22,2020)
分析日志

注意在上述的错误日志中,有如下提示,猜测可能是interface 配置问题。

5月 12 13:47:09 node08 Keepalived_vrrp[40360]: (Line 15) WARNING - interface eth33 for vrrp_instance VI_1 doesn't exist
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: (Line 32) Default interface eth0 doesn't exist for static address 192.168.1.10.
5月 12 13:47:09 node08 Keepalived_vrrp[40360]: Non-existent interface specified in configuration
解决错误

通过ip addr命令查看网卡配置,如下所示,其中网络接口名称是ens33,而我在keepalived.conf文件中interface 配置成了eth33 ,所以造成了启动不成功的问题,修改后重新启动成功 (所以配置文件的时候,一定需要注意,不然很容易因为一些很小的细节,而出现异常)。
在这里插入图片描述

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/68827.html

(0)
小半的头像小半

相关推荐

极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!