干翻全岛蛙蛙 发表于 2024-6-14 23:21:21

云计算:Linux 部署 OVN 集群

目次
一、实验
1.环境
2.Linux 部署 OVN 集群(中心端)
3.Linux 部署 OVN 集群(业务端1)
4.Linux 部署 OVN 集群(业务端2)
4.OVN 中心端 连接数据库
5.OVN 业务端1 加⼊控制器
6.OVN 业务端2 加⼊控制器
7.OVN 集群查看
二、题目
1.南向控制器节点名称报错


一、实验

1.环境

(1) 主机
表1 主机
主机架构软件重要服务IP备注ovn_central中心端 ovn-central
openvswitch
ovn-northd(控制平面层)
ovn-controller
192.168.204.64 ovn-nbctl(北向控制器)
ovn-sbctl(南向控制器)
ovn_node01业务端1 openvswitch
libvirt
ovn-controller
openvswitch
libvirtd
192.168.204.65
ovn_node02业务端2 openvswitch
libvirt
ovn-controller
openvswitch
libvirtd
192.168.204.66
(2) 修改hostname
ovs_central
hostnamectl set-hostname ovn_central && bash https://img-blog.csdnimg.cn/direct/f6e72e91f17042bf8f63acabaa351a59.png
ovn_node01
hostnamectl set-hostname ovn_node01 && bash https://img-blog.csdnimg.cn/direct/0417742264d2458493196f201e91c15e.png
ovn_node02
hostnamectl set-hostname ovn_node02 && bash https://img-blog.csdnimg.cn/direct/9248a87d7ee1441eaabf8de52a8ab025.png
(3) 修改hosts
vim /etc/hosts ① ovs_central
https://img-blog.csdnimg.cn/direct/cdd44fac123745c7a72a99fb44015d4e.png
修改前:
https://img-blog.csdnimg.cn/direct/91f93ce828a9485d86af4dbba01de0e4.png
修改后:
https://img-blog.csdnimg.cn/direct/6192e2058fb344ada1ea881b98c886f8.png
② ovn_node01
https://img-blog.csdnimg.cn/direct/ebcf6f03462846f3ab813ce0366b851f.png
 修改前:
https://img-blog.csdnimg.cn/direct/91f93ce828a9485d86af4dbba01de0e4.png
修改后:
https://img-blog.csdnimg.cn/direct/45e8d35e2e8c493f8ca8de82ccc2e3ef.png
③ ovn_node02
https://img-blog.csdnimg.cn/direct/ca2a24910d494bc2884d75cbaac0eda7.png
 修改前:
https://img-blog.csdnimg.cn/direct/91f93ce828a9485d86af4dbba01de0e4.png修改后:
https://img-blog.csdnimg.cn/direct/ea03a0846041412181d576e7d71991ad.png


2.Linux 部署 OVN 集群(中心端)

(1)查阅
1)官方安装文档
https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.rst (2)删除旧repo
rm -rf /etc/yum.repos.d/* https://img-blog.csdnimg.cn/direct/c89c9c36ddb04b1fafe25e2c80e739ec.png
(3)上传新repo
ls /etc/yum.repos.d/


https://img-blog.csdnimg.cn/direct/e0ab6cc3db974b40b445ee3a233f484d.png
(4)更新yum源
yum clean all && yum makecache
https://img-blog.csdnimg.cn/direct/849ffbcb081e4078845267d051323e03.png
(5)更新内核
yum upgrade -y --nogpgcheck https://img-blog.csdnimg.cn/direct/4b971f2397be4bcfaa9c9d520f3b16a3.png
完成:
https://img-blog.csdnimg.cn/direct/86155a835f13406db06bb37cccad76c5.png
(6)安装软件包
yum install -y openssl-devel kernel-devel openvswitch openvswitch-devel openvswitch-ipsec openvswitch-testopenvswitch-ovn-common openvswitch-ovn-host libibverbs--nogpgcheck https://img-blog.csdnimg.cn/direct/030aad3896fb436ab10db36442f5f23b.png
完成:
https://img-blog.csdnimg.cn/direct/73b16b5ac69a4102a7a49d0e1337529e.png
(7)启动服务
systemctl start openvswitch.service && systemctl enable openvswitch.service https://img-blog.csdnimg.cn/direct/99113bebf2ca45d19feda5c93078ec70.png
(8)查看OVS
ovs-vsctlshow https://img-blog.csdnimg.cn/direct/faef9da426714a45b16f8abbcdd4ed16.png
(9)安装ovn-central
yum install -y ovn-central --nogpgcheck https://img-blog.csdnimg.cn/direct/58420f4294ae48ec874f608293b57969.png
(10)启动服务
systemctl start ovn-northd.service &&systemctl enableovn-northd.service

systemctl start ovn-controller.service &&systemctl enableovn-controller.service
北向进程ovn-northd.servicehttps://img-blog.csdnimg.cn/direct/cc841c3717ba47cd9f2e582fc252d941.png
控制进程ovn-controller.service
https://img-blog.csdnimg.cn/direct/87ce4af66b0f4ce18fe98625bc6a6660.png
(11)关闭防火墙并查看
关闭
systemctl stop firewalld && systemctl disable firewalld https://img-blog.csdnimg.cn/direct/6ba8d5d8c34c49c4a28b6c5ca0d4955e.png
查看
systemctl status firewalld


https://img-blog.csdnimg.cn/direct/ab83aa14838a4f98841ae5a47655615b.png
(12)验证
目前为空
ovn-nbctlshow

ovn-sbctlshow https://img-blog.csdnimg.cn/direct/b343f87a5896468489e7cc66d6a3c124.png
(13)查看服务
systemctl list-units | grep -i ovn https://img-blog.csdnimg.cn/direct/d4504fce637e4e8bac1eedaa8d622934.png
(14)确认服务状态
systemctlis-active ovn-northd.service
systemctlis-active ovn-controller.service
https://img-blog.csdnimg.cn/direct/1f3b2dfec884404b84027471af118b0a.png
https://img-blog.csdnimg.cn/direct/b9ec0dff4afb447f92bcac65f220b6b9.png

3.Linux 部署 OVN 集群(业务端1)

(1) 删除旧repo
rm -rf /etc/yum.repos.d/*
https://img-blog.csdnimg.cn/direct/7b765d9878224a7c94293164d048d30c.png
(2)上传新repo
ls /etc/yum.repos.d/



https://img-blog.csdnimg.cn/direct/213caed744ef423c93a9bd1db7e05f55.png
(3)更新yum源
yum clean all && yum makecache

https://img-blog.csdnimg.cn/direct/80da5be1fe524b8bbeb0ea9282524c7d.png
(4)更新内核
yum upgrade -y --nogpgcheck
https://img-blog.csdnimg.cn/direct/e1eae4ec7f3249d5888f77153aae751c.png
完成:
https://img-blog.csdnimg.cn/direct/f4ac1d674d3d4099a63b5e3ac0fd6e6b.png
(5)安装软件包
yum install -y openssl-devel kernel-devel openvswitch openvswitch-devel openvswitch-ipsec openvswitch-testopenvswitch-ovn-common openvswitch-ovn-host libibverbs--nogpgcheck https://img-blog.csdnimg.cn/direct/2590c8927afd429dad4922d69c6d2f40.png
完成:
https://img-blog.csdnimg.cn/direct/b5b987e9edcc47f1afee27c75178f10d.png

(6)启动服务
systemctl start openvswitch.service && systemctl enable openvswitch.servicesystemctl start ovn-controller.service &&systemctl enableovn-controller.service https://img-blog.csdnimg.cn/direct/8b6a708ff45b4c2b9250f3e4a8c46e2c.png
https://img-blog.csdnimg.cn/direct/2c885f735c9e49bf9fd4c09ced3de8a0.png
 (7)查看OVS
ovs-vsctlshow https://img-blog.csdnimg.cn/direct/aa70c9de1ada4a02b184dd80e70e6d17.png
(8)确认服务状态
systemctlis-active openvswitch.service
systemctlis-active ovn-controller.service https://img-blog.csdnimg.cn/direct/4edcbf88826944a1a95333a018ed6fe4.png
(9) 关闭防火墙并查看
关闭
systemctl stop firewalld && systemctl disable firewalld https://img-blog.csdnimg.cn/direct/07ffa4227772499289947fe31e94f4ed.png
 查看
systemctl status firewalld


https://img-blog.csdnimg.cn/direct/5bfe291c13c64c43a7a919a8416ce424.png
(10)安装libvirt
yum install -y qemu-kvm qemu-img virt-manager libvirt libvirt-python virt-manager libvirt-client virt-install virt-viewer --nogpgcheck https://img-blog.csdnimg.cn/direct/5319210d280546c18569c1913191aee6.png
完成:
https://img-blog.csdnimg.cn/direct/92219d1b31e240e8889685b16e8277d7.png
(11)启动libvirtd服务
systemctl start libvirtd && systemctl enable libvirtd https://img-blog.csdnimg.cn/direct/8ff836acc3c04dd79555669f4b32ae16.png

4.Linux 部署 OVN 集群(业务端2)

 (1) 删除旧repo
rm -rf /etc/yum.repos.d/* https://img-blog.csdnimg.cn/direct/d91b901727464696b271f59bad8e7fbe.png
(2)上传新repo
ls /etc/yum.repos.d/


https://img-blog.csdnimg.cn/direct/dc21893ee5ff443688f86f132a67c826.png
(3)更新yum源
yum clean all && yum makecache
https://img-blog.csdnimg.cn/direct/360bcb85db104fb28386850e2fa2468e.png
(4)更新内核
yum upgrade -y --nogpgcheck https://img-blog.csdnimg.cn/direct/dc06621d64dc4212a8b721f582ce030a.png
完成:
https://img-blog.csdnimg.cn/direct/9597fd66676341748456cc170461f401.png
(5)安装软件包
yum install -y openssl-devel kernel-devel openvswitch openvswitch-devel openvswitch-ipsec openvswitch-testopenvswitch-ovn-common openvswitch-ovn-host libibverbs--nogpgcheck https://img-blog.csdnimg.cn/direct/72e4371e28064eaa9c49273ebe76bc19.png
完成:
https://img-blog.csdnimg.cn/direct/3ee6cad62ad643169e407bbd9a60ead9.png
(6)启动服务
systemctl start openvswitch.service && systemctl enable openvswitch.servicesystemctl start ovn-controller.service &&systemctl enableovn-controller.service https://img-blog.csdnimg.cn/direct/9134d86f44084b39ade8f676e25c2d01.png
 (7)查看OVS
ovs-vsctlshow https://img-blog.csdnimg.cn/direct/ac602c0dfa1b4d23bedfab3ae19d8e75.png
(8)确认服务状态
systemctlis-active openvswitch.service
systemctlis-active ovn-controller.service https://img-blog.csdnimg.cn/direct/0e25e23738124d838eb2c62141da42a1.png
(9) 关闭防火墙并查看
关闭
systemctl stop firewalld && systemctl disable firewalld https://img-blog.csdnimg.cn/direct/acaa950a70c24449b9e1ca74c14d2cfa.png
 查看
systemctl status firewalld


https://img-blog.csdnimg.cn/direct/f56c0c73279547979e538c8f3fd79b6f.png
(10)安装libvirt
yum install -y qemu-kvm qemu-img virt-manager libvirt libvirt-python virt-manager libvirt-client virt-install virt-viewer --nogpgcheck https://img-blog.csdnimg.cn/direct/5336b473133b46b89db2eb1aae5e8ccc.png
完成:
https://img-blog.csdnimg.cn/direct/2b4ea45a7b1e403887b858e0c10aa935.png
(11)启动libvirtd服务
systemctl start libvirtd && systemctl enable libvirtd https://img-blog.csdnimg.cn/direct/fafa18c7b8694b88bc44a4b4cf8f1fa8.png

4.OVN 中心端 连接数据库

(1)监听OVN北向数据库
ovn-nbctl set-connection ptcp:6641:192.168.204.64 https://img-blog.csdnimg.cn/direct/d636670d19ab4401a2302b6007e1c8b7.png
(2)监听OVN南向数据库
ovn-sbctl set-connection ptcp:6642:192.168.204.64 https://img-blog.csdnimg.cn/direct/713ac89ef8b54b9a8c7ea9f9b5756653.png
(3)查看端口
netstat-nltp | grep ovsdb-server https://img-blog.csdnimg.cn/direct/f5b7e3195f1640a1943c5b6a6bc8345c.png

5.OVN 业务端1 加⼊控制器

(1)加入控制器南向接口
ovs-vsctl set open . external-ids:ovn-remote=tcp:192.168.204.64:6642 https://img-blog.csdnimg.cn/direct/37e626cb33634834bc147177e587f82f.png(2)设置OVN体系ID
ovs-vsctl set open . external-ids:system-id=node01 https://img-blog.csdnimg.cn/direct/9b7826a3e0c248ffb77a2e9be3393031.png
(3)设置OVN控制消息封装模式
ovs-vsctl set open . external-ids:ovn-encap-type=geneve https://img-blog.csdnimg.cn/direct/5d4d9474927d4338ab4e6cb5ddac4bdc.png
(4)设置OVN当地连接地点
ovs-vsctl set open . external-ids:ovn-encap-ip=192.168.204.65 https://img-blog.csdnimg.cn/direct/7d7063961a6e46ce879aacdcc637404b.png
(5)监听端口
netstat -antp | grep 6642 https://img-blog.csdnimg.cn/direct/b31718719ab24f64b82fba99c571c143.png

 (6)查看OVS
ovn_node01
ovs-vsctl show 已⾃动建⽴分布式全互联管理综合⽹桥br-int
https://img-blog.csdnimg.cn/direct/4b7c0e712b644ce18bc574b5c7540280.png


6.OVN 业务端2 加⼊控制器

 (1)加入控制器南向接口
ovs-vsctl set open . external-ids:ovn-remote=tcp:192.168.204.64:6642 https://img-blog.csdnimg.cn/direct/97d7a7d13e724f0e85e645ba783df5f1.png
(2)设置OVN体系ID
ovs-vsctl set open . external-ids:system-id=node02
https://img-blog.csdnimg.cn/direct/47d8bfde91ac4ab0bac961191c1f42f9.png
(3)设置OVN控制消息封装模式
ovs-vsctl set open . external-ids:ovn-encap-type=geneve
https://img-blog.csdnimg.cn/direct/8c7194ac0a004395917d49b54bb7c5e2.png
(4)设置OVN当地连接地点
ovs-vsctl set open . external-ids:ovn-encap-ip=192.168.204.66
https://img-blog.csdnimg.cn/direct/85dd2b34170c49108c8a613d67f2c40e.png
(5)监听端口
netstat -antp | grep 6642 https://img-blog.csdnimg.cn/direct/7aedd7b4292548e0862d4b0fb46d6e77.png
(6)查看OVS
ovn_node02
ovs-vsctl show 已⾃动建⽴分布式全互联管理综合⽹桥br-int
https://img-blog.csdnimg.cn/direct/cd93cf72925e45cea9977bcd73447ab1.png


7.OVN 集群查看

(1) 中心端查看北向控制器
目前为空
ovn-nbctlshow
https://img-blog.csdnimg.cn/direct/d72ed3f569dc489aa6e7269555e6ffa3.png
(2) 中心端查看南向控制器
已更新
ovn-sbctlshow https://img-blog.csdnimg.cn/direct/ff9a83b541d14cffb28ed8e52546983f.png
(3)中心端监听OVN南向数据库
netstat -antp | grep 6642 https://img-blog.csdnimg.cn/direct/2fdd3b5167ca41999c0d16297dfac02f.png
(3)业务端查看隧道接⼝
ip link | grep gene ovn_node01
https://img-blog.csdnimg.cn/direct/982299ab0fc34652a92e4e28dfdd18a0.png
ovn_node02
https://img-blog.csdnimg.cn/direct/1b18cf02db444142ac97bc8659a4b7c9.png
(4)业务端查看Geneve协议
ip -d link showgenev_sys_6081 ovn_node01
https://img-blog.csdnimg.cn/direct/83270c56c04b4183afb1f5609715dbb1.pngovn_node02
https://img-blog.csdnimg.cn/direct/3a09c8e462e84ad6bd2e78216e77b074.png
(5)业务端查看Geneve端口
ovn_node01
https://img-blog.csdnimg.cn/direct/421ce720c3f74b4da1f5fd3b0f212089.png
ovn_node02
https://img-blog.csdnimg.cn/direct/6ec76977eb174d6bbe23ec78f58c81bc.png


二、题目

1.南向控制器节点名称报错

(1)报错
 ovn_central
Chassis "a01fe9cb-463f-4d2d-b3bb-810b6a923a01"
……
Chassis "37752d67-f6d8-47b7-9ce0-248eb2c1f1fc"
……
https://img-blog.csdnimg.cn/direct/bdd299c137ca400c96395ed2f1f5f7d6.png
 ovn_node01
……
Port "ovn-37752d-0"
…… https://img-blog.csdnimg.cn/direct/3d302cb330de4e7285fea956ee2ecf35.png
 ovn_node02
……
Port "ovn-a01fe9-0"
…… https://img-blog.csdnimg.cn/direct/cc25691f652144669aa6be6913567e01.png
(2)原因分析
体系重启后,OVN体系ID丢失。
(3)解决方法
设置OVN体系ID,名字表现为Chassis:
 ovn_node01
ovs-vsctl set open . external-ids:system-id=node01
ovs-vsctlshow https://img-blog.csdnimg.cn/direct/11f2d1c649314b7698a14c9bdaca9f43.png
ovn_node02
ovs-vsctl set open . external-ids:system-id=node02
ovs-vsctlshow
https://img-blog.csdnimg.cn/direct/246495622d6249629ef0c2505a67a076.png
 ovn_central
https://img-blog.csdnimg.cn/direct/d37a7a8b4f53446a875acaf5b32d05ce.png





免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 云计算:Linux 部署 OVN 集群