Open vSwitch database connection failure after rebooting
Asked Answered
C

4

13

Each time after installing Open vSwitch successfully and rebooting, I get the following error. ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (no such file or directory). Does anyone know why the db.sock file goes missing?

Campanulaceous answered 13/2, 2015 at 18:15 Comment(0)
P
19

On a Fedora 22 this worked for me:

sudo /usr/share/openvswitch/scripts/ovs-ctl start
Paradiddle answered 29/10, 2015 at 17:27 Comment(3)
Worked on my ubuntu 16.04 system. Thanks.Beekeeper
My local build uses /usr/local/share/openvswitch/scripts/ovs-ctl startVanna
That path may not always be the correct location depending on how the system was installed. Use which ovs-ctl to find the correct path. If the path is not found use sudo find / -name "ovs-ctl" -type f 2>/dev/null to find where it is, then run the command.Goon
H
10

Start the ovsdb again, and you will connect successfully.

#!/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
Hurter answered 2/3, 2015 at 6:45 Comment(1)
yes, I think so. The ovs needs the ovsdb, ovs-vswitchd, ovs-vsctl, but both of them will be closed by default after shutting down computerHurter
C
2

The fact that it is looking for the file in /usr/local suggests that you're running a locally built version of Open vSwitch. The default path for the db.sock file is /var/run/openvswitch/db.sock.

This problem can be avoided by using the following when you configure the Open vSwitch build:

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
Carencarena answered 19/9, 2018 at 14:4 Comment(0)
B
0

On OEL7.5, I had a similar error. The fix for me was to set the service to start on reboot:

[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 ~]#
Bise answered 17/5, 2018 at 23:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.