AirNet服务器迁移到容器

当筵意气临九霄,星离雨散不终朝。这篇文章主要讲述AirNet服务器迁移到容器相关的知识,希望能为你提供帮助。
1、POD设计,netshoot:latest作为sidecar,用于调试网络。

sdfp2-net.yaml设计
指定IP
annotations:
cni.projectcalico.org/ipAddrs: "[\\"172.16.135.135\\"]"
指定主机名称
hostname: sdfp2
containers:
- image: mi:v1
......
- image: nicolaka/netshoot:latest
# k apply -f sdfp2-net.yaml
[root@sdfp2 ~]# k get pod
NAMEREADYSTATUSRESTARTSAGE
sdfp2-netshoot-dp-84f4d7b99d-5pvhm2/2Running035m

进入sdfp2容器运行服务进程
# k exec -ti sdfp2-netshoot-dp-84f4d7b99d-5pvhm-c sdfp2 -- bash
拷贝license.ini,mid.xml——> /home/cdatc/AirNet/config/gconf/mid/;network.xml——> /home/cdatc/AirNet/config/(也需更新mid.xml,否则提示授权问题)
# /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf1> /dev/null 2> & 1
# /usr/local/redis/bin/redis-server /usr/local/redis/conf/redis_6378.conf 1> /dev/null 2> & 1
# setsid bash -c /home/cdatc/AirNet/bin/mnt > /dev/null 2> & 1&
top查看mnt\\mid\\afp\\rfp正常运行

【AirNet服务器迁移到容器】进入sidecar容器查看组播?172.16.135.135?.50849 > ? 225.1.0.1?.40002
# k exec -ti sdfp2-netshoot-dp-84f4d7b99d-5pvhm-c netshoot -- bash
bash-5.1# tcpdump -i eth0 -n
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:53:34.922499 IP 172.16.135.135.58814 > 225.1.0.1.40003: UDP, length 36
10:53:34.922766 IP 172.16.135.135.48636 > 225.1.0.1.40003: UDP, length 340
10:53:34.939140 IP 172.16.135.135.50849 > 225.1.0.1.40002: UDP, length 1399

k8s集群环境,但是组播在宿主机上和集群中别的node上抓不到,?组播只局限在POD内部?。
——部署另一个POD,两个POD之间彼此tcpdump看不到对方的组播包。
——添加Service,type: NodePort/ClusterIP测试也看不到对方的组播包。
2、?*?实际系统上SDFP1将eth1/eth2网线拔掉,eth0的IP改为192.168.15.50,相应修改license.ini和network.xml,抓包组播ok,SDFP1主态,SDD有航迹显示。
#tcpdump -n -i eth0 |grep 192.168.15.50
...IP 192.168.15.50.21136 > 255.1.0.2.40200: UDP,length 442


    推荐阅读