巢狀流量管理員設定檔Nested Traffic Manager profiles

流量管理員包括一系列流量路由方法,可讓您控制流量管理員如何選擇哪一個端點應接收來自每一位使用者的流量。Traffic Manager includes a range of traffic-routing methods that allow you to control how Traffic Manager chooses which endpoint should receive traffic from each end user. 如需詳細資訊,請參閱 流量管理員流量路由方法For more information, see Traffic Manager traffic-routing methods.

每個「流量管理員」設定檔皆指定一個流量路由方法。Each Traffic Manager profile specifies a single traffic-routing method. 不過,有些情況需要的流量路由,比單一流量管理員設定檔所提供的路由更複雜。However, there are scenarios that require more sophisticated traffic routing than the routing provided by a single Traffic Manager profile. 您可以將流量管理員設定檔巢狀化,以結合多個流量路由方法的優點。You can nest Traffic Manager profiles to combine the benefits of more than one traffic-routing method. 巢狀設定檔可讓您覆寫預設流量管理員行為,以支援更大和更複雜的應用程式部署。Nested profiles allow you to override the default Traffic Manager behavior to support larger and more complex application deployments.

下列範例說明如何在各種情況中使用巢狀流量管理員設定檔。The following examples illustrate how to use nested Traffic Manager profiles in various scenarios.

範例 1:結合「效能」和「加權」流量路由Example 1: Combining 'Performance' and 'Weighted' traffic routing

假設您將應用程式部署在下列 Azure 區域︰美國西部、西歐及東亞。Suppose that you deployed an application in the following Azure regions: West US, West Europe, and East Asia. 您使用流量管理員的「效能」流量路由方法,將流量分配給最靠近使用者的區域。You use Traffic Manager's 'Performance' traffic-routing method to distribute traffic to the region closest to the user.

單一流量管理員設定檔

現在,假設您希望先測試服務的更新,再更廣泛地推出。Now, suppose you wish to test an update to your service before rolling it out more widely. 您想要使用「加權」流量路由方法,將一小部分的流量導向您的測試部署。You want to use the 'weighted' traffic-routing method to direct a small percentage of traffic to your test deployment. 除了西歐現有的生產環境部署,您還設定測試部署。You set up the test deployment alongside the existing production deployment in West Europe.

您無法在單一設定檔中結合「加權」和「效能」流量路由。You cannot combine both 'Weighted' and 'Performance traffic-routing in a single profile. 為了支援這種情況,您使用兩個西歐端點和「加權」流量路由方法,建立流量管理員設定檔。To support this scenario, you create a Traffic Manager profile using the two West Europe endpoints and the 'Weighted' traffic-routing method. 接下來,您將這個「子」設定檔新增為「父」設定檔的端點。Next, you add this 'child' profile as an endpoint to the 'parent' profile. 父設定檔仍使用「效能」流量路由方法,而且包含其他全域部署當做端點。The parent profile still uses the Performance traffic-routing method and contains the other global deployments as endpoints.

下圖說明此範例:The following diagram illustrates this example:

巢狀流量管理員設定檔

在此設定中,透過父設定檔導向的流量正常地將流量分散至各區域。In this configuration, traffic directed via the parent profile distributes traffic across regions normally. 在西歐內,巢狀設定檔會根據指派的權數,將流量分散至生產端點和測試端點。Within West Europe, the nested profile distributes traffic to the production and test endpoints according to the weights assigned.

當父設定檔使用「效能」流量路由方法時,必須指派位置給每個端點。When the parent profile uses the 'Performance' traffic-routing method, each endpoint must be assigned a location. 您需要在設定端點時指派位置。The location is assigned when you configure the endpoint. 選擇最接近部署的 Azure 區域。Choose the Azure region closest to your deployment. Azure 區域是「網際網路延遲資料表」所支援的位置值。The Azure regions are the location values supported by the Internet Latency Table. 如需詳細資訊,請參閱流量管理員「效能」流量路由方法For more information, see Traffic Manager 'Performance' traffic-routing method.

範例 2:巢狀設定檔中的端點監視Example 2: Endpoint monitoring in Nested Profiles

「流量管理員」會主動監控每個服務端點的健康情況。Traffic Manager actively monitors the health of each service endpoint. 如果端點的狀況不良,流量管理員會將使用者導向替代端點,以維持服務的可用性。If an endpoint is unhealthy, Traffic Manager directs users to alternative endpoints to preserve the availability of your service. 這項端點監視及容錯移轉行為適用於所有流量路由方法。This endpoint monitoring and failover behavior applies to all traffic-routing methods. 如需詳細資訊,請參閱 流量管理員端點監視For more information, see Traffic Manager Endpoint Monitoring. 巢狀設定檔的端點監視有不同的運作方式。Endpoint monitoring works differently for nested profiles. 使用巢狀設定檔時,父設定檔不會直接對子系執行健康狀態檢查,With nested profiles, the parent profile doesn't perform health checks on the child directly. 子設定檔端點的健康狀態會用來計算子設定檔的整體健康狀態。Instead, the health of the child profile's endpoints is used to calculate the overall health of the child profile. 此健康狀態資訊會在巢狀設定檔階層中往上傳播。This health information is propagated up the nested profile hierarchy. 父設定檔會使用這個彙總的健康狀態,來決定是否要將流量導向子設定檔。The parent profile uses this aggregated health to determine whether to direct traffic to the child profile. 如需巢狀設定檔健康狀態監視的完整詳細資料,請參閱常見問題集See the FAQ for full details on health monitoring of nested profiles.

回到前一個範例,假設西歐的生產環境部署失敗。Returning to the previous example, suppose the production deployment in West Europe fails. 根據預設,「子」設定檔會將所有流量都導向測試部署。By default, the 'child' profile directs all traffic to the test deployment. 如果測試部署也失敗,父設定檔會決定子設定檔不應該接收流量,因為所有子端點都狀況不良。If the test deployment also fails, the parent profile determines that the child profile should not receive traffic since all child endpoints are unhealthy. 接著,父設定檔會將流量分散至其他區域。Then, the parent profile distributes traffic to the other regions.

巢狀設定檔容錯移轉 (預設行為)

您可能喜歡這種做法。You might be happy with this arrangement. 您也可能擔心現在西歐的所有流量都流向測試部署,而不是一小部分的流量。Or you might be concerned that all traffic for West Europe is now going to the test deployment instead of a limited subset traffic. 不論測試部署的健康狀態如何,當西歐的生產環境部署失敗時,您想要容錯移轉至其他區域。Regardless of the health of the test deployment, you want to fail over to the other regions when the production deployment in West Europe fails. 若要啟用此容錯移轉,在將子設定檔設定為父設定檔中的端點時,您可以指定 'MinChildEndpoints' 參數。To enable this failover, you can specify the 'MinChildEndpoints' parameter when configuring the child profile as an endpoint in the parent profile. 此參數決定子設定檔中可用的最少端點。The parameter determines the minimum number of available endpoints in the child profile. 預設值為 '1'。The default value is '1'. 在此案例中,您將 MinChildEndpoints 值設為 2。For this scenario, you set the MinChildEndpoints value to 2. 低於此閾值時,父設定檔會將整個子設定檔視為無法使用,並將流量導向其他端點。Below this threshold, the parent profile considers the entire child profile to be unavailable and directs traffic to the other endpoints.

下圖說明此設定:The following figure illustrates this configuration:

以 'MinChildEndpoints' = 2 進行容錯移轉的巢狀設定檔

注意

「優先順序」流量路由方法會將所有流量分配給單一端點。The 'Priority' traffic-routing method distributes all traffic to a single endpoint. 因此,如果子設定檔的 MinChildEndpoints 不是設為 '1',則作用不大。Thus there is little purpose in a MinChildEndpoints setting other than '1' for a child profile.

範例 3:「效能」流量路由中具優先順序的容錯移轉區域Example 3: Prioritized failover regions in 'Performance' traffic routing

「效能」流量路由方法的預設行為如下:當您的端點位於不同的地理位置時,即會將終端使用者路由傳送到「最靠近」(亦即網路延遲最低) 的端點。The default behavior for the 'Performance' traffic-routing method is when you have endpoints in different geographic locations the end users are routed to the "closest" endpoint in terms of the lowest network latency.

不過,假設您偏好將西歐流量容錯移轉至美國西部,而只有在這兩個端點都無法使用時,才將流量導向其他區域。However, suppose you prefer the West Europe traffic failover to West US, and only direct traffic to other regions when both endpoints are unavailable. 您可以使用子設定檔並搭配「優先順序」流量路由方法來建立這個解決方案。You can create this solution using a child profile with the 'Priority' traffic-routing method.

搭配優先性容錯移轉的「效能」流量路由

由於西歐端點的優先順序高於美國西部端點,因此當兩個端點都在線上時,所有流量會傳送至西歐端點。Since the West Europe endpoint has higher priority than the West US endpoint, all traffic is sent to the West Europe endpoint when both endpoints are online. 如果西歐發生失敗,其流量就會導向美國西部。If West Europe fails, its traffic is directed to West US. 如果使用巢狀設定檔,則只有在西歐和美國西部都失敗時,流量才會導向東亞。With the nested profile, traffic is directed to East Asia only when both West Europe and West US fail.

您可以對所有區域重複此模式。You can repeat this pattern for all regions. 將父設定檔中的三個端點全部取代為三個子設定檔,每個都提供容錯移轉優先順序。Replace all three endpoints in the parent profile with three child profiles, each providing a prioritized failover sequence.

範例 4:控制相同區域中多個端點之間的「效能」流量路由Example 4: Controlling 'Performance' traffic routing between multiple endpoints in the same region

假設在設定檔中使用「效能」流量路由方法,而此設定檔在特定區域有多個端點。Suppose the 'Performance' traffic-routing method is used in a profile that has more than one endpoint in a particular region. 根據預設,導向該區域的流量會平均分散至該區域中所有可用的端點。By default, traffic directed to that region is distributed evenly across all available endpoints in that region.

「效能」流量路由區域內流量分配 (預設行為)

我們不是在西歐新增多個端點,而是將這些端點封入個別的子設定檔中。Instead of adding multiple endpoints in West Europe, those endpoints are enclosed in a separate child profile. 子設定檔新增至西歐唯一端點的父設定檔。The child profile is added to the parent as the only endpoint in West Europe. 子設定檔上的設定在西歐內啟用優先順序式或加權式的流量路由,可控制西歐的流量分配。The settings on the child profile can control the traffic distribution with West Europe by enabling priority-based or weighted traffic routing within that region.

搭配自訂區域內流量分配的「效能」流量路由

範例 5:每個端點的監視設定Example 5: Per-endpoint monitoring settings

假設您使用流量管理員,順暢地將流量從傳統內部部署網站移轉至裝載於 Azure 中的新雲端網站。Suppose you are using Traffic Manager to smoothly migrate traffic from a legacy on-premises web site to a new Cloud-based version hosted in Azure. 對於舊版的網站,您想要使用首頁 URI 來監視網站健康狀態。For the legacy site, you want to use the home page URI to monitor site health. 但對於新的雲端網站,您實作一個包含額外檢查的自訂監視頁面 (路徑 '/monitor.aspx')。But for the new Cloud-based version, you are implementing a custom monitoring page (path '/monitor.aspx') that includes additional checks.

流量管理員端點監視 (預設行為)

流量管理員設定檔中的監視設定會套用至單一設定檔中的所有端點。The monitoring settings in a Traffic Manager profile apply to all endpoints within a single profile. 在巢狀設定檔中,您針對每個網站使用不同的子設定檔來定義不同的監視設定。With nested profiles, you use a different child profile per site to define different monitoring settings.

搭配每個設定的流量管理員端點監視

後續步驟Next steps

深入了解流量管理員設定檔Learn more about Traffic Manager profiles

了解如何 建立流量管理員設定檔Learn how to create a Traffic Manager profile