简体   繁体   English

服务器关闭负载均衡器时REST API随机404错误

[英]REST API random 404 error when a server is down on load balancer

We have a REST based API project. 我们有一个基于REST的API项目。 The project is hosted in IIS on multiple servers on a load balancer.It works great except when a server goes down on the load balancer, we receive a 404 Bad Request error for few seconds and then it resolves itself. 该项目在IIS上托管在负载均衡器上的多个服务器上。除非服务器在负载均衡器上发生故障时,我们会收到404 Bad Request错误几秒钟然后它自行解析。 How do we resolve this? 我们如何解决这个问题? Are there any changes that need to be done in IIS or on the REST API project itself? 是否需要在IIS或REST API项目本身中进行任何更改?

As far as I know, if you use IIS ARR's loadbalance there is no need to add the specail setting to check the server's status. 据我所知,如果您使用IIS ARR的负载均衡,则无需添加specail设置来检查服务器的状态。 The IIS ARR healthy test will auto send the request to check the server is work well or not. IIS ARR健康测试将自动发送请求以检查服务器是否正常工作。 If the IIS ARR find the server is down or return error, it will not redirect the request to the server. 如果IIS ARR发现服务器已关闭或返回错误,则不会将请求重定向到服务器。

Besides, as far as I know, the 404 error means the page not found not the bad request. 此外,据我所知,404错误意味着找不到页面不是坏请求。 Normally, 400 is the bad request status code. 通常,400是错误的请求状态代码。

If you find a server is down in your server farms, I suggest you could try to access the server directly through the brwoser to know the details error message. 如果您发现服务器场中的服务器已关闭,我建议您可以尝试直接通过brwoser访问服务器以了解详细信息错误消息。

If the server return 404 error, that means your browser couldn't access the server, it is a network issue normally. 如果服务器返回404错误,这意味着您的浏览器无法访问服务器,则通常是网络问题。 You should check the DNS server setting or make sure the IIS web application is running. 您应该检查DNS服务器设置或确保IIS Web应用程序正在运行。

If the server return 400 error, you should troublshooting according to the details 400 error message. 如果服务器返回400错误,则应根据详细信息400错误消息进行故障排除。 Normall, it shows when the request contains the wrong header. Normall,它显示请求包含错误的标题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM