配置 Azure 负载均衡器的分配模式Configure the distribution mode for Azure Load Balancer

Azure 负载均衡器支持两种分发模式,用于将流量分发到应用程序:Azure Load Balancer supports two distribution modes for distributing traffic to your applications:

  • 基于哈希Hash-based
  • 源 IP 关联Source IP affinity

本文介绍如何配置 Azure 负载均衡器的分发模式。In this article, you learn how to configure the distribution mode for your Azure Load Balancer.

配置分发模式Configure distribution mode


可以通过修改门户中的负载均衡规则来更改分发模式的配置。You can change the configuration of the distribution mode by modifying the load-balancing rule in the portal.

  1. 登录 Azure 门户并通过单击“资源组”找到包含要更改的负载均衡器的资源组。Sign in to the Azure portal and locate the resource group containing the load balancer you wish to change by clicking on Resource Groups.
  2. 在“负载均衡器概述”屏幕中,选择“设置”下的“负载均衡规则” 。In the load balancer overview screen, select Load-balancing rules under Settings.
  3. 在“负载均衡规则”屏幕中,选择要更改分发模式的负载均衡规则。In the load-balancing rules screen, select the load-balancing rule that you wish to change the distribution mode.
  4. 在规则下,通过更改“会话持续性”下拉框来更改分发模式。Under the rule, the distribution mode is changed by changing the Session persistence drop-down box.

提供了以下选项:The following options are available:

  • 无(基于哈希) - 指定任何虚拟机可能处理来自同一客户端的后续请求。None (hash-based) - Specifies that successive requests from the same client may be handled by any virtual machine.
  • 客户端 IP(源 IP 关联二元组) - 指定来自同一客户端 IP 地址的后续请求将由同一虚拟机处理。Client IP (source IP affinity two-tuple) - Specifies that successive requests from the same client IP address will be handled by the same virtual machine.
  • 客户端 IP 和协议(源 IP 关联三元组) - 指定来自同一客户端 IP 地址和协议组合的连续请求将由同一虚拟机处理。Client IP and protocol (source IP affinity three-tuple) - Specifies that successive requests from the same client IP address and protocol combination will be handled by the same virtual machine.
  1. 选择分发模式,然后选择“保存”。Choose the distribution mode and then select Save.

更改负载均衡器规则上的会话持久性。

后续步骤Next steps