负载均衡配置与应用网关部署全解析
1. 负载均衡器测试
为了正确测试虚拟机(VMs),我们将使用 PowerShell 在 PacktLBVM1 和 PacktLBVM2 VMs 上安装 Internet Information Services (IIS),然后使用 PacktLBVMTest VM 通过调用负载均衡器的私有 IP 地址来测试它。具体步骤如下:
1. 打开负载均衡器资源。
2. 在“设置”下,选择“前端 IP 配置”,并复制私有 IP 地址。
3. 使用 RDP 会话通过公共 IP 连接到 PacktLBVM1 和 PacktLBVM2 VM,安装 IIS 和测试网页。连接到两个 VM,打开 PowerShell 控制台,粘贴并运行以下 PowerShell 脚本:
# Install IIS
Install-WindowsFeature -name Web-Server -IncludeManagementTools
# Remove default htm file
remove-item C:\inetpub\wwwroot\iisstart.htm
#Add custom htm file
Add-Content -Path "C:\inetpub\wwwroot\iisstart.htm" -Value $("Hello World from " + $env:computername)
- 同样使用 RDP 连接到 PacktLBVMTest VM,打开浏览器会话(如 Internet Explorer)
超级会员免费看
订阅专栏 解锁全文
170万+

被折叠的 条评论
为什么被折叠?



