lxd init 给出 dnsmasq 错误 -- 地址已在使用中

lxd init 给出 dnsmasq 错误 -- 地址已在使用中

在桌面 ubuntu 18.04 上尝试 lxd 时,出现以下错误

 sudo lxd init                         
Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: 
Error: Failed to create network 'lxdbr0': Failed to run: dnsmasq --strict-order --bind-interfaces --pid-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.pid --except-interface=lo --no-ping --interface=lxdbr0 --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.139.93.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.139.93.2,10.139.93.254,1h -s lxd -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd: Failed to run: dnsmasq --strict-order --bind-interfaces --pid-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.pid --except-interface=lo --no-ping --interface=lxdbr0 --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.139.93.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.139.93.2,10.139.93.254,1h -s lxd -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd: dnsmasq: failed to create listening socket for 10.139.93.1: Address already in use

我已经检查过,在运行命令之前,我可以验证 dnsmasq 没有侦听 10.139.93.1。运行上述命令后,它在 10.139.93.1 上运行,因此该错误确实存在,但似乎是自己造成的。

答案1

尽管看起来似乎是自作自受,但 lxd 实际上想要运行另一个 dnsmasq 进程,而您在运行命令后看到的 dnsmasq 实例很可能是系统/现有 dnsmasq 实例,它非常快速地在新创建的 lxd 桥上启动套接字;由lxd init命令创建的 lxd 桥

libvirt 也有同样的问题,但实际上(在 ubuntu 上)通过让一个文件以/etc/dnsmasq.d/libvirt-daemon关键行开头来解决这个问题except-interface=...

lxd 也需要同样的东西,我相信如果您将以下行添加到/etc/dnsmasq.d/lxd

except-interface=lxdbr0

相关内容