dns cdn

now browsing by tag

 
 

Configuring and using passive checks

Scenario:

You need to set up your smart DNS configuration so that the DNS resolution algorithm is driven by externally-fed performance/availability indicators.

In the following configuration example we will assume:

  • the FQDN that will be resolved by clients worldwide is mytest.gslb.eu. This is your website/application host name.
  • you have two servers (targets) that run contents for mytest.gslb.eu:
    • 1 server with IP address 8.8.8.8
    • 1 server with IP address 8.8.4.4
  • each server is considered available if its CPU load average is < 60% (this is handled by a passive check through metrics pushed to GSLB.me)

How to configure it:

Log on to GSLB.me using your credentials or register if you still don’t have an account

metrics.1

From the main interface dashboard, select the “Metrics” icon to start configuring your custom metrics

metrics.2

The metrics editor is displayed: here you can set up your metrics names, their type and description. After defining all the metrics you need you will be able to push them to GSLB.me. Free users can define an unlimited number of metrics but can only update one metric at a time per target. Two consecutive updates can be pushed to GSLB.me every 180 seconds. When buying and enabling “advanced metrics collection” for a geohost, an unlimited number of metrics can be pushed per target, with a minimum update interval of 30 seconds.

metrics.3

Define the new metrics with the name “cpu_load”, setting type to “percentage” and type its description. When done, click on “Add metric” to create it. Metrics names are case sensitive.

metrics.4

All defined metrics can be edited and deleted by using the table in the lower part of the screen.

metrics.5

After defining the “cpu_load” metrics, click on the “checks” section in the left section of the screen, then right-click on “Custom [right click here to add more]”. From the menu then select “Passive“.

metrics.6

The passive check configuration dashboard is displayed. Here you can type the check description and the expression to evaluate in order to determine the check status. Expressions can be fully customized: full instructions on the syntax to use can be found here

After typing the check description and the expression, click “Save“.

metrics.7

The newly created check is now displayed in the “Checks” section on the left.

metrics.8

Now click on the “Main” section and right-click the “gslb.eu” zone: from the menu that is displayed select “Add geohost“.

metrics.9

In the geohost configuration panel type the geohost name and save by clicking the “Save” button.

metrics.10

Now add the first target, by right-clicking the geohost name and by selecting “Add Target” from the menu.

metrics.11

In the target configuration panel type the target IP address and select the “Check CPU load” check you defined previously. This tells GSLB.me to check the target availability using the passive check. Once done, click “Save“.

metrics.12

The first target is then displayed in the relevant geohost (mytest.gslb.eu in this example).

metrics.13

Right-click the geohost name and select “Add Target” again from the menu, to create the second target.

metrics.14

In the target configuration panel type the target IP address and select the “Check CPU load” check you defined previously. This tells GSLB.me to check the target availability using the passive check. Once done, click “Save“.

metrics.15

The new geohost now needs to be committed to make it active. You can do this by right-clicking the geohost name and selecting “Commit changes“.

metrics.16

After committing the geohost, the “star” icon beside its name disappears. The geohost is now active.

Right-click the geohost name again and select “Show Status” from the menu.

metrics.17

The self-refreshing geohost status window is displayed and both targets are marked “down” since the “Check CPU load” is telling GSLB.me that both targets are not available. When the “Check CPU load” check was defined, its expression was “output=cpu_load<60“, so each target will be marked as “up” only when the “cpu_load” metrics will be less than 60. No “cpu_load” metrics have been pushed to GSLB.me so far, hence the check is returning a “down” response.

metrics.18

Now it’s time to push to GSLB.me the actual “cpu_load” readings from the two targets: this is accomplished through a simple REST service: “cpu_load” values are computed directly on your infrastructure/servers and can be pushed in a variety of ways, including simple “curl” commands, such as the following. Full instructions on how to use the metrics submission REST service can be found here.

metrics.19

After submitting the “cpu_load” readings and based on the “check schedule” parameter defined for each target, GSLB.me will update targets status and start delivering service based on your metrics, algorithms and business logic.

metrics.20

Dynamic CDN Offload

Scenario:

  • You have one or more datacenters running your application
  • Your application is mapped on a well-defined hostname (ie. www.myapplication.com)
  • You are using a third-party CDN (Content Delivery Network) solution to offload your traffic to your content provider
  • You need your clients traffic to be sent to your datacenter(s) as long as it/they is/are available
  • If one or more datacenters are not available you want your traffic to be dynamically and automatically offloaded to your CDN provider

Solution:

  • Use GSLB.me with your load balancing algorithm of choice and enable CDN offload
  • Define one geohost that will be pointed by www.myapplication.com via a DNS CNAME record
  • Create your target
  • Assign the relevant checks to the target
  • Configure the CNAME record on the primary DNS server that handles the domain myapplication.com

How to configure it:

  1. Register on GSLB.me and log on
  2. Select under which one of the available domains (gslb.us, gslb.info, …) you want to create your geohost. You can choose the domain you prefer, this is purely a “cosmetic” choice. Let’s choose mywebsite.gslb.eu
  3. Create your geohost: a geohost is the FQDN (Fully Qualified Domain Name) that your authoritative DNS will use as a CNAME for your application hostname (ie. www.myapplication.com). Select “Round robin” as your balancing algorithm. This can be any available algorithm, CDN offload overlays on top of all available balancing algorithms
  4. Define the target: the target’s IP address is a.b.c.d
  5. Select checks to be performed on the first target
  6. Configure your authoritative DNS to use a CNAME record to have www.myapplication.com point to mywebsite.gslb.eu
800true numbers under 600false false 800http://www.gslb.me/wp-content/plugins/thethe-image-slider/style/skins/frame-white
  • 5000 slideright true 60 bottom 30
    Slide1
    Go to http://go.gslb.me and logon. If you still don't have an account you can register and then logon.
  • 5000 slideright true 60 bottom 30
    Slide2
    Once logged in let's create a sample geohost named mywebsite.gslb.eu. We can choose any top level domain among those shown on the left hand side of the GSLB.me interface.
  • 5000 slideright true 100 bottom 30
    Slide15
    Next, we need to configure the geohost name (it will be prepended to the zone we selected in the previous step), set it to enable and select your balancing algorithm. Let's also enable CDN Offload and specify our CDN hostname, the number of minimum available targets to trigger CDN offload and the percentage of DNS requests that shall be offloaded to the CDN. We can configure DNS replies TTL from here. When done, let's click on "Save" to save changes
  • 5000 slideright true 60 bottom 30
    Slide4
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide5
    After creating the geohost we need to add targets: a target is the IP address of our application at each datacenter we are going to load balance. Let's right click on the geohost name and add the target from the popup menu that appears.
  • 5000 slideright true 80 bottom 30
    Slide6
    Let's now configure the IP address of our target, which is the IP address our application runs on the given datacenter. Then we also set priority to 1. This will set our geohost as primary. Checks schedule time can be set and the list of healthchecks to be performed is also configured here. Once done save the changes.
  • 5000 slideright true 60 bottom 30
    Slide7
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 80 bottom 30
    Slide8
    Now we completed our geohost and target configuration. We need to commit this setup to make it active. To do so let's right click on the geohost name on the left hand side of the screen and commit the changes. You can also commit pending changes clicking on the "Commit changes" button at the top of the screen.
  • 5000 slideright true 60 bottom 30
    Slide9
    After committing changes a confirmation popup is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide10
    We can now open the map to display our targets' geographical position and availability. Right click on the geohost name and open the map.
  • 5000 slideright true 60 bottom 30
    Slide11
    The map shows our targets position and current availability. The map is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide12
    We can now open the status window to see the status of all geohosts and their targets. Let's right click on the geohost name and open the window.
  • 5000 slideright true 60 bottom 30
    Slide13
    The status window shows the health of our geohosts and targets. It is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide14
    Let's now right click on the geohost name again to show the DNS entry we need to add to our authoritative DNS for the "myapplication.com" domain in this example.
  • 5000 slideright true 80 bottom 30
    Slide15
    In our example we will need to add to the "myapplication.com" DNS zone the entry "www.myapplication.com. 600 IN CNAME mywebsite.gslb.eu". This enables GSLB.me-based load balancing for your www.myapplication.com fully qualified domain name.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
^