High Availability for your Applications with Traffic Manager in Azure

Logo_traffic-manager

Hello guys, Today I’m bringing you Traffic Manager, a great solution that enables traffic routing based on DNS, whether for failover, performance, geographic access or weighted round robin.

  • Priority: Prioritize an endpoint and the others are in standby according to the configured priority.
  • Weighted: When there is a need to distribute traffic among a set of endpoints, either uniformly or according to defined weights.
  • Performance: When you have endpoints in different regions and end users distributed in those regions, prioritizing each one’s connection according to the “closest” endpoint.
  • Geographic: Users will be directed to specific endpoints (Azure, External or Nested), based on originating DNS queries.

Abaixo lhes mostro um Exemplo de Traffic Manager com base emPRIORIDADE:

For this lab, two test WEB servers were provisioned, one in Brazil and one in the United States, through a JSON template consisting of the distribution of Ubuntu Linux and Apache HTTP server.

  1. Through a JSON template, a Virtual Machine was configured in the SOUTH OF BRAZIL region, containing a test page with the title “Test Page Brazil” and with a simple body: “This Page is located in Brazil”TrafficManager1

    https://demositebrasil.brazilsouth.cloudapp.azure.comTrafficManager16

  2. Also, through the same JSON template, another Virtual Machine was configured in the EAST US 2 region, containing another test page with the title “Test Page USA” and with a simple body: “This Page is located in USA”TrafficManager2https://demositeeua.eastus2.cloudapp.azure.comTrafficManager17
  3. Below we can see the virtual machines that were created, one in Brazil and one in the USA, each with a page hosted on its respective server.TrafficManager3
  4. With the WEB server infrastructure created, the next step is to DEPLOY our Traffic Manager. Just go to the Marketplace and type “Traffic Manager Profile”, select it and click to create:TrafficManager4
    TrafficManager5
  5. It will then be necessary to define a name/address for this Traffic Manager, and in this case it was defined as an example, “trafficmanagerkieling.trafficmanager.net”. After that, select the routing method I mentioned in the introduction, whether it is based on priority, performance, weighted or geographic. In the example, Priority was selected:TrafficManager7
    TrafficManager6
  6. After creating the Traffic Manager, ENDPOINTS (Endpoint) are defined.
    TrafficManager8TrafficManager9When adding an ENDPOINT, you will need to choose one of the following types:

    Azure Endpoints: Used for endpoints hosted in Azure.
    External endpoints: Used for IPv4/IPv6 addresses or for services hosted outside Azure, which can be an on-premises environment or another cloud hosting provider.
    Nested endpoints: Used to combine with other Traffic Managers, creating more flexible and large-scale communication for more complex environments.

    • TrafficManager10

      For our first Endpoint, in this example, the name SiteBrasil was given, the type “Azure endpoint” was selected, considering that our Brazilian WEB server is hosted on Azure and also selected the destination type as “Public IP address”, that is, the external IP where my test web page is hosted, thus creating our first endpoint. Priority was also set equal to 1, prioritizing access to this first endpoint.

      TrafficManager11
      After creating the Brazil endpoint, it is necessary to create the second endpoint, naming it “SiteEUA”, also selecting the type “Azure endpoint”, considering that our second WEB server is in the USA. Then select the destination type as “Public IP address”, thus creating our second endpoint. Here Priority was set equal to 2, to always prioritize access through the Brazil page.

      TrafficManager12

  7. At the end of configuring STEP 7, we can see that our endpoints become enabled (Enabled) and with active monitoring (Online). It is also possible to view through a unique traffic manager address (https://trafficmanagerkieling.trafficmanager.net), that it is directing to the Brazil page, which we defined as having higher priority earlier, thus completing our Traffic Manager configurations:
    TrafficManager13
  8. At the end of configuring STEP 7, we can see that our endpoints become enabled (Enabled) and with active monitoring (Online). It is also possible to view through a unique traffic manager address (https://trafficmanagerkieling.trafficmanager.net), that it is directing to the Brazil page, which we defined as having higher priority earlier, thus completing our Traffic Manager configurations:

    TrafficManager15

    TrafficManager18
    —————————————————————-
    ————————Let’s Test!!!!!!

    <1>- To test our high availability, I will turn off our server in Brazil:

    TrafficManager19

    <2>- Note that now our Brazil Endpoint (SiteBrasil) is degraded.

    TrafficManager20

    <3>- And when accessing our Traffic Manager address, where we simulate the unavailability of the Page hosted in Brazil, traffic is automatically redirected to the Page hosted in the USA.

    TrafficManager21

    DID YOU SEE HOW EASY IT IS??? AND IT’S VERY USEFUL!!!

Leave a Reply

Your email address will not be published. Required fields are marked *