如何解决Curl (56) Recv failure: Connection reset by peer [TCP Retransmission]
PC1:
- 环境:Centos 8.2 Linux compute-31 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- IP:10.0.0.31
- ping 正常
[root@compute-31 ~]# ping 10.10.10.82
PING 10.10.10.82 (10.10.10.82) 56(84) bytes of data.
64 bytes from 10.10.10.82: icmp_seq=1 ttl=63 time=0.741 ms
From 10.0.0.1: icmp_seq=2 Redirect Host(New nexthop: 10.0.0.210)
64 bytes from 10.10.10.82: icmp_seq=2 ttl=63 time=0.404 ms
64 bytes from 10.10.10.82: icmp_seq=3 ttl=63 time=0.429 ms
64 bytes from 10.10.10.82: icmp_seq=4 ttl=63 time=0.389 ms
64 bytes from 10.10.10.82: icmp_seq=5 ttl=63 time=0.412 ms
^C
--- 10.10.10.82 ping statistics ---
5 packets transmitted,5 received,0% packet loss,time 133ms
rtt min/avg/max/mdev = 0.389/0.475/0.741/0.133 ms
- telnet 没问题
[root@10.0.0.31 ~]# telnet 10.10.10.82 9100
Trying 10.10.10.82...
Connected to 10.10.10.82.
Escape character is '^]'.
- 卷曲不好
[root@10.0.0.31 ~]# curl -v http://10.10.10.82:9100/metrics
* Trying 10.10.10.82...
* TCP_NODELAY set
* Connected to 10.10.10.82 (10.10.10.82) port 9100 (#0)
> GET /metrics HTTP/1.1
> Host: 10.10.10.82:9100
> User-Agent: curl/7.61.1
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
- traceroute 没问题
[root@10.0.0.31 ~]# traceroute -n -I 10.10.10.82
traceroute to 10.10.10.82 (10.10.10.82),30 hops max,60 byte packets
1 10.0.0.1 0.172 ms 0.151 ms 0.146 ms
2 10.0.0.210 0.209 ms 0.289 ms 0.268 ms
3 10.10.10.82 0.600 ms 0.582 ms 0.590 ms
PC2:
- 环境:Windows 10
- IP:10.0.10.6
卷曲没问题
C:\Users\Jeffery>curl 10.10.10.82:9100/metrics
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 7.228e-06
go_gc_duration_seconds{quantile="0.25"} 8.679e-06
go_gc_duration_seconds{quantile="0.5"} 1.0364e-05
go_gc_duration_seconds{quantile="0.75"} 1.2266e-05
go_gc_duration_seconds{quantile="1"} 0.000641901
go_gc_duration_seconds_sum 0.139410267
go_gc_duration_seconds_count 11244
尝试1:
在PC1(10.0.0.31)中,通过添加新路由10.0.0.210 ->10.10.10.82
将路由路径改为route add -net 10.10.10.0 netmask 255.255.255.0 gw 10.0.0.210
,问题解决!但为什么? 10.0.0.1 发生了什么?
PS:旧路径是10.0.0.1 ->10.0.0.210 -> 10.10.10.82
TRY2:
我在 tcpdump
中发现了一些东西,但我没有找到导致它的原因。
[root@10.0.0.31 ~]# tcpdump -n -i eno2 host 10.0.0.31 and 10.10.10.82 -w tcpdum.10.0.0.31
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。