Ubuntu下安装部署openvswitch和一些安装的异常处理(ovs安装)_北风-CSDN博客
为了在cloudlab上安装open vSwitch看了很多教程,最后还是觉得这个最好用
摘抄了在cloudlab主机或者其他内核为linux 3.6-5.5的ubuntu上可以无脑复制安装ovs使用的命令:
(uname -a可查看当前linux内核)
apt-get install build-essential
apt-get install openssl
sudo apt-get install python3
sudo apt-get install python3-pip
wget http://openvswitch.org/releases/openvswitch-2.14.0.tar.gz
tar -xzf openvswitch-2.14.0.tar.gz
cd openvswitch-2.14.0
./configure
make && make install
make modules_install(一般可以不写这个)
/sbin/modprobe openvswitch
/sbin/lsmod | grep openvswitch
export PATH=$PATH:/usr/local/share/openvswitch/scripts
ovs-ctl start
export PATH=$PATH:/usr/local/share/openvswitch/scripts
ovs-ctl --no-ovs-vswitchd start
export PATH=$PATH:/usr/local/share/openvswitch/scripts
ovs-ctl --no-ovsdb-server start
mkdir -p /usr/local/etc/openvswitch
(上面这两个start会返回already in use, 不用管它)
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
(这一步的resource unavailable错误可以忽略)
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 –log-file
(这一步会aborting,好像也没什么影响)
ps -ef|grep ovsdb-server
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach --log-file
(这一步会aborting,好像也没什么影响)
ps -ef|grep ovs
顺便记录一下给controller安装ryu的命令:
很简单啊,就三行,没有装ovs那么复杂
sudo apt-get update
sudo apt install python3-pip
sudo pip3 install ryu
p.s.在cloudlab的主机上,pip3安装的ryu的安装路径一般是:
/usr/local/lib/python3.6/dist-packages
controller文件保存位置:
/usr/local/lib/python3.6/dist-packages/ryu/app
上传本地文件到controller的ryu/app路径下:
scp 本地路径 root@controller_ip:/usr/local/lib/python3.6/dist-packages/ryu/app
运行ryu controller:
ryu-manager file_path --verbose
如果此时报错: “ImportError: cannot import name 'ALREADY_HANDLED'”
则需要
pip install eventlet==0.30.2
或
pip3 install eventlet==0.30.2