---
title: "Azure Network Load Balancing & Failover: Install the SafeKit farm.safe Module"
canonical: "https://safekit.eviden.com/quick-install/safekit-quick-installation-guide-in-azure-with-network-load-balancing-and-failover/"
description: "Enhance Azure Network Load Balancing with SafeKit's intelligent application monitoring. The farm.safe module provides a dedicated health check for the Azure load balancer, enabling seamless HA at the application level. Achieve automatic self-healing and failover for mission-critical applications."
category: "quick-install"
lang: "en"
topics: "High Availability Quick Installation Guide for Azure, SafeKit High Availability Limitations, Overview of the SafeKit / Azure solution, Installation of the SafeKit / Azure solution on Windows and Linux (farm.safe), Step by step configuration of the SafeKit / Azure solution, Demonstration of the SafeKit farm solution"
---

# Azure Network Load Balancing & Failover: Install the SafeKit farm.safe Module {#azure-network-load-balancing--failover-install-the-safekit-farmsafe-module}

## High Availability Quick Installation Guide for Azure {#quick-guide}

This guide explains how to set up a **<span class="notranslate farm-term" translate="no">farm</span> cluster** for Azure using SafeKit, ensuring network load balancing and automatic failover.

For help, you can use [SafeKit AI 🤖](https://safekit.eviden.com/resources/safekit-support/).

### 1. Overview

  * **Architecture:** Implements a scalable, multi-node load-balanced <span class="notranslate farm-term" translate="no">farm</span> with a virtual IP address.
  * **High Availability:** Features automatic health monitoring and seamless failover to **ensure service continuity**.

### 2. Installation

  * **Software:** Install the SafeKit engine on all servers.
  * **Module:** Download the pre-configured `farm.safe` application module.

### 3. Configuration

  * **Web Console:** Configure the Azure <span class="notranslate farm-term" translate="no">farm</span> cluster.
  * **Monitoring:** Start monitoring and protecting the Azure application.

## SafeKit High Availability Limitations {#safekit-ha-limitations}

Limit / Requirement | Reason & Impact | Recommended Alternative  
---|---|---  
Replication size: A few TBs |  Resynchronization time after failure ([step 3](https://safekit.eviden.com/architectures/file-replication-byte-level-with-failover-mirror-cluster/#safekit-mirror-cluster)): <br>• 1 Gb/s network ≈ 3 hours / TB<br>• 10 Gb/s network ≈ 1 hour / TB (depending on disk write performance)  |  • Use [external shared storage](https://safekit.eviden.com/best-practises/san-vs-nas-shared-storage-for-a-failover-cluster/). This solution is more expensive and more complex.   
File count: < 1,000,000 files |  • Long resynchronization time after a failure ([step 3](https://safekit.eviden.com/architectures/file-replication-byte-level-with-failover-mirror-cluster/#safekit-mirror-cluster)).<br>• Time needed to compare each file on both nodes.  |  • Put the files to replicate in a virtual hard disk or in a virtual machine.<br>• In this case, only the files of the virtual hard disk or of the virtual machine are replicated and resynchronized.   
Failover capacity: ≤ 32 VMs |  • Each VM runs in an independent mirror module.<br>• A cluster can run a maximum of 32 mirror modules.  |  • Use external shared storage and another VM clustering solution. This solution is more expensive and more complex.   
Network architecture: LAN or VLAN between remote sites |  • Automatic failover of the [virtual IP address](https://safekit.eviden.com/best-practises/how-a-virtual-ip-address-works/) when both nodes are in the same subnet.<br>• Good bandwidth for resynchronization ([step 3](https://safekit.eviden.com/architectures/file-replication-byte-level-with-failover-mirror-cluster/#safekit-mirror-cluster)).<br>• Low latency for [synchronous replication](https://safekit.eviden.com/best-practises/synchronous-replication-vs-asynchronous-replication/): typically an RTT below 5 ms. Validate higher values against the write rate of the application.  |  • If the two nodes are in different subnets, which is common in the cloud, use one of the [other IP rerouting solutions](https://safekit.eviden.com/best-practises/how-a-virtual-ip-address-works/#safekit-virtual-ip-implementation): a load balancer, the command-line tools of the cloud provider, BGP routing or DNS redirection.<br>• Use [backup solutions](https://safekit.eviden.com/best-practises/high-availability-disaster-recovery-hadr/) with asynchronous replication for high-latency networks.   

 

## Overview of the SafeKit / Azure solution {#overview-of-the-safekit--azure-solution}

The solution is described here: **💡[SafeKit: Microsoft Azure Load Balancing & Application High Availability <span class="notranslate farm-term" translate="no">Farm</span> Cluster](<https://safekit.eviden.com/solutions/azure-load-balancing-cluster-failover/>)**.

## Installation of the SafeKit / Azure solution on Windows and Linux (farm.safe) {#installation-of-the-safekit--azure-solution-on-windows-and-linux-farmsafe}

### Configuration of the Microsoft Azure load balancer {#configuration-of-the-microsoft-azure-load-balancer}

The load balancer must be configured with a virtual IP address.  
And the load balancer must be configured to periodically send health packets to nodes.  
For that, SafeKit provides a health check which runs inside the nodes and which

  * returns OK when the <span class="notranslate farm-term" translate="no">farm</span> module state is UP (green)
  * returns NOT FOUND in all other states

You must configure the Microsoft Azure load balancer with:

  * HTTP protocol
  * port 9010, the SafeKit web server port
  * URL /var/modules/farm/ready.txt (if <span class="notranslate farm-term" translate="no">farm</span> is the module name that you will deploy later)

For more information, see [the configuration of the Microsoft Azure load balancer](<https://learn.microsoft.com/en-us/azure/load-balancer/>). 

⚠️ Do not configure a virtual IP address and load balancing rules at step 4 in the step by step configuration below. The virtual IP address and load balancing rules are already set in the Microsoft Azure load balancer. Setting a virtual IP and load balancing rules at step 4 is useful for on-premise configuration only.

### Configuration of the Microsoft Azure network security {#configuration-of-the-microsoft-azure-network-security}

The network security must be configured to enable communications for the following protocols and ports:

  * UDP - 4800 for the safeadmin service (between SafeKit nodes)
  * UDP - 4803 for the heartbeats inside the <span class="notranslate farm-term" translate="no">farm</span> module (between SafeKit nodes)
  * TCP – 9010 for the load-balancer health check and for the SafeKit web console running in the http mode
  * TCP – 9001 to configure the https mode for the console
  * TCP – 9453 for the SafeKit web console running in https mode

### Package installation on Windows

  * Download and install the free version of SafeKit on 2 Windows nodes.   
Note: the free version includes all SafeKit features. At the end of the trial, you can activate permanent license keys without uninstalling the package. 
  * Upon completing the package installation, select **Set console credentials and firewall rules now** and configure a password for the **admin** user of the SafeKit console.   
**Set the same password on all nodes.**
  * Exclude from antivirus scans **C:/safekit/** (the default installation directory) and **all replicated folders** that you are going to define.   
Antiviruses may face detection challenges with SafeKit due to its close integration with the OS, virtual IP mechanisms, real-time replication and restart of critical services. 

<a class="btn-download" href="/resources/safekit-free-trial/">Download SafeKit (Windows) &gt;</a>

### Package installation on Linux

  * Install the free version of SafeKit on 2 Linux nodes. Note: the free trial includes all SafeKit features. At the end of the trial, you can activate permanent license keys without uninstalling the package.
  * After the download of safekit_xx.bin package, execute it to extract the rpm and the safekitinstall script and then execute the **safekitinstall** script
  * Answer **yes** to firewall automatic configuration
  * Set the password for the web console and the default user **admin**. **Set the same password on all nodes.**

<a class="btn-download" href="/resources/safekit-free-trial/">Download SafeKit (Linux) &gt;</a>

 

Note: the generic **farm.safe** module that you are going to configure is delivered inside the package.

## Step by step configuration of the SafeKit / Azure solution {#step-by-step-configuration-of-the-safekit--azure-solution}

### Prerequisites

  * Install  on at least 2 nodes.
  * For virtual IP load balancing, all nodes must be on the same LAN or extended LAN (layer 2). Routed layer 3 networks require 🛠️ [cloud load balancers](https://safekit.eviden.com/resources/safekit-user-guide-82/#Cloud).

### 1. Launch the SafeKit console

  * On one cluster node, open a browser and connect to `http://localhost:9010`.
  * Sign in with the user name `admin` and the password set during installation.

You can also open the console from a workstation outside the cluster.

⚠️ Use a single browser to configure both nodes with SafeKit.

ℹ️ To secure the web console, see 🛠️ [11\. Securing the SafeKit web service](https://safekit.eviden.com/resources/safekit-user-guide-82/#https) in the User's Guide.

![SafeKit web console for the  cluster](https://safekit.eviden.com/wp-content/uploads/2024/03/01-login-large.png)

### 2. Configure node addresses

  * Enter the IP address of each node. Press the Tab key to check the connection and fill in the node names.
  * If `node1` or `node2` is red, check that the browser can reach both nodes. Check the firewall on each node. See 🛠️ [troubleshooting](https://safekit.eviden.com/resources/safekit-user-guide-82/#Troubleshooting).
  * Click `Save and apply` to save the configuration.
  * Check that both nodes display ✅ `Success`.
  * If a node displays ❌ `Failure`, expand its ▼ panel and read the messages. Use the SafeKit AI 🤖 if you need help.

ℹ️ To add a second heartbeat network and a dedicated replication network, click the first ➕ button in `LAN and nodes`.

ℹ️ Click `Advanced configuration` to view the file `cluster.xml`. The console fills in this file and deploys it on both nodes.

![Node addresses for the  cluster](https://safekit.eviden.com/wp-content/uploads/2024/03/02-cluster-edit.png)

### 3. Select a module

  * In `New module`, select the module `farm.safe`.

ℹ️ In the blue banner, 🛜 `node1` is the node connected to the console. It forwards requests to `node2` when needed.

ℹ️ If you added a module file `xxx.safe` during installation, the console looks for it in the directory `Application_Modules/generic/` on `node1`.

![Choose the module for ](https://safekit.eviden.com/wp-content/uploads/2024/03/04-module-new.png)

### 4. Configure the module

  * In `Module startup at boot`, set the module to start automatically at boot, without delay.
  * In `Macros` / `SERVICES`, list the application services in startup order. Separate the names with commas.
  * In `Heartbeat networks`, keep one heartbeat network unless you added a LAN in step 2.
  * In `Virtual IP addresses`, enter a virtual IP address in the same subnet as both nodes.
  * Configure application clients to use this virtual IP address or its DNS name.
  * In `Load balancing rules`, enter the service port to balance, for example TCP port 9010.
  * In `Load balancing rules`, select `Source address` or `Source port`:
    * `Source address`: all TCP connections from the same client go to the same node in the <span class="notranslate farm-term" translate="no">farm</span>. This preserves the client's session context on that node.
    * `Source port`: TCP connections from the same client can go to different nodes in the <span class="notranslate farm-term" translate="no">farm</span>. Session context is not shared between nodes.
  * In `Checkers`, add checks if needed: process monitoring, custom checks, TCP, ping, or split-brain checks.
  * A process listed in `Monitored processes/services` is monitored and restarted if it fails. An incorrect process name causes the module to stop immediately after startup.

ℹ️ Click `Advanced configuration` to view the file `userconfig.xml`. The console fills in this file and deploys it on both nodes with the restart scripts.

ℹ️ In a cloud deployment, the 🛠️ [cloud load balancer](https://safekit.eviden.com/resources/safekit-user-guide-82/#Cloud) manages the virtual IP address and load balancing rules. Do not configure them in SafeKit.

ℹ️ When you apply the configuration, SafeKit sets the Windows service startup type to `Manual`. Services start with the module, not at system boot. SafeKit also prevents these services from starting at system boot on Linux.

![Module settings for the  <span class="notranslate farm-term" translate="no">farm</span>](https://safekit.eviden.com/wp-content/uploads/2025/05/36-module-farm-config-edit-1.jpg)

### 5. Edit scripts (optional)

  * In most cases, you can skip this step. The scripts are already configured to restart the services listed in the previous step.
  * Click `Next step` if no changes are needed.
  * The script `start_both.ps1` starts services in the order of the list `SERVICES`.
  * The script `stop_both.ps1` stops services in reverse order.
  * The script `start_both.ps1` also checks each service. It stops the module if a service fails to start.

![Restart scripts for the  module](https://safekit.eviden.com/wp-content/uploads/2025/05/35-module-iis-edit-script-1.png)

### 6. Communication encryption (optional)

  * Keep communication encryption enabled between nodes.

![Communication encryption for the  module](https://safekit.eviden.com/wp-content/uploads/2025/05/07-module-encryption-1.png)

### 7. Save and apply

  * Click `Save and apply` to deploy the configuration and scripts on both nodes.

![Configuration deployment for the  module](https://safekit.eviden.com/wp-content/uploads/2025/05/08-module-save-1.png)

### 8. Check the configuration result

  * Check that both nodes display ✅ `Success`. Then click `Monitor modules`.
  * If a node displays ❌ `Failure`, expand its ▼ panel and read the messages. Use the SafeKit AI 🤖 if you need help.

![Configuration result for the  module](https://safekit.eviden.com/wp-content/uploads/2025/05/09-module-save-check-1.png)

### 9. Start the <span class="notranslate farm-term" translate="no">farm</span> cluster on node 1 and node 2

  * Open the ⋯ menu and select `Start` on both nodes, as shown in the image.

![Start the  cluster on both nodes](https://safekit.eviden.com/wp-content/uploads/2024/03/11-monitoring-farm-stop-stop-start.png)

### 10. Wait until both nodes are `UP` (green)

<p>Both nodes must reach the state <code>UP</code> (green). This means that the script <code>start_both</code> has run on both nodes.</p>

<p>⚠️ If a node does not reach <code>UP</code> (green), or if the application does not start, check its <a href="/wp-content/uploads/2024/03/37-module-log-farm-script.png">module log 🖼️</a>.</p>

  * Click the 🔍 icon for `node1` or `node2` to open the module log. Look for errors, such as a check that stopped the module.
  * In the log, click `start_both`. The script output appears on the right. Check for service startup errors.
  * Use the SafeKit AI 🤖 for help with log messages.

ℹ️ Use the 🕒 **[timeline 🖼️](https://safekit.eviden.com/wp-content/uploads/2026/05/safekit-console-timeline.png)** to understand the sequence of events in the cluster.

![Both nodes of the  cluster are running](https://safekit.eviden.com/wp-content/uploads/2024/03/15-monitoring-up-up.png)

### 11. Testing

SafeKit includes a built-in mosaic test. See [Testing the load balancing virtual IP address in a SafeKit farm cluster](https://safekit.eviden.com/best-practises/test-load-balancing-vip-farm/).

![Test the virtual IP address of  with the mosaic](https://safekit.eviden.com/wp-content/uploads/2024/03/appli-19.png)

ℹ️ See the [SafeKit Online Training](https://safekit.eviden.com/resources/safekit-on-line-training/) for more details and videos.

### 12. Support

  * For support, create one SafeKit `Snapshot` per node. Collect the 2 .zip files.

ℹ️ See [SafeKit Support](https://safekit.eviden.com/resources/safekit-support/) for more information.

![Support snapshots for the  cluster](https://safekit.eviden.com/wp-content/uploads/2026/09/32-snapshots-network-load-balancing-cluster.png)

 

## Demonstration of the SafeKit <span class="notranslate farm-term" translate="no">farm</span> solution {#demonstration-of-the-safekit-farm-solution}

### SafeKit Video: Network Load Balancing and Virtual IP Management (5:03) {#demo-farm}

In this video, learn how to implement a **virtual IP address** to provide a single entry point for a 2-node cluster. SafeKit simplifies **network load balancing** by automatically managing the virtual IP, ensuring that client traffic is distributed across nodes and redirected instantly during a failover. Although this demonstration uses Apache on Windows, the solution works identically with other applications.

### Chapters {#chapters}

  1. 🎬 [Architecture: Preparing 2 nodes for a shared Virtual IP](https://www.youtube.com/watch?v=1Ww2-cXHNx4&t=0s) (0:13)
  2. 🎬 [Configuration: Setting up the farm.safe module and Virtual IP address](https://www.youtube.com/watch?v=1Ww2-cXHNx4&t=13s) (2:20)
  3. 🎬 [Validation: Failover testing and Virtual IP redirection on server crash](https://www.youtube.com/watch?v=1Ww2-cXHNx4&t=153s) (2:30)

### Step-by-Step Implementation {#step-by-step-implementation}

  * 🛠️ [Read the guide on setting up a farm.safe cluster on Windows](https://safekit.eviden.com/quick-install/safekit-quick-installation-guide-for-a-new-windows-application-with-network-load-balancing-and-failover/)
  * 🛠️ [Read the guide on setting up a farm.safe cluster on Linux](https://safekit.eviden.com/quick-install/safekit-quick-installation-guide-for-a-new-linux-application-with-network-load-balancing-and-failover/)

