> Source: https://docs.cyberelements.io/bastion/4.7/bg/Usage/Reference/SystemConsole/SwitchMode/

# Switch mode

The **Switch mode** module sets the role of the server within the platform (standalone, or member of a cluster) together with the ports and IP addresses that go with that role. It is intended for an administrator building a cluster, or converting a Standalone server into a cluster node.

> **An operation with heavy consequences**
>
> Changing this configuration **resets the virtual hosts and the pairings**, and restarts the platform. Read the whole page before acting, and plan a maintenance window.

---

## Choosing the role

| Field | Description |
|---|---|
| **Role** | **Standalone** *(a single server)*, **Master mode** or **Slave mode** *(the two roles of a cluster)*. |
| **Mode** | Only shown for a cluster role. **Loadbalancing** is the mode offered. |

The role chosen governs which of the following groups are displayed: a standalone server shows its own addresses, a cluster node shows those of the master, of the slave, and the virtual IPs.

## Ports

| Field | Description |
|---|---|
| **Web port** | Mandatory. Listening port of the web service, between 0 and 65536. |
| **SSL port** | Mandatory. Listening port of the SSL Router, same range. |

## Addresses

Three groups carry the same two fields (**Web IP** and **SSL IP**) for a different machine each. Which ones appear depends on the chosen role.

| Group | Content |
|---|---|
| **Standalone server IP addresses** | Addresses of the server, when it stands alone. |
| **Master server IP addresses** | Addresses of the cluster master. |
| **Slave server IP addresses** | Addresses of the cluster slave. |

## Virtual IP

Shown for a cluster role. These addresses are the ones the cluster answers on, whichever node is currently active.

| Field | Description |
|---|---|
| **Web virtual IP** | Virtual address of the web service. |
| **SSL Router virtual IP** | Virtual address of the SSL Router. |
| **ZEO virtual IP** | Virtual address of the ZEO service. |

## Applying the change

**Validate** opens a **Switch mode** confirmation window, which restates what is about to happen before anything is applied.

> **What the confirmation announces**
>
> Enabling cluster mode requires the `ipdiva-mediation-cluster` package to be installed on the server. And changing the cluster configuration causes:
>
> - the **virtual hosts** to be reset;
> - the **pairings** to be reset, in cluster mode;
> - the **platform** to restart.
>
> When the role itself changes, a further line warns that **the organization data will be reset**.

The confirmation window then carries a **Delete databases** check box, shown only when the role has changed. **Validate** confirms, **Cancel** goes back without applying anything.

> **During the operation**
>
> The window displays an *Operation in progress...* overlay while the new configuration is applied.
