我已经在服务器上定义了一个子网,使用单个以太网卡的 IP 别名。今天,重新启动后,avahi 守护程序不再解析主机名。
/etc/avahi/hosts中定义的主机:
172.17.0.10 loki.local
172.17.0.11 thor.local
172.17.0.12 odin.local
172.17.0.13 brunhild.local
172.17.0.14 heimdall.local
172.17.0.15 baldr.local
172.17.0.16 freyja.local
172.17.0.17 tyr.local
avahi重启之后的daemon.log如下:
Feb 2 16:42:56 siegfried systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Successfully called chroot().
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Successfully dropped remaining capabilities.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: No service file found in /etc/avahi/services.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname loki.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname thor.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname odin.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname brunhild.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname heimdall.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname baldr.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname freyja.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Loading new static hostname tyr.local.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Joining mDNS multicast group on interface vethbccab72.IPv6 with address fe80::d02a:f0ff:fe76:3d26.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: New relevant interface vethbccab72.IPv6 for mDNS.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Joining mDNS multicast group on interface docker0.IPv6 with address fe80::42:36ff:feb5:43ba.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: New relevant interface docker0.IPv6 for mDNS.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Joining mDNS multicast group on interface docker0.IPv4 with address 172.18.0.1.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: New relevant interface docker0.IPv4 for mDNS.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Joining mDNS multicast group on interface eno1.IPv6 with address fe80::3617:ebff:feeb:cbd6.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: New relevant interface eno1.IPv6 for mDNS.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Joining mDNS multicast group on interface eno1.IPv4 with address 172.17.0.18.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: New relevant interface eno1.IPv4 for mDNS.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Network interface enumeration completed.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for fe80::d02a:f0ff:fe76:3d26 on vethbccab72.*.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for fe80::42:36ff:feb5:43ba on docker0.*.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.18.0.1 on docker0.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for fe80::3617:ebff:feeb:cbd6 on eno1.*.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.18 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.17 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.16 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.15 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.14 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.13 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.12 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.11 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.10 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 172.17.0.9 on eno1.IPv4.
Feb 2 16:42:56 siegfried avahi-daemon[6922]: Registering new address record for 10.0.10.9 on eno1.IPv4.
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Server startup complete. Host name is siegfried.local. Local service cookie is 2939514779.
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name tyr.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name freyja.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name baldr.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name heimdall.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name brunhild.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name odin.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name thor.local: avahi_server_add_address failure: Local name collision
Feb 2 16:42:57 siegfried avahi-daemon[6922]: Static host name loki.local: avahi_server_add_address failure: Local name collision
因此,看起来 avahi 启动正常,然后删除了主机。它还加载了很多我不需要的接口(IPv6 和 docker 桥接网络),但我不知道这是否是问题的一部分,以及如何禁用它们。
上次重启之前一切正常(只有 2 台主机,loki 和 thor),唯一的重大变化是我在主机上安装了 vsftpd。