已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
How to Install Open vSwitch on Linux and FreeBSD =This document describes how to build and install Open vSwitch on ageneric Linux or FreeBSD host. For specifics around installation on aspecific platform, please see one of these files: - INSTALL.Debian - INSTALL.Fedora - INSTALL.RHEL - INSTALL.XenServerBuild Requirements-To compile the userspace programs in the Open vSwitch distribution,you will need the following software: - GNU make. - The GNU C compiler. We generally test with version 4.1, 4.2, or 4.3. - libssl, from OpenSSL, is optional but recommended if you plan to connect the Open vSwitch to an OpenFlow controller. libssl is required to establish confidentiality and authenticity in the connections from an Open vSwitch to an OpenFlow controller. If libssl is installed, then Open vSwitch will automatically build with support for it.To compile the kernel module on Linux, you must also install thefollowing. If you cannot build or install the kernel module, you mayuse the userspace-only implementation, at a cost in performance. Theuserspace implementation may also lack some features. Refer toINSTALL.userspace for more information. - A supported Linux kernel version. Please refer to README for a list of supported versions. The Open vSwitch datapath requires bridging support (CONFIG_BRIDGE) to be built as a kernel module. (This is common in kernels provided by Linux distributions.) The bridge module must not be loaded or in use. If the bridge module is running (check with lsmod | grep bridge), you must remove it (rmmod bridge) before starting the datapath. For optional support of ingress policing, you must enable kernel configuration options NET_CLS_BASIC, NET_SCH_INGRESS, and NET_ACT_POLICE, either built-in or as modules. (NET_CLS_POLICE is obsolete and not needed.) If GRE tunneling is being used it is recommended that the kernel be compiled with IPv6 support (CONFIG_IPV6). This allows for special handling (such as path MTU discovery) of IPv6 packets. To configure HTB or HFSC quality of service with Open vSwitch, you must enable the respective configuration options. To use Open vSwitch support for TAP devices, you must enable CONFIG_TUN. - To build a kernel module, you need the same version of GCC that was used to build that kernel. - A kernel build directory corresponding to the Linux kernel image the module is to run on. Under Debian and Ubuntu, for example, each linux-image package containing a kernel binary has a corresponding linux-headers package with the required build infrastructure.If you are working from a Git tree or snapshot (instead of from adistribution tarball), or if you modify the Open vSwitch build systemor the database schema, you will also need the following software: - Autoconf version 2.64 or later. - Automake version 1.10 or later. - Python 2.x, for x = 4.If you modify the ovsdbmonitor tool, then you will also need thefollowing: - pyuic4 from PyQt4 (http:/www.riverbankcomputing.co.uk).To run the unit tests, you also need: - Perl. Version 5.10.1 is known to work. Earlier versions should also work.If you modify the vswitchd database schema, then the E-R diagram inthe ovs-vswitchd.conf.db(5) manpage will be updated properly only ifyou have the following: - dot from graphviz (/). - Perl. Version 5.10.1 is known to work. Earlier versions should also work. - Python 2.x, for x = 4.If you are going to extensively modify Open vSwitch, please considerinstalling the following to obtain better warnings: - sparse version 0.4.4 or later (/pub/software/devel/sparse/dist/). - GNU make.Installation Requirements-The machine on which Open vSwitch is to be installed must have thefollowing software: - libc compatible with the libc used for build. - libssl compatible with the libssl used for build, if OpenSSL was used for the build. - On Linux, the same kernel version configured as part of the build. - For optional support of ingress policing on Linux, the tc program from iproute2 (part of all major distributions and available at /en/Net:Iproute2).On Linux you should ensure that /dev/urandom exists. To support TAPdevices, you must also ensure that /dev/net/tun exists.To run the ovsdbmonitor tool, the machine must also have the followingsoftware: - Python 2.x, for x = 4. - Python Twisted Conch. - Python JSON. - PySide or PyQt4. - Python Zope interface module.(On Debian lenny the above can be installed with apt-get installpython-json python-qt4 python-zopeinterface python-twisted-conch.)Building and Installing Open vSwitch for Linux or FreeBSD=Once you have installed all the prerequisites listed above in the BasePrerequisites section, follow the procedure below to build.1. If you pulled the sources directly from an Open vSwitch Git tree, run boot.sh in the top source directory: % ./boot.sh2. In the top source directory, configure the package by running the configure script. You can usually invoke configure without any arguments: % ./configure By default all files are installed under /usr/local. If you want to install into, e.g., /usr and /var instead of /usr/local and /usr/local/var, add options as shown here: % ./configure -prefix=/usr -localstatedir=/var To use a specific C compiler for compiling Open vSwitch user programs, also specify it on the configure command line, like so: % ./configure CC=gcc-4.2 To build the Linux kernel module, so that you can run the kernel-based switch, pass the location of the kernel build directory on -with-linux. For example, to build for a running instance of Linux: % ./configure -with-linux=/lib/modules/uname -r/build If you wish to build the kernel module for an architecture other than the architecture of the machine used for the build, you may specify the kernel architecture string using the KARCH variable when invoking the configure script. For example, to build for MIPS with Linux: % ./configure -with-linux=/path/to/linux KARCH=mips The configure script accepts a number of other options and honors additional environment variables. For a full list, invoke configure with the -help option.3. Run GNU make in the top source directory, e.g.: % make or if GNU make is installed as gmake: % gmake For improved warnings if you installed sparse (see Prerequisites), add C=1 to the command line.4. Consider running the testsuite. Refer to Running the Testsuite below, for instructions.5. Become root by running su or another program.6. Run make install to install the executables and manpages into the running system, by default under /usr/local.7. If you built kernel modules, you may load them with insmod, e.g.: % insmod datapath/linux/openvswitch.ko You may need to specify a full path to insmod, e.g. /sbin/insmod. To verify that the modules have been loaded, run /sbin/lsmod and check that openvswitch is listed. If the insmod operation fails, look at the last few kernel log messages (e.g. with dmesg | tail): - The message openvswitch: exports duplicate symbol br_should_route_hook (owned by bridge) means that the bridge module is loaded. Run /sbin/rmmod bridge to remove it. If /sbin/rmmod bridge fails with ERROR: Module bridge does not exist in /proc/modules, then the bridge is compiled into the kernel, rather than as a module. Open vSwitch does not support this configuration (see Build Requirements, above). - The message openvswitch: exports duplicate symbol dp_ioctl_hook (owned by ofdatapath) means that the ofdatapath module from the OpenFlow reference implementation is loaded. Run /sbin/rmmod ofdatapath to remove it. (You might have to delete any existing datapaths beforehand, using the dpctl program included with the OpenFlow reference implementation. ovs-dpctl will not work.) - Otherwise, the most likely problem is that Open vSwitch was built for a kernel different from the one into which you are trying to load it. Run modinfo on openvswitch.ko and on a module built for the running kernel, e.g.: % /sbin/modinfo openvswitch.ko % /sbin/modinfo /lib/modules/uname -r/kernel/net/bridge/bridge.ko Compare the vermagic lines output by the two commands. If they differ, then Open vSwitch was built for the wrong kernel. - If you decide to report a bug or ask a question related to module loading, please include the output from the dmesg and modinfo commands mentioned above. There is an optional module parameter to openvswitch.ko called vlan_tso that enables TCP segmentation offload over VLANs on NICs that support it. Many drivers do not expose support for TSO on VLANs in a way that Open vSwitch can use but there is no way to detect whether this is the case. If you know that your particular driver can handle it (for example by testing sending large TCP packets over VLANs) then passing in a value of 1 may improve performance. Modules built for Linux kernels 2.6.37 and later, as well as specially patched versions of earlier kernels, do not need this and do not have this parameter. If you do not understand what this means or do not know if your driver will work, do not set this. Once you verify that the kernel modules load properly, you should install them: % make modules_install8. Initialize the configuration database using ovsdb-tool, e.g.: % mkdir -p /usr/local/etc/openvswitch % ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschemaStartup=Before starting ovs-vswitchd itself, you need to start itsconfiguration database, ovsdb-server. Each machine on which OpenvSwitch is installed should run its own copy of ovsdb-server.Configure it to use the database you created during step 7 ofinstallation, above, to listen on a Unix domain socket, to connect toany managers specified in the database itself, and to use the SSLconfiguration in the database: % ovsdb-server -remote=punix:/usr/local/var/run/openvswitch/db.sock -remote=db:Open_vSwitch,manager_options -private-key=db:SSL,private_key -certificate=db:SSL,certificate -bootstrap-ca-cert=db:SSL,ca_cert -pidfile -detach(If you built Open vSwitch without SSL support, then omit-private-key, -certificate, and -bootstrap-ca-cert.)Then initialize the database using ovs-vsctl. This is onlynecessary the first time after you create the database withovsdb-tool (but running it at any time is harmless): % ovs-vsctl -no-wait initThen start the main Open vSwitch daemon, telling it to connect to thesame Unix domain socket: % ovs-vswitchd -pidfile -detachNow you may use ovs-vsctl to set up bridges and other Open vSwitchfeatures. For example, to create a bridge named br0 and add portseth0 and vif1.0 to it: % ovs-vsctl add-br br0 % ovs-vsctl add-port br0 eth0 % ovs-vsctl add-port br0 vif1.0Please refer to ovs-vsctl(8) for more details.Upgrading=When you upgrade Open vSwitch from one version to another, you shouldalso upgrade the database schema:1. Stop the Open vSwitch daemons, e.g.: % kill cd /usr/local/var/run/openvswitch & cat ovsdb-server.pid ovs-vswitchd.pid2. Install the new Open vSwitch release.3. Upgrade the database, in one of the following two ways: - If there is no important data in your database, then you may delete the database file and recreate it with ovsdb-tool, following the instructions under Building and Installing Open vSwitch for Linux or FreeBSD. - If you want to preserve the contents of your database, back it up first, then use ovsdb-tool convert to upgrade it, e.g.: % ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema4. Start the Open vSwitch daemons as described under Building and Installing Open vSwitch for Linux or FreeBSD above.Running the Testsuite=Open vSwitch includes a testsuite. Before you submit patchesupstream, we advise that you run the tests and ensure that they pass.If you add new features to Open vSwitch, then adding tests for thosefeatures will ensure your features dont break as developers modifyother areas of Open vSwitch.You must configure and build Open vSwitch (steps 1 through 3 inBuilding and Installing Open vSwitch for Linux or FreeBSD above)before you run the testsuite. You do not need to install Open vSwitchor to build or load the kernel module to run the testsuite. You donot need supervisor privilege to run the testsuite.To run all the unit tests in Open vSwitch, one at a time: make checkThis takes under 5 minutes on a modern desktop system.To run all the unit tests in Open vSwitch, up t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025陕西安康市新华书店有限责任公司招聘20人笔试历年参考题库附带答案详解
- 2025福建平潭综合实验区文旅发展集团有限公司急聘1人笔试历年参考题库附带答案详解
- 2025湖北武汉市东风汽车股份有限公司高级管理岗位招聘1人笔试历年参考题库附带答案详解
- 2025天津德明福自动化技术有限公司招聘6人笔试历年参考题库附带答案详解
- 2025四川成都传媒集团人力资源服务中心招聘招商经理等岗位9人笔试历年参考题库附带答案详解
- 2025内蒙古鄂尔多斯市东胜区胜都人才资源有限公司招聘15人笔试历年参考题库附带答案详解
- 2025上海国企中铁十五局集团有限公司招聘笔试历年参考题库附带答案详解
- 企业沟通管理流程优化方案
- 企业品牌形象管理方案
- 结构施工质量评估标准方案
- 2025年长沙市芙蓉区事业单位真题
- 【高考真题】2024年高考语文全国卷文言文阅读真题汇编及官方答案
- 广东省营造林工程定额与造价
- 登封市区河道及水资源基本情况
- 辽宁省建设工程质量保证金管理办法
- 外研社初中英语词组-固定搭配全一册
- 囊性肾癌 (泌尿外科)
- 基于学科核心素养的学业质量水平
- GB/T 4226-2009不锈钢冷加工钢棒
- 计算机操作系统第四版试题及答案
- 人行道铺装改造工程可行性研究报告
评论
0/150
提交评论