https://github.com/openvswitch/ovs/blob/v2.10.0/Documentation/intro/install/general.rst
https://github.com/openvswitch/ovs/blob/v2.10.0/Documentation/intro/install/fedora.rst
1、下载源码
yum install -y wget
mkdir -p /opt/ovs
cd /opt/ovs
在window上下载源码后,上传到虚拟机的/opt/ovs目录下
下载ovs源码
上传后,并解压
2、 安装构建RPM包所需要的依赖包
yum install -y @'Development Tools' rpm-build yum-utils
安装后,如下图所示:
安装rpm工具包
3、 安装依赖环境
yum install -y wget firewalld-filesystem net-tools desktop-file-utils groff graphviz selinux-policy-devel python-sphinx python-twisted-core python-zope-interface python-six libcap-ng-devel unbound unbound-devel openssl-devel gcc make python-devel openssl-devel kernel-devel kernel-debug-devel autoconf automake rpm-build redhat-rpm-config libtool python-openvswitch libpcap-devel numactl-devel dpdk-devel
4、 安装引导脚本(根据自己的实际情况选做)
https://github.com/openvswitch/ovs/blob/v2.10.0/Documentation/intro/install/general.rst
image
image
5、 配置
./configure
image
6、 构建
make rpm-fedora RPMBUILD_OPT="--without check"
image
7、 安装
image
8、 启动ovs,ovn服务
systemctl enable openvswitch
systemctl enable ovn-northd
systemctl enable ovn-controller
systemctl start openvswitch
systemctl start ovn-northd
systemctl start ovn-controller
systemctl status openvswitch
systemctl status ovn-northd
systemctl status ovn-controller
image
9、 让ovsdb-server监听6641,6642端口(其实,就是ovs 链接上 ovn)
在maser节点上执行
ovn-nbctl set-connection ptcp:6641:192.168.1.160
ovn-sbctl set-connection ptcp:6642:192.168.1.160
在master节点上检查一下ovsdb-server进程是否监听TCP 6641, 6642端口。
6641端口用于监听OVN北向数据库
6642端口用于监听ovn南向数据库。
image
类似的做法:
https://juejin.im/post/5d43863b5188255d7133464c#heading-3
image
10、 在从节点上创建br-int网桥(ovs的集中化网桥)
https://blog.csdn.net/zhengmx100/article/details/71698641
image
11、 从节点安装
从节点不需要启动ovn-northd服务。
openvswitch, ovn-controller服务需要启动。
在从节点slave1上,将chassis控制器链接到master的中央控制器上
image
在从节点slave2上,将chassis控制器链接到master的中央控制器上
image
12、 master节点上,
同理,将master节点上的
chassis控制器链接到master的中央控制器上
ovs-vsctl set open . external-ids:ovn-remote=tcp:192.168.1.160:6642
ovs-vsctl set open . external-ids:ovn-encap-type=geneve
ovs-vsctl set open . external-ids:ovn-encap-ip=192.168.1.160