Bobcares

Cloudflare load balancing failover | Configuration steps

by | Oct 22, 2022

In this Cloudflare load balancing failover article, you will learn to configure Cloudflare load balancing while highlighting its key features and advantages with help of our Server management support services at Bobcares.

Cloudflare load balancing failover

Read on to start creating your own load balancer.

Cloudflare load balancing failover

Configuring a Failover for Traffic Steering

 

You need to know the different available failover configurations. Server failover requires having a backup server configured to serve traffic and take over if the primary origin server) becomes unavailable.

 

Cloudflare’s common failover configurations include:

 
  • Active – Passive: The primary origin services all traffic and the passive, or alternative origin until it is unavailable. This is promoted to service all traffic instead.
 
  • Active – Active: All origins are available to service traffic, with traffic divided between them.
 

Steering Traffic with Active-Passive Failover

 

An active-passive failover configuration steers the traffic in your active pool until a failure threshold occurs. The load balancer will then redirect traffic to the secondary origin when the failure happens.

 

This configuration provides uninterrupted service, especially during planned outages. This might result in slow responses due to traffic being directed to a single origin.

 

To have an active-passive failover, you will need to have a load balancer with two origin pools.

 

1. Open any web browser and log in to the Cloudflare dashboard.

 

2. Next create the origin pool and set the pool as your first primary pool to load balancer.

 

An origin pool consists of many servers known by their IP addresses or hostnames. Cloudflare load balancing redirects traffic to the host according to the health and weight of each origin.

 

3. In the “Origins” section, click Add Origin to add a second origin to the existing pool >> click Next.

 

4. Finally, select the Off option to direct traffic from the unhealthy pool to the healthy pool in the configuration. Click Next to save the configuration.

 

From this configuration, the load balancer will direct all traffic to the primary. Until the primary pool has fewer available origins than specified in its health threshold. Only then load balancer will direct traffic to the secondary pool.

 

Steering Traffic with Active-Active Failover

 

An active-active failover steers traffic to servers within the pool. Until the pool reaches its configured failure threshold. The load balancer then redirects traffic to the set fallback pool when a failure occurs.

 

Create two origin pools “primary and secondary”. Then save the origin pool configurations. This you will next use in step 3 of the “Creating a Load Balancer” section.

 

Creating a Load Balancer

 

Cloudflare load balancing enhances application performance and activity by channeling traffic away from unhealthy and unavailable servers. At the same time, dynamically distributes the traffic to any available and responsive server pools without experiencing any latency.

 

The very first step is to create a hostname. A load balancer defaults to the root hostname, you can also set a unique hostname matching your requirements.

 

1. On the Cloudflare dashboard. Click on the Traffic menu >> click on the Load Balancing tab to launch the creation page. Select “Create Load Balancer” to configure a new load balancer.

 

2. Next, configure a hostname. DNS name that hosts the load balancer

 

You can select to proxy or not to proxy traffic to hostname through Cloudflare. By clicking on the right of the hostname input box.

 
  • Move the session-based load balancing toggle for Session Affinity. When session affinity is enabled, your load balancer will direct all requests from a particular end-user to a specific origin server.

 

  • Click “Next” to load the Origin Pool page.
 

3. Select an existing pool from the dropdown box. Click Add Pool or click on Create a new origin pool to create a new one. Then click Next.

 

4. Select an existing Cloudflare monitor or create a new one to attach the origin pool >> click Next.

 

5. Select any option that is shown under Add Traffic Steering. Choose the conventional failover (Off) option. Then click Next.

 

6. Finally, review the summary of the configuration. Click on the “Save and Deploy” button to deploy a new load balancer.

 

Editing and Deleting Load Balancer Configurations

 

In case you made some errors while creating the load balancer, You can either edit or delete the configurations through the Cloudflare dashboard. You can set custom rules or reuse monitors and pools between multiple load balancers.

 

1. Go to the Traffic page and click the Load Balancing button.

 

2. Next, click on either Edit or Delete depending on your target load balancer configuration.

 

3. Update the settings as required through the creation workflow. If you are editing a load balancer configuration.

 

4. Click the Save option after all the changes are done.

 

[Looking for a solution to another query? We are just a click away.]

 

Conclusion

 

From this article, you have created a load balancer. Also checked to steer traffic with two different failovers for the load balancer. Ensuring the high availability of your website.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF