我在本地网络的VM上部署了一个很小的Spring引导应用程序。我可以使用Postman / Chrome发送API GET请求,然后按预期接收响应。但是,如果不使用curl命令,它有时会显示“到主机没有路由”,如以下代码段所示,有时效果很好。其成功率约为50%。特别是,它也不能从服务器本身内部卷曲(curl localhost:30002 / hello),但是客户端(curl 192.168.0.207:30002/hello)可以工作(50%)!!!任何帮助将不胜感激。
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
curl: (7) Failed connect to 192.168.0.207:30002; No route to host
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
curl: (7) Failed connect to 192.168.0.207:30002; No route to host
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
curl: (7) Failed connect to 192.168.0.207:30002; No route to host
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
curl: (7) Failed connect to 192.168.0.207:30002; No route to host
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
curl: (7) Failed connect to 192.168.0.207:30002; No route to host
[root@vm-01 vagrant]# curl '192.168.0.207:30002/hello'
AAAA[root@vm-01 vagrant]#
带有'AAAA'的行是预期的。