session-replay-tools / tcpcopy

An online request replication and TCP stream replay tool, ideal for real testing, performance testing, stability testing, stress testing, load testing, smoke testing, and more.
http://session-replay-tools.github.io/tcpcopy/
Other
4.48k stars 1.03k forks source link

测试服务器收不到数据 #365

Closed xinyu7git closed 2 months ago

xinyu7git commented 4 years ago

172.28.246.102 是线上服务器, 172.18.176.136是测试服务器,172.18.176.134是辅助服务器。 [root@172-28-246-102 ~]# ps -ef|grep tcpcopy root 9892 1 1 17:46 ? 00:00:01 /usr/local/tcpcopy/sbin/tcpcopy -x 6508-172.18.176.136:4444 -s 172.18.176.134 -c 192.168.168.3 -n 1 -d root 11747 20266 0 17:48 pts/0 00:00:00 grep tcpcopy [root@172-28-246-102 ~]#

测试服务器日志:

2019/11/12 17:47:13 +099 [notice] user time used:0
2019/11/12 17:47:13 +099 [notice] sys  time used:0
2019/11/12 17:47:13 +099 [notice] max memory size:4384
2019/11/12 17:47:13 +099 [notice] Total allocated space (bytes): 53680
2019/11/12 17:47:13 +099 [notice] Total free space (bytes): 81488
2019/11/12 17:47:13 +099 [notice] Top-most, releasable space (bytes): 81008
2019/11/12 17:47:13 +099 [notice] active:0,rel:0,obs del:0,tw:0
2019/11/12 17:47:13 +099 [notice] conns:0,resp:0,c-resp:0
2019/11/12 17:47:13 +099 [notice] resp fin:0,resp rst:0
2019/11/12 17:47:13 +099 [notice] send:0,send content:0
2019/11/12 17:47:13 +099 [notice] send syn:0, fin:0,reset:0
2019/11/12 17:47:13 +099 [notice] reconnect:0,for no syn:0
2019/11/12 17:47:13 +099 [notice] retransmit:0
2019/11/12 17:47:13 +099 [notice] recv packs after retransmission:0
2019/11/12 17:47:13 +099 [notice] syn cnt:0,all clt:6,clt cont:0
2019/11/12 17:47:13 +099 [notice] total cont retransmit:0, frag:14
2019/11/12 17:47:13 +099 [notice] total captured packets:13245
2019/11/12 17:47:43 +099 [notice] active:0,rel:0,obs del:0,tw:0
2019/11/12 17:47:43 +099 [notice] conns:0,resp:0,c-resp:0
2019/11/12 17:47:43 +099 [notice] resp fin:0,resp rst:0
2019/11/12 17:47:43 +099 [notice] send:0,send content:0
2019/11/12 17:47:43 +099 [notice] send syn:0, fin:0,reset:0
2019/11/12 17:47:43 +099 [notice] reconnect:0,for no syn:0
2019/11/12 17:47:43 +099 [notice] retransmit:0
2019/11/12 17:47:43 +099 [notice] recv packs after retransmission:0
2019/11/12 17:47:43 +099 [notice] syn cnt:0,all clt:9,clt cont:0
2019/11/12 17:47:43 +099 [notice] total cont retransmit:0, frag:21
2019/11/12 17:47:43 +099 [notice] total captured packets:19762

辅助服务器日志:

2019/11/12 17:46:14 +276 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:46:14 +276 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:46:14 +276 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:46:44 +276 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:46:44 +276 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:46:44 +276 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:47:14 +276 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:47:14 +276 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:47:14 +276 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:47:44 +276 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:47:44 +276 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:47:44 +276 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:48:14 +276 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:48:14 +276 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:48:14 +276 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:48:44 +277 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:48:44 +277 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:48:44 +277 [notice] search:242554,extra compared:8,all sessions:1257
2019/11/12 17:49:14 +277 [notice] total resp packs:242554, all:242554, route:1257, sock write cnt:74330
2019/11/12 17:49:14 +277 [notice] cache hit:242092,missed:0,lost:462
2019/11/12 17:49:14 +277 [notice] search:242554,extra compared:8,all sessions:1257

麻烦帮忙看一下是什么原因呢?

wangbin579 commented 4 years ago

这个是什么类型的应用,MySQL?

如果是MySQL,需要捕获完整的session才能回放

xinyu7git commented 4 years ago

这个是什么类型的应用,MySQL?

如果是MySQL,需要捕获完整的session才能回放

不是mysql,是tcp服务,传输使用的格式的protobuf

xinyu7git commented 4 years ago

这个是什么类型的应用,MySQL?

如果是MySQL,需要捕获完整的session才能回放

我的tcp服务是在容器中的,6508是系统映射的端口,在容器中的服务会有什么区别吗?

wangbin579 commented 4 years ago

上面的tcpcopy并没有发送syn数据包,不排除根本就没有捕获到应用的数据包,可以利用tcpdump确认一下应用数据包端口是多少

cynthiawan commented 1 year ago

@xinyu7git 请问最后解决了吗?我也遇到一个容器环境的protobuf协议服务无法引流到测试服务器的问题