# Configure Redundancy

Kanoa MES can run on a redundant pair of Ignition Gateways. Ignition handles the failover, and the **Backup** Gateway
receives its configuration from the **Master** Gateway through Ignition's redundancy synchronization.

Setting up redundancy for Kanoa MES mostly follows Inductive Automation's documentation, with one important difference: **the order in which you do things matters**.

Reference:
- [Setting Up Redundancy (Ignition 8.3)](https://www.docs.inductiveautomation.com/docs/8.3/platform/ignition-redundancy/setting-up-redundancy)

:::info Prerequisites
- Both Gateways run the same version of Ignition.
- Both Gateways point to the same `kanoaCore` database. For true redundancy, SQL Server high availability should also be deployed.
:::

### 1. Configure redundancy between both Gateways

Follow the Inductive Automation guide to pair the Gateways:

- Set the Master Gateway's redundancy role to **Master**.
- Set the Backup Gateway's role to **Backup** and enter the Master Gateway's host address.
- Approve the outgoing certificate and connection on the Backup Gateway's network settings.
- Approve the incoming certificate and connection on the Master Gateway's network settings.
- Once the Backup restarts, fully syncs and redundancy shows a **Good** status, the pair is ready.

### 2. Configure Kanoa on the Master Gateway only

On the **Master** Gateway, complete the standard installation steps:

- [Configure the Database Connection](https://kanoa-software.netlify.app/getting-started/installation/configure-database): create the `kanoaCore` connection.
- [Configure the Tag Provider](https://kanoa-software.netlify.app/getting-started/installation/configure-tags): create the `Kanoa` tag provider.

Wait for the Master to sync these changes to the Backup Gateway before continuing.

### 3. Install modules on the Master Gateway only

Install the Kanoa MES module and its required modules (see [Install Modules](https://kanoa-software.netlify.app/getting-started/installation/install-modules)) on the **Master** Gateway.
Include any other third-party modules you use, such as Embr charts, Voice Notification, MQTT or MES/OEE modules.

:::warning Do not install modules on the Backup Gateway
Once the modules are installed on the Master, Ignition synchronizes them to the Backup automatically. Confirm in Config → Modules on the
Backup Gateway that all modules appear there, but do not install them there yourself.
:::

The Ignition installer may not include every module your installation needs, so third-party modules must be installed separately on the Master.

### 4. Verify failover

Before going live, confirm that Kanoa MES survives a failover:

1. Start a production run in Kanoa MES and add some counts.
2. Fail over to the Backup Gateway.
3. Continue modifying counts and states. The tags should not be wiped, and the run should continue where it left off.
4. Fail back to the Master and confirm the same.
