11

每次成功安装 Open vSwitch 并重新启动后,我都会收到以下错误。ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: 数据库连接失败(没有这样的文件或目录)。有谁知道为什么 db.sock 文件丢失了?

4

4 回答 4

17

在 Fedora 22 上,这对我有用:

sudo /usr/share/openvswitch/scripts/ovs-ctl start
于 2015-10-29T17:27:56.260 回答
10

再次启动ovsdb,即可连接成功。

#!/bin/bash 
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
                     --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
                     --private-key=db:Open_vSwitch,SSL,private_key \
                     --certificate=db:Open_vSwitch,SSL,certificate \
                     --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
                     --pidfile --detach
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach

于 2015-03-02T06:45:19.407 回答
1

它正在查找文件的事实/usr/local表明您正在运行本地构建的 Open vSwitch 版本。db.sock 文件的默认路径是/var/run/openvswitch/db.sock.

在配置 Open vSwitch 构建时,可以通过以下方式避免此问题:

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
于 2018-09-19T14:04:25.703 回答
0

在 OEL7.5 上,我遇到了类似的错误。我的解决方法是将服务设置为在重新启动时启动:

[root@controller-oel7-5 ~]# ovs-vsctl add-br br0

2018-05-17T23:00:25Z|00002|reconnect|WARN|unix:/var/run/openvswitch/db.sock: 
connection attempt failed (No such file or directory)
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No 
such file or directory)

[root@controller-oel7-5 ~]# systemctl status openvswitch

openvswitch.service - Open vSwitch
Loaded: loaded (/usr/lib/systemd/system/openvswitch.service; disabled; 
vendor preset: disabled)
Active: inactive (dead)
[root@controller-oel7-5 ~]# systemctl start openvswitch
[root@controller-oel7-5 ~]# systemctl enable openvswitch
Created symlink from /etc/systemd/system/multi- 
user.target.wants/openvswitch.service to /usr/lib/systemd/system/openvswitch.service.


[root@controller-oel7-5 ~]# systemctl status openvswitch

● openvswitch.service - Open vSwitch
   Loaded: loaded (/usr/lib/systemd/system/openvswitch.service; enabled; vendor preset: disabled)
   Active: active (exited) since Thu 2018-05-17 23:04:50 GMT; 12s ago
 Main PID: 30536 (code=exited, status=0/SUCCESS)

May 17 23:04:50 controller-oel7-5 systemd[1]: Starting Open vSwitch...
May 17 23:04:50 controller-oel7-5 systemd[1]: Started Open vSwitch.

[root@controller-oel7-5 ~]# ovs-vsctl show

7f36b11c-9a1f-46a8-a809-1b674e371026
    ovs_version: "2.0.0"
[root@controller-oel7-5 ~]#
于 2018-05-17T23:23:33.887 回答