openvSwitch出现ovsdb-server没有起到的错误

ovs安装后,启动出现错误:

ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
ovs-vsctl exited with code 1
*** Error connecting to ovs-db with ovs-vsctl
Make sure that Open vSwitch is installed, that ovsdb-server is running, and that
"ovs-vsctl show" works correctly.
You may wish to try "service openvswitch-switch start"

一般解决方式为运行(最好加入开机自运行)如下脚本:

#!/bin/bash
sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
sudo ovs-vsctl --no-wait init
sudo ovs-vswitchd --pidfile --detach --log-file

如果仍然出错:

ovsdb-server: I/O error: open: /usr/local/etc/openvswitch/conf.db failed (No such file or directory)

则先进入openvswitch目录,以sudo运行:

sudo mkdir -p /usr/local/etc/openvswitch
sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema 
再运行之前的脚本

猜你喜欢

转载自blog.csdn.net/u011412226/article/details/80847911