教學課程:使用流量管理員設定地理流量路由方法Tutorial: Configure the geographic traffic routing method using Traffic Manager

地理流量路由方法可讓您根據要求的來源地理位置,將流量導向特定的端點位置。The Geographic traffic routing method allows you to direct traffic to specific endpoints based on the geographic location where the requests originate. 本教學課程示範如何使用這個路由方法來建立流量管理員設定檔,並設定端點以接收來自特定地理位置的流量。This tutorial shows you how to create a Traffic Manager profile with this routing method and configure the endpoints to receive traffic from specific geographies.

建立流量管理員設定檔Create a Traffic Manager Profile

  1. 從瀏覽器登入 Azure 入口網站From a browser, sign in to the Azure portal. 如果您沒有帳戶,您可以註冊免費試用一個月If you don’t already have an account, you can sign up for a free one-month trial.
  2. 按一下 [建立資源] > [網路] > [流量管理員設定檔] > [建立] 。Click Create a resource > Networking > Traffic Manager profile > Create.
  3. 在 [建立流量管理員設定檔] 中:In the Create Traffic Manager profile:
    1. 提供設定檔的名稱。Provide a name for your profile. 此名稱必須是 trafficmanager.net 區域內的唯一名稱。This name needs to be unique within the trafficmanager.net zone. 若要存取流量管理員設定檔,您可以使用 DNS 名稱 <profilename>.trafficmanager.netTo access your Traffic Manager profile, you use the DNS name <profilename>.trafficmanager.net.
    2. 選取 [地理] 路由方法。Select the Geographic routing method.
    3. 選取您要用來建立此設定檔的訂用帳戶。Select the subscription you want to create this profile under.
    4. 使用現有的資源群組,或建立新的資源群組來放置此設定檔。Use an existing resource group or create a new resource group to place this profile under. 如果您選擇建立新的資源群組,請使用 [資源群組位置] 下拉式清單來指定資源群組的位置。If you choose to create a new resource group, use the Resource Group location dropdown to specify the location of the resource group. 這項設定是指資源群組的位置,完全不影響將部署到全球的流量管理員設定檔。This setting refers to the location of the resource group, and has no impact on the Traffic Manager profile that's deployed globally.
    5. 按一下 [建立] 之後,就會建立流量管理員設定檔並部署到全球。After you click Create, your Traffic Manager profile is created and deployed globally.

建立流量管理員設定檔

新增端點Add endpoints

  1. 在入口網站的搜尋列中,搜尋您建立的流量管理員設定檔名稱,然後在結果出現時按一下。Search for the Traffic Manager profile name you created in the portal’s search bar and click on the result when it is shown.
  2. 在 [流量管理員] 中,瀏覽至 [設定] -> [端點]Navigate to Settings -> Endpoints in Traffic Manager.
  3. 按一下 [新增] 以顯示 [新增端點] 。Click Add to show the Add Endpoint.
  4. 按一下 [新增] ,然後在顯示的 [新增端點] 中,如下所示操作︰Click Add and in the Add endpoint that is displayed, complete as follows:
  5. 根據您要新增的端點類型而定,選取 [類型] 。Select Type depending upon the type of endpoint you are adding. 針對生產環境中使用的地理路由設定檔,我們強烈建議使用巢狀端點類型,而且包含的子設定檔中有多個端點。For geographic routing profiles used in production, we strongly recommend using nested endpoint types containing a child profile with more than one endpoint. 如需詳細資訊,請參閱地理流量路由方法的常見問題集For more details, see FAQs about geographic traffic routing methods.
  6. 提供您要用來識別這個端點的 [名稱] 。Provide a Name by which you want to recognize this endpoint.
  7. 此頁面上的某些欄位,取決於您要新增的端點類型︰Certain fields on this page depend on the type of endpoint you are adding:
    1. 如果您要新增 Azure 端點,請根據您想要將流量導向的資源,選取 [目標資源類型] 和 [目標] If you are adding an Azure endpoint, select the Target resource type and the Target based on the resource you want to direct traffic to
    2. 如果您要新增外部 端點,請提供 [完整網域名稱 (FQDN)] 端點。If you are adding an External endpoint, provide the Fully-qualified domain name (FQDN) for your endpoint.
    3. 如果您要新增巢狀端點,請選取對應至您想要使用之子設定檔的 [目標資源] ,並指定 [子端點計數下限] 。If you are adding a Nested endpoint, select the Target resource that corresponds to the child profile you want to use and specify the Minimum child endpoints count.
  8. 在 [地區對應] 區段中,使用下拉式清單新增區域,表示您想要將這些區域的流量傳送至此端點。In the Geo-mapping section, use the drop down to add the regions from where you want traffic to be sent to this endpoint. 您必須新增至少一個區域,而且可以對應多個區域。You must add at least one region, and you can have multiple regions mapped.
  9. 針對您想要在此設定檔下新增的所有端點,重複此步驟Repeat this for all endpoints you want to add under this profile

新增流量管理員端點

使用流量管理員設定檔Use the Traffic Manager profile

  1. 在入口網站的搜尋列中,搜尋您在上一節建立的流量管理員設定檔名稱,然後在顯示的結果中按一下流量管理員設定檔。In the portal’s search bar, search for the Traffic Manager profile name that you created in the preceding section and click on the traffic manager profile in the results that the displayed.
  2. 按一下 [概觀] 。Click Overview.
  3. [流量管理員設定檔] 會顯示新建立之流量管理員設定檔的 DNS 名稱。The Traffic Manager profile displays the DNS name of your newly created Traffic Manager profile. 這可由任何用戶端使用 (例如使用網頁瀏覽器進行瀏覽),以路由傳送至由路由類型所決定的正確端點。This can be used by any clients (for example, by navigating to it using a web browser) to get routed to the right endpoint as determined by the routing type. 如果是地理路由,流量管理員會查看連入要求的來源 IP ,判斷其來源區域。In the case of geographic routing, Traffic Manager looks at the source IP of the incoming request and determines the region from which it is originating. 如果該區域對應至端點,流量會路由傳送至該處。If that region is mapped to an endpoint, traffic is routed to there. 如果此區域未對應至端點,流量管理員會傳回 NODATA 查詢回應。If this region is not mapped to an endpoint, then Traffic Manager returns a NODATA query response.

後續步驟Next steps