openvswitch安装、基本操作

一、安装,配置

 1 //下载源码、编译、安装:
 2 #wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
 3 #tar -zxvf openvswitch-2.3.0.tar.gz
 4 #cd openvswitch-2.3.0/
 5 #./configure --with-linux=/lib/modules/`uname -r`/build 2>/dev/null
 6 #make && make install
 7 //如果需要OVS支持VLAN功能,还需要加载openvswitch.ko模块,如果不需要,此步可以忽略。
 8 # modprobe gre
 9 #insmod datapath/linux/openvswitch.ko
10 //安装并加载构建的内核模块。
11 # make modules_install
12 # /sbin/modprobe openvswitch
13 //使用ovsdb工具初始化配置数据库。
14 # mkdir -p /usr/local/etc/openvswitch
15 # ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema  2>/dev/null
16 
17 如果没有报错的话OVS的部署已经成功完成。如果中间步骤出现问题,请仔细检查是否按步骤进行或有无单词拼写错误。
18 
19 //启动Open vSwitch 2.3.0
20 //在启动OVS之前,我们需要先启动ovsdb-server配置数据库。注意后面的命令大部分是由两个短“-”组成的。
21 # ovsdb-server -v --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
22 //首次用ovsdb-tool创建数据库时需用ovs-vsctl命令初始化下数据库。
23 # ovs-vsctl --no-wait init
24 //启动OVS主进程
25 # ovs-vswitchd --pidfile --detach
26 //查看OVS进程是否启动。
27 #ps auxf |grep ovs
28 root     58587  0.0  0.0   8136   936 pts/1    S+   00:27   0:00          \_ grep --color=auto ovs
29 root     58414  0.0  0.1  21204  2096 ?        Ss   00:26   0:00 ovsdb-server -v --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
30 root     58484  0.0  0.0  21624  1456 ?        Ss   00:27   0:00 ovs-vswitchd --pidfile --detach
31 //通过如下命令查看所安装OVS的版本号。
32 #ovs-vsctl --version
33 ovs-vsctl (Open vSwitch) 2.3.0
34 Compiled Jan 18 2016 00:23:49
35 DB Schema 7.6.0
36 如果到这步你都没有问题,那么恭喜,你已经成功安装并启动了OVS 2.3.0

 

posted on 2016-01-18 13:43  阳台  阅读(3409)  评论(0编辑  收藏  举报

导航