dns failover

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

Active-Standby between 2 Datacenters

Scenario:

  • You have at least two datacenters running the same application. The primary datacenter is always active. In case of failure/disaster the secondary/backup datacenter must kick in taking control and providing access to your application (disaster recovery)
  • Your application is mapped on a well-defined hostname (ie. www.myapplication.com)
  • On the primary datacenter www.myapplication.com is running on IP a.b.c.d. One the secondary/backup datacenter www.myapplication.com is running on IP x.y.z.t
  • You need your clients traffic to be sent to the primary datacenter and, only in case of unavailability, be transparently sent to the secondary/backup datacenter

Solution:

  • Use GSLB.me in priority balancing mode
  • Define one geohost that will be pointed by www.myapplication.com via a DNS CNAME record
  • Create two targets, one for each datacenter
  • Assign the relevant checks to each 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 myapplication.gslb.info
  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 “Priority” as your balancing algorithm. This will enable active-standby distribution of incoming traffic towards your datacenters.
  4. Define the first target: the target’s IP address is a.b.c.d and its priority must be 1
  5. Select checks to be performed on the first target
  6. Define the second target: the target’s IP address is x.y.z.t and its priority must be any number higher than 1. This allows the “priority” balancing algorithm to handle active-standby.
  7. Select checks to be performed on the second target
  8. Configure your authoritative DNS to use a CNAME record to have www.myapplication.com point to myapplication.gslb.info
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
    Let's right click on the domain we choose in order to create a new geohost. Let's then click on the menu that is opened and let's add the new geohost.
  • 5000 slideright true 80 bottom 30
    Slide3
    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 "Priority" as the balancing algorithm. 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
    Slide7
    Let's now configure the IP address of our target, which is the IP address our application runs on on the given datacenter. Let's 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 let's save the changes.
  • 5000 slideright true 80 bottom 30
    Slide9
    Let's now configure the IP address of our second target, which is the IP address our application runs on on the given datacenter. Let's also set priority to 2. This will set our geohost as secondary. Checks schedule time can be set and the list of healthchecks to be performed is also configured here. Once done let's save the changes.
  • 5000 slideright true 60 bottom 30
    Slide10
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide11
    Now we completed our geohost and targets 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.
  • 5000 slideright true 60 bottom 30
    Slide12
    After committing changes a confirmation popup is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide13
    We can now open the map to show our targets' geographical position and availability. Let's right click on the geohost name and open the map.
  • 5000 slideright true 60 bottom 30
    Slide14
    The map shows our targets positions and current availability. It is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide15
    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
    Slide16
    The status window shows the health of our geohosts and targets. It is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide18
    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
    Slide17
    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
16

Load balancing between two datacenters

Scenario:

  • You have at least two datacenters running the same application and both datacenters are simultaneously active (business continuity)
  • Your application is mapped on a well-defined hostname (ie. www.myapplication.com)
  • On the  first datacenter www.myapplication.com is running on IP a.b.c.d. One the second datacenter www.myapplication.com is running on IP x.y.z.t
  • You need your clients traffic to be equally split between the two datacenters

Solution:

  • Use GSLB.me in round robin balancing mode
  • Define one geohost that will be pointed by www.myapplication.com via a DNS CNAME record
  • Create two targets, one for each datacenter
  • Assign the relevant checks to each 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 will enable active-active distribution of incoming traffic towards your datacenters
  4. Define the first target: the target’s IP address is a.b.c.d
  5. Select checks to be performed on the first target
  6. Define the second target: the target’s IP address is x.y.z.t
  7. Select checks to be performed on the second target
  8. 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 60 bottom 30
    Slide3
    Let's right click on the domain we choose in order to create a new geohost.
  • 5000 slideright true 80 bottom 30
    Slide4
    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 "Round Robin" as the balancing algorithm. We can configure DNS replies TTL from here. When done, let's click on "Save" to save changes.
  • 5000 slideright true 60 bottom 30
    Slide5
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide6
    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
    Slide7
    Let's now configure the IP address of our target, which is the IP address our application runs on the given datacenter. Checks schedule time can be set and the list of healthchecks to be performed is also configured here. Once done let's save the changes.
  • 5000 slideright true 60 bottom 30
    Slide8
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 80 bottom 30
    Slide9
    Let's now configure the IP address of our second target, which is the IP address our application runs on on the given datacenter. Checks schedule time can be set and the list of healthchecks to be performed is also configured here. Once done, let's save the changes.
  • 5000 slideright true 60 bottom 30
    Slide10
    After clicking on "Save" changes are committed and confirmation is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide11
    Now we completed our geohost and targets 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.
  • 5000 slideright true 60 bottom 30
    Slide12
    After committing changes a confirmation popup is displayed at the bottom of the screen.
  • 5000 slideright true 60 bottom 30
    Slide15
    We can now open the map to show our targets' geographical position and availability. Let's right click on the geohost name and open the map.
  • 5000 slideright true 60 bottom 30
    Slide16
    The map shows our targets positions and current availability. It is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide17
    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
    Slide18
    The status window shows the health of our geohosts and targets. It is automatically refreshed every 5 seconds.
  • 5000 slideright true 60 bottom 30
    Slide13
    Let's now right click on the geohost name again to display 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
    Slide14
    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
16
17
18
^