Loading

IIS负载均衡配置

更新记录

点击查看
2024年4月5日 初始化。

准备

准备4台 Windows Server(测试环境 Vmware 下 Windows Server 2022 x86_64)

目标

一台前置 IIS 转发请求,3台IIS用于提供ASP.NET Core服务。

设备结构

先给4台Windows Server配置安装IIS。
image

配置提供服务的IIS 192.168.1.7、192.168.1.5、192.168.1.9

按照自己的要求配置ASP.NET应用 或者 ASP.NET Core应用即可。
IIS配置部署ASP.NET Core应用教程:https://www.cnblogs.com/cqpanda/p/16149134.html

配置前置IIS 192.168.1.8

安装包

(按顺序安装)
url-rewrite

https://iis-umbraco.azurewebsites.net/downloads/microsoft/url-rewrite

application-request-routing

https://iis-umbraco.azurewebsites.net/downloads/microsoft/application-request-routing

安装好后会在IIS管理界面,显示Server Farms
image

代理站点设置

把代理站点的 应用程序池 的 超时时间改为0
image

把代理站点的 应用程序池 的 回收的固定时间间隔 去掉
image

Farms中新建Farm

然后在Farms中新建Farm把对应的服务IIS的信息加入即可。
image

添加完成后:
image

测试服务器节点是否正常

使用Health Test
image

输入代理站点的URL,点击测试按钮
image

负载均衡策略设置

image

可以自定义权重
image

查看请求情况

image

具体测试使用jmeter。

参考链接

https://zhuanlan.zhihu.com/p/142897766
https://www.cnblogs.com/webapi/p/5669089.html
https://learn.microsoft.com/zh-cn/iis/web-hosting/scenario-build-a-web-farm-with-iis-servers/configuring-step-3-configure-iis-web-farm-load-balancing
https://learn.microsoft.com/zh-cn/iis/web-hosting/scenario-build-a-web-farm-with-iis-servers/configuring-step-4-configure-ssl-central-certificate-store
https://learn.microsoft.com/zh-cn/iis/web-hosting/scenario-build-a-web-farm-with-iis-servers/configuring-step-2-configure-iis-web-farm-servers
https://learn.microsoft.com/zh-cn/iis/web-hosting/scenario-build-a-web-farm-with-iis-servers/planning-step-3-plan-iis-web-farm-load-balancing
https://learn.microsoft.com/zh-cn/iis/web-hosting/scenario-build-a-web-farm-with-iis-servers/configure-a-web-farm-with-iis-servers
https://learn.microsoft.com/zh-cn/iis/get-started/introduction-to-iis/hosting-friendly-web-server-platform-iis-scenario-overview
https://zhuanlan.zhihu.com/p/272799312
https://learn.microsoft.com/zh-cn/iis/extensions/installing-application-request-routing-arr/install-application-request-routing
https://www.jianshu.com/p/ff16434d96fb
https://www.cnblogs.com/jerviscui/p/10818173.html
https://www.cnblogs.com/jinrain/p/6805995.html

posted @ 2024-04-07 11:35  重庆熊猫  阅读(18)  评论(0编辑  收藏  举报