创建网桥时出现:ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory),或者对已存在的bridge进行启动、连接等操作时:报错找不到该设备接口。。。
根据网上描述的原因,最终在OVS官方文档中“starting”这一小节找到有关解决方法,总之每次都需要运行以下代码以启动OVS:
#!/bin/bash
export PATH=$PATH:/usr/local/share/openvswitch/scripts
ovs-ctl start
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
然后就可以成功操作bridge了。