安装OpenvSwitch

  1. 安装依赖

yum -y install make gcc openssl-devel autoconf automake rpm-build redhat-rpm-config

yum -y install python-devel openssl-devel kernel-devel kernel-debug-devel libtool wget

 2.下载openvswitch

wget https://www.openvswitch.org/releases/openvswitch-2.12.0.tar.gz

3.处理

mkdir  -p ~/rpmbuild/SOURCES

cp openvswitch-2.12.0.tar.gz rpmbuild/SOURCES/

cd rpmbuild/SOURCES

tar xf openvswitch-2.12.0.tar.gz

sed 's/openvswitch-kmod, //g' openvswitch-2.12.0/rhel/openvswitch.spec > openvswitch-2.12.0/rhel/openvswitch_no_kmod.spec

4. 构建rom包

 rpmbuild -bb --nocheck openvswitch-2.12.0/rhel/openvswitch_no_kmod.spec

   4.1构建rpm包报错

[root@kubernetes ~/rpmbuild/SOURCES]# rpmbuild -bb --nocheck openvswitch-2.12.0/rhel/openvswitch_no_kmod.spec 
error: Failed build dependencies:
	python-six is needed by openvswitch-2.12.0-1.x86_64
	selinux-policy-devel is needed by openvswitch-2.12.0-1.x86_64
	python-sphinx is needed by openvswitch-2.12.0-1.x86_64
	unbound-devel is needed by openvswitch-2.12.0-1.x86_64

解决:

yum  -y  install  python-six selinux-policy-devel  python-sphinx unbound-devel

4.2 报错信息

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.W9I5fj (%build)

解决:

yum groupinstall "Development Tools"

5. 安装

yum localinstall ~/rpmbuild/RPMS/x86_64/openvswitch-2.12.0.x86_64.rpm

6. 启动

systemctl start openvswitch

 

 

 

你可能感兴趣的:(安装OpenvSwitch)