> Source: https://docs.cyberelements.io/bastion/4.7/no/Installation/TypicalPlatforms/MultiNode/

# Multi-node platform

This platform, new in CyberElements Bastion 4.7, joins several Mediation Controller servers (the nodes). Each node is installed as a Standalone Mediation Controller, then joins the others; all share the same databases, hosted on an external database server. The Edge Gateways connect to every node, with one instance per node.

Users reach the portals (user portal and consoles) through a load balancer that is not part of the product. The applications that go through the CyberElements Bastion client connect directly to the SSL Router of each node (`IP_MC_SSL`, TCP 443), without a load balancer: each node meets the [network prerequisites of a Standalone Mediation Controller](https://docs.cyberelements.io/bastion/4.7/no/Installation/MediationController/Prerequisites/#network-standalone).

## Composition

| Component | Number | Location |
|---|---|---|
| **Mediation Controller** | Several (nodes) | DMZ |
| **Database server** | 1, or a PostgreSQL cluster (recommended) | Reachable from all the nodes |
| **Edge Gateway** (with the HTML5 Gateway) | 1 or several | LAN, as close as possible to the managed resources |

## Installation steps

| Step | Page | What to follow |
|---|---|---|
| 1 | [Prerequisites of the Mediation Controller](https://docs.cyberelements.io/bastion/4.7/no/Installation/MediationController/Prerequisites/) and [of the Edge Gateways](https://docs.cyberelements.io/bastion/4.7/no/Installation/EdgeGateway/Prerequisites/) | **Multi-node platform** sections: Standalone prerequisites for each node, external database, SSH flows between the nodes, one licence per node. |
| 2 | [PostgreSQL cluster](https://docs.cyberelements.io/bastion/4.7/no/Installation/Dependencies/PostgreSQLCluster/PostgreSQLClusterIntroduction/) | Recommended, so that the database does not become a single point of failure. |
| 3 | [Multi-node Mediation Controllers](https://docs.cyberelements.io/bastion/4.7/no/Installation/MultiNode/InstallMediationController/) | Installation of each node from scratch, then joining to the platform. |
| 4 | [Multi-node Edge Gateways](https://docs.cyberelements.io/bastion/4.7/no/Installation/MultiNode/InstallEdgeGateway/) | Installation of a Standalone Edge Gateway, configuration of the HTML5 Gateway on **each** node, one instance per node, created by the pairing. |
| 5 | [CyberElements Bastion client](https://docs.cyberelements.io/bastion/4.7/no/Installation/ClientAndAgent/ClientInstallation/) and agents | As for a [simple Standalone platform](https://docs.cyberelements.io/bastion/4.7/no/Installation/TypicalPlatforms/StandaloneSimple/#installation-steps). |

> **Recommendation**
>
> The security hardening guide details the local firewall rules, the hardening of the SSH service and of an external database: see [Local firewall](https://docs.cyberelements.io/bastion/4.7/no/Security/LocalFirewall/), [SSH](https://docs.cyberelements.io/bastion/4.7/no/Security/Ssh/) and [R79](https://docs.cyberelements.io/bastion/4.7/no/Security/SessionRecordings/#r79).

## Main role

One node holds the main role (`Main` column of `clrcluster_listservers.py`), which runs some scheduled tasks for the whole platform. When this node stops, another node takes over the main role once the last heartbeat of the stopped node is older than the `main_heartbeat_timeout_sec` parameter, in seconds, of the `[cluster]` section of the `/etc/ipdiva/care/djangosettings.ini` file (`300` by default). The role does not return to the original node when it restarts.

The parameter is read by each node at each run of its heartbeat service, every ten minutes: a modification is taken into account at the next run, without restarting the server. The file is not synchronised between the nodes: modify it on each node.
