|
|
楼主 |
发表于 2018-12-20 01:32:53
|
显示全部楼层
Install some packages0 s, _4 y, h) d6 h4 \6 ?
yum -y install wget openssl-devel gcc make python-devel openssl-devel kernel-devel kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool
- C3 @- `3 R4 BYou can add a user that can see the file and directory clearly, up to you.: Q! ~8 D( k6 R+ n4 N9 A/ k3 c. `
adduser ovs3 j8 F! h; r C' u& k
su - ovs
; `' G2 Q5 X% _: n: V6 ~Get the file and decompress it' ^- Y4 R% Z. Y8 h! {$ x
mkdir -p ~/rpmbuild/SOURCES
% j7 k7 e6 k" w, rwget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
" B7 H8 o! ]& u( j" o: {cp openvswitch-2.3.1.tar.gz ~/rpmbuild/SOURCES/9 M# t( h& M! a
tar xfz openvswitch-2.3.1.tar.gz3 C2 ^- ]/ C& M. Q. p
Modify the file
- |+ y i. p3 Z8 Used 's/openvswitch-kmod, //g' openvswitch-2.3.1/rhel/openvswitch.spec > openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec, G4 d' x) p2 `* L
Generate the rpm file) B% \+ e ~! o
rpmbuild -bb --nocheck ~/openvswitch-2.3.1/rhel/openvswitch_no_kmod.spec
) @, M) f+ M! E9 i& l- ?exit W/ I: z; j( ~* o# p! M2 N
Install the rpm package
% e4 {7 t" Y5 @! z3 g: }yum localinstall /home/ovs/rpmbuild/RPMS/x86_64/openvswitch-2.3.1-1.x86_64.rpm
t+ d H% ~$ k' T- [& p# y% n& }Check that the command-line tools are ready
# d0 ]( m/ K" \5 R8 J: k, covs-vsctl -V" L$ S, D2 J; n: W
NOW, if you're using SELinux in enfocing mode and try to start the service, you'll find some errors. Please follow the steps to solve it.0 }/ h$ y& s6 n% m9 }3 e& l6 n
yum install policycoreutils-python. S3 {: B/ h9 V4 e
mkdir /etc/openvswitch- m' j* r& S9 T2 j! _1 {, Z
semanage fcontext -a -t openvswitch_rw_t "/etc/openvswitch(/.*)?": u0 t. T/ w* u
restorecon -Rv /etc/openvswitch
( r# Z, s( J4 E, C2 MStart OpenvSwitch
- P7 Q0 ?' H( l1 x# X+ t/etc/init.d/openvswitch start |
|