0
点赞
收藏
分享

微信扫一扫

AirNet服务器迁移到容器

Python芸芸 2022-03-12 阅读 55

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
NAME READY STATUS RESTARTS AGE
sdfp2-netshoot-dp-84f4d7b99d-5pvhm 2/2 Running 0 35m

进入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.conf 1>/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正常运行

进入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

但是组播在宿主机上和集群中别的node上抓不到。

举报

相关推荐

0 条评论