简体   繁体   English

使用NGINX在Nginx负载平衡上检查服务IIS

[英]Check Service IIS down on nginx load balancing using NGINX

I setup load balancing with nginx. 我使用nginx设置了负载平衡。 Here is my config 这是我的配置

upstream mywebsite1  {
  least_conn;;
  server xxx.xxx.xxx.20 weight=1 max_fails=3 fail_timeout=15s;
  server xxx.xxx.xxx.21 weight=1 max_fails=3 fail_timeout=15s;
}

Default all request sent to 2 sever backend. 默认将所有请求发送到2个服务器后端。 Now if IIS Service in Backend1 (xxx.xxx.xxx.20) down, Access to website will be interrupted. 现在,如果Backend1(xxx.xxx.xxx.20)中的IIS服务关闭,则将无法访问网站。 So how can make all request auto connect to backend2 when IIS service on backend1 down, or connect to backend1 when IIS service on backend2 down ??? 因此,当backend1上的IIS服务关闭时,如何使所有请求自动连接到backend2;或者当backend2上的IIS服务关闭时,如何使所有请求自动连接到backend1?

Thanks! 谢谢!

You are setting max_fails=3 for each server, so try to seventh requests to the nginx load balancer while server .20 is being down. 您正在为每个服务器设置max_fails=3 ,因此尝试在服务器.20关闭时向nginx负载均衡器发出第七个请求。

You can refer this : http://nginx.org/en/docs/http/load_balancing.html 您可以参考以下内容: http : //nginx.org/en/docs/http/load_balancing.html

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

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