High Availability on FreeBSD: The service IP address, part 1

NOTE: This entry is an adaptation of the Linux version.

In a previous post, we saw what is high availability and what we address when a consumer tries to access a service: The closest possible availability time to 100%.

This entry describes what is the service IP address -entry point to them- and how to setup it using two servers.

To implement the things described under these lines is necessary to have two physical or virtual servers and FreeBSD installed on them.

In order to avoid excessively long entries, I splitted this one into two parts. This first part is an introduction and preparation of systems, while the second shows how to setup the proper service IP address.

The service IP address

When we access a service, the connection is made to an IP address, in a direct way (192.0.2.100) or through a hostname (www.example.com).

Suppose we want to access to a web page (http://www.example.com) and that its associated IP address is “192.0.2.100”. This IP address, through which the page is accessible, is called the “service IP address”.

The objective is to have this IP address always available. For consumers the perception should be like the following image:

To achieve it, having a minimum of two servers, one will have the service IP address assigned and the other will be waiting just in case the first one fails to take it.

If server “server-1” weren’t functional, then server “server-2” would use the service IP address. The service will be degraded -one component in a fail state- but operative and accesible for the consumer.

If no server is available, the service cannot be given as the service IP address cannot be assigned to any of them.

The consumer can’t access the service. It perception will vary:

The method which allows a server to use a service IP address previously assigned to another one when it becomes unavailable is called “IP failover“.

Multiple standard protocols which implement IP failover methods exist. For this post, we will be using CARP.

Required setup

Before we start we must have the necessary material prepared.

We will use two servers called “server-1” and “server-2”. I have used FreeBSD 11.2.

Both servers are connected through “em0” network interface to a switch and belong to 192.0.2.0/24 subnet. The switch is connected to a router whose IP address is 192.0.2.1 and acts as a gateway.

The following diagram shows the equipment interconnection:

We will note both servers information for further reference:

System preparation

In FreeBSD all you have to do is load the kernel module.

We will instruct the system to load it each time it boots adding an entry to /boot/loader.conf file.

And then we load the module to use it without a reboot:

At this point we will verify the following:

– The “carp” module is loaded:

Once everything has been checked, we can start configuring the service IP address, but this will be on the next entry on this serie.

Esta entrada también está disponible en: esEspañol (Spanish)

Leave a Reply

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