Scalable deployment
Overview
In a scalable deployment Email Gateway Security instances work on a shared database.
The shared database can be a single point of failure in a scalable deployment. The solution is to set up a PostgreSQL database cluster that provides high availability for the database. For details see https://www.postgresql.org/docs/current/high-availability.html.
The database runs either on one of the the Email Gateway Security instances

or as a separate database server

All (the other) instances connect to the shared database.
For details about scalable deployment see Scalable deployment operation.
Installation
Shared database on an Email Gateway Security instance
By default, Email Gateway Security installed in the Standalone mode will restrict its PostgreSQL database to be accessible from localhost only.
PostgreSQL need to be configured specifically to allow connections from remote hosts. For details see below.

- When the shared database is intended to be on one of the Email Gateway Security instances, install this instance first.
- In the Choose Database Setup Type dialog select the Standalone option and complete the setup of the first instance.

- For all other instances in the Choose Database Setup Type dialog select the External database option.
- In the database properties dialog set the Address and Port of the first instance and provide the database Username and Password set for the first instance.

Configure PostgreSQL to accept connections from other hosts
In
<installation directory>\data\pg_data\postgresql.conf
(defaultC:\Program Files\OPSWAT\MetaDefender Email Security\data\pg_data\postgresql.conf
) configurelisten_addresses
to listen on addresses accessible for other hosts. For details see https://www.postgresql.org/docs/14/runtime-config-connection.html.- Example:
listen_addresses = '*'
- Example:
In
<installation directory>\data\pg_data\pg_hba.conf
(defaultC:\Program Files\OPSWAT\MetaDefender Email Security\data\pg_data\pg_hba.conf
) add entry to allow authentication from other hosts. For details see https://www.postgresql.org/docs/14/auth-pg-hba-conf.html.- Example:
host all postgres 172.0.0.0/8 scram-sha-256
- Example:
Allow PostgreSQL port (default 5433) through the firewall.
Restart PostgreSQL
- Example:
net stop postgresql-x64-14
net start postgresql-x64-14
- Example:
Shared external database

- The shared database must be up and running before the first Email Gateway Security instance is about to be installed.
- For all instances in the Choose Database Setup Type dialog select the External database option.

- In the database properties dialog set the Address and Port of the shared external database server and provide the shared database Username and Password.
