教學課程:在流量管理員中設定加權流量路由方法Tutorial: Configure the weighted traffic routing method in Traffic Manager

常見的流量路由方法提供一組完全相同的端點 (包括雲端服務和網站),並以均等的方式將流量傳送到每一個端點。A common traffic routing method pattern is to provide a set of identical endpoints, which include cloud services and websites, and send traffic to each equally. 下列步驟概述如何設定這種類型的流量路由方法。The following steps outline how to configure this type of traffic routing method.

注意

Azure Web 應用程式已為 Azure 區域 (可能包含多個資料中心) 內的網站提供循環配置資源負載平衡功能。Azure Web App already provides round-robin load balancing functionality for websites within an Azure Region (which may comprise multiple datacenters). 流量管理員可讓您將流量分散到位於不同資料中心的網站。Traffic Manager allows you to distribute traffic across websites in different datacenters.

設定加權流量路由方法To configure the weighted traffic routing method

  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. 在入口網站的搜尋列中,搜尋「流量管理員設定檔」 ,然後按一下您想要設定路由方法的設定檔名稱。In the portal’s search bar, search for the Traffic Manager profiles and then click the profile name that you want to configure the routing method for.
  3. 在 [流量管理員設定檔] 刀鋒視窗中,確認您想要納入組態的雲端服務和網站皆存在。In the Traffic Manager profile blade, verify that both the cloud services and websites that you want to include in your configuration are present.
  4. 在 [設定] 區段中,按一下 [組態] ,並在 [組態] 刀鋒視窗中,完成下列設定:In the Settings section, click Configuration, and in the Configuration blade, complete as follows:
    1. 在 [流量路由方法設定] 中,確認流量路由方法為 [加權] 。For traffic routing method settings, verify that the traffic routing method is Weighted. 如果不是,按一下下拉式清單中的 [加權] 。If it is not, click Weighted from the dropdown list.
    2. 將此設定檔中的所有端點都設定為如下所示的相同「端點監視設定」 :Set the Endpoint monitor settings identical for all every endpoint within this profile as follows:
      1. 選取適當的 [通訊協定] ,並指定 [連接埠] 號碼。Select the appropriate Protocol, and specify the Port number.
      2. 針對 [路徑] ,輸入正斜線 /For Path type a forward slash /. 若要監視端點,您必須指定路徑和檔案名稱。To monitor endpoints, you must specify a path and filename. 正斜線 "/" 是相對路徑的有效項目,表示檔案位於根目錄 (預設值)。A forward slash "/" is a valid entry for the relative path and implies that the file is in the root directory (default).
      3. 按一下頁面頂端的 [儲存] 。At the top of the page, click Save.
  5. 測試組態中的變更,如下所示:Test the changes in your configuration as follows:
    1. 在入口網站的搜尋列中,搜尋流量管理員設定檔名稱,並按一下於結果中顯示的流量管理員設定檔。In the portal’s search bar, search for the Traffic Manager profile name and click the Traffic Manager profile in the results that the displayed.
    2. 在 [流量管理員設定檔] 刀鋒視窗中,按一下 [概觀] 。In the Traffic Manager profile blade, click Overview.
    3. [流量管理員設定檔] 刀鋒視窗會顯示新建立之流量管理員設定檔的 DNS 名稱。The Traffic Manager profile blade 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. 在此情況下,所有要求都會以循環配置資源方式路由到每個端點。In this case all requests are routed each endpoint in a round-robin fashion.
  6. 在流量管理員設定檔運作後,您可以編輯授權 DNS 伺服器上的 DNS 記錄,以將您的公司網域名稱指向流量管理員網域名稱。Once your Traffic Manager profile is working, edit the DNS record on your authoritative DNS server to point your company domain name to the Traffic Manager domain name.

使用流量管理員設定加權流量路由方法

後續步驟Next steps