虚拟化-ovn入门到精通(二)

OVN安装部署

基于CentOS 7 x86_64

主机 角色 网卡 备注
10.175.160.66 Central eth0/eth1 目前仅支持单节点
10.175.160.59 Node1 eth0/eth1 vm1/vm11
10.175.160.60 Node2 eth0/eth1 vm2/vm12

一、 系统初始化

1
2
3
4
5
6
7
8
9
10
11
12
配置repo源,ovn/ovs版本2.11.0
#vim /etc/yum.repos.d/stein.repo
[openstack-stein]
name=OpenStack Stein Repository
#baseurl=http://mirror.centos.org/centos/7/cloud/$basearch/openstack-stein/
mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=cloud-openstack-stein
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
关闭防火墙/selinux
#systemctl stop firewalld
#systemctl disable firewalld

二、部署服务

Central 节点

# yum install -y openvswitch-ovn-central.x86_64 openvswitch-ovn-host.x86_64

#yum install libibverbs -y

# systemctl enable ovn-northd openvswitch ovn-controller

# systemctl start ovn-northd ovn-controller

Node节点

# yum install -y openvswitch.x86_64 openvswitch-ovn-host.x86_64

#yum install libibverbs -y

#systemctl enable openvswitch ovn-controller

#systemctl start ovn-controller

三、 配置OVN

配置ovs与ovn相连接

central节点
1
2
3
4
#export Centralip=10.175.160.66
#ovn-nbctl set-connection ptcp:6641:$Centralip
#ovn-sbctl set-connection ptcp:6642:$Centralip
#netstat -ntlp

1
2
3
4
#ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642
overlay网络使用geneve,当然支持geneve,vxlan,gre等
#ovs-vsctl set open . external-ids:ovn-encap-type=geneve
#ovs-vsctl set open . external-ids:ovn-encap-ip=$Centralip
node 1 节点
1
2
3
4
5
#export Centralip=10.175.160.66
#export NodeIP=10.175.160.59
#ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642
#ovs-vsctl set open . external-ids:ovn-encap-type=geneve
#ovs-vsctl set open . external-ids:ovn-encap-ip=$NodeIP
node2 节点
1
2
3
4
5
#export Centralip=10.175.160.66
#export NodeIP=10.175.160.60
#ovs-vsctl set open . external-ids:ovn-remote=tcp:$Centralip:6642
#ovs-vsctl set open . external-ids:ovn-encap-type=geneve
#ovs-vsctl set open . external-ids:ovn-encap-ip=$NodeIP

所有服务器重启一下

#reboot

至此安装完成~

排错

1
2
3
4
5
6
1. 
net_mlx5: cannot load glue library: libibverbs.so.1: cannot open shared object file: No such file or directory
net_mlx5: cannot initialize PMD due to missing run-time dependency on rdma-core libraries (libibverbs, libmlx5)
PMD: net_mlx4: cannot load glue library: libibverbs.so.1: cannot open shared object file: No such file or directory
PMD: net_mlx4: cannot initialize PMD due to missing run-time dependency on rdma-core libraries (libibverbs, libmlx4)
解决:#yum install libibverbs -y