在流量管理器中配置多值路由方法Configure MultiValue routing method in Traffic Manager

本文介绍如何配置多值流量路由方法。This article describes how to configure the MultiValue traffic-routing method. 使用多值流量路由方法,可以返回多个运行正常的终结点,并有助于提高应用程序的可靠性,因为客户端有更多选项可以重试,无需另外进行 DNS 查找 。The Multivalue traffic routing method allows you to return multiple healthy endpoints and helps increase the reliability of your application since clients have more options to retry without having to do another DNS lookup. 多值路由仅针对使用 IPv4 或 IPv6 地址指定了所有端点的配置文件启用。MultiValue routing is enabled only for profiles which have all their endpoints specified using IPv4 or IPv6 addresses. 在收到此配置文件的查询时,会根据指定的可配置的最大返回计数返回所有运行正常的终结点。When a query is received for this profile, all healthy endpoints are returned based on the configurable maximum return count specified.

备注

此时仅外部类型的终结点支持使用 IPv4 或 IPv6 地址添加终结点,因此仅此类终结点支持多值路由 。At this time adding endpoints using IPv4 or IPv6 addresses is supported only for endpoints of type External and hence MultiValue routing is also supported only for such endpoints.

登录 AzureSign in to Azure

通过 https://portal.azure.cn 登录到 Azure 门户。Sign in to the Azure portal at https://portal.azure.cn.

创建资源组Create a resource group

创建流量管理器配置文件的资源组。Create a resource group for the Traffic Manager profile.

  1. 在 Azure 门户的左侧窗格中,选择“资源组” 。On the left pane of the Azure portal, select Resource groups.
  2. 在“资源组”中,选择页面顶部的“添加” 。In Resource groups, on the top of the page, select Add.
  3. 在“资源组名称”中,键入名称 myResourceGroupTM1 。In Resource group name, type a name myResourceGroupTM1. 对于“资源组位置”,请选择“中国东部”,然后选择“确定” 。For Resource group location, select China East, and then select OK.

创建流量管理器配置文件Create a Traffic Manager profile

创建流量管理器配置文件,以便将用户流量定向到延迟最低的终结点。Create a Traffic Manager profile that directs user traffic by sending them to the endpoint with lowest latency.

  1. 在屏幕左上方,选择“创建资源” > “网络” > “全部查看” > “流量管理器配置文件” > “创建” 。On the top left-hand side of the screen, select Create a resource > Networking > See All > Traffic Manager profile > Create.

  2. 在“创建流量管理器配置文件”中输入或选择以下信息,接受其余设置的默认值,然后选择“创建” :In Create Traffic Manager profile, enter or select, the following information, accept the defaults for the remaining settings, and then select Create:

    设置Setting Value
    名称Name 此名称必须在 trafficmanager.cn 区域中唯一,并会生成用于访问流量管理器配置文件的 DNS 名称 trafficmanager.cn。This name needs to be unique within the trafficmanager.cn zone and results in the DNS name, trafficmanager.cn that is used to access your Traffic Manager profile.
    路由方法Routing method 选择“多值”路由方法 。Select the Multivalue routing method.
    订阅Subscription 选择订阅。Select your subscription.
    资源组Resource group 选择“myResourceGroupTM1” 。Select myResourceGroupTM1.
    位置Location 此设置指的是资源组的位置,对将全局部署的流量管理器配置文件没有影响。This setting refers to the location of the resource group, and has no impact on the Traffic Manager profile that will be deployed globally.

    创建流量管理器配置文件

添加流量管理器终结点Add Traffic Manager endpoints

将两个 IP 地址作为外部终结点添加到在上一步中创建的多值流量管理器配置文件中。Add two IP addresses as external endpoints to the MultiValue Traffic Manager profile that you created in the preceding step.

  1. 在门户的搜索栏中,搜索在前面部分创建的流量管理器配置文件名称,并在显示的结果中选择该配置文件。In the portal's search bar, search for the Traffic Manager profile name that you created in the preceding section and select the profile in the results that the displayed.

  2. 在“流量管理器配置文件” 的“设置” 部分单击“终结点” ,然后单击“添加”。 In Traffic Manager profile, in the Settings section, click Endpoints, and then click Add.

  3. 输入或选择以下信息,保留剩下的默认设置,然后选择“确定” :Enter, or select, the following information, accept the defaults for the remaining settings, and then select OK:

    设置Setting Value
    类型Type 外部终结点External endpoint
    名称Name myEndpoint1myEndpoint1
    完全限定的域名 (FQDN) 或 IPFully qualified domain name (FQDN) or IP 键入要添加到此流量管理器配置文件的终结点的公共 IP 地址Type the Public IP address of the endpoint that you want to add to this Traffic Manager profile
  4. 重复步骤 2 和 3 以添加名为“myEndpoint2”的另一个终结点,在“完全限定的域名 (FQDN) 或 IP”处,输入第二个终结点的公共 IP 地址 。Repeat steps 2 and 3 to add another endpoint named myEndpoint2, for Fully qualified domain name (FQDN) or IP, enter the public IP address of the second endpoint.

  5. 添加完这两个终结点后,这两个终结点会显示在“流量管理器配置文件” 中,并且其监视状态为“联机” 。When the addition of both endpoints is complete, they are displayed in Traffic Manager profile along with their monitoring status as Online.

    添加流量管理器终结点

后续步骤Next steps