# Multi-node

Exivity can be deployed on a single node, or on multiple nodes for HA and load balancing. This guide walks you through the steps to install some of the Exivity components on different nodes.

## Multi-Node System Architecture

The following diagram outlines the various components that can be deployed on separate nodes:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-Me5_BkRemDb63fi41aT%2F-Me5_Tdo6Sx9z7XIIts_%2Fimage.png?alt=media\&token=606d18b5-4e9d-49ac-9886-e4346d8a33e6)

For larger environments, it is recommended to deploy each component on separate virtual machine nodes. As displayed in the  diagram above, a typical multi-node deployment will consist of the following elements:

* **Load Balancer** *(optional)*
  * An optional but recommended 3rd party load balancer may be used to ensure high availability of the Exivity front end web application.
* **Exivity Web/UI node(s)**
  * 1 or more Exivity Web/UI nodes should be deployed to support the customer facing web application.
* **Exivity API/Backend node(s)**
  * 1 or more Exivity API/Backend nodes should be deployed to support the customer facing web application.
  * ***Storage***
    * In multi-node environments, it is advisable to provide a shared storage device (i.e. SMB/NFS) that can be accessed by the backend nodes
* **PostgreSQL node or cluster**
  * Exivity solution relies on a PostgreSQL version 10 (or higher) compliant database engine.
* **RabbitMQ node or cluster**
  * Exivity relies on a RabbitMQ version 3.8 (or higher) message broker

The platform is designed in such a way that adding and removing Exivity nodes should be relatively straightforward, which compliments thr potential growth or shrinkage of data processing needs.&#x20;

### Deploying a PostgreSQL node

Exivity highly recommends deploying your own PostgreSQL database cluster on Linux (or use a managed PSQL service from [Azure](https://azure.microsoft.com/en-us/services/postgresql), [AWS ](https://aws.amazon.com/rds/postgresql/)or other vendors). To achieve High Availability, any PostgreSQL compatible cluster manager software may be used. At Exivity we have good experiences with [**pg\_auto\_failover**](https://cloudblogs.microsoft.com/opensource/2019/05/06/introducing-pg_auto_failover-postgresql-open-source-extension-automated-failover-high-availability/), which is an [open source](https://github.com/citusdata/pg_auto_failover) PostgreSQL on Linux cluster manager (backed by Microsoft) in case you prefer to self-manage the Exivity PostgreSQL database.&#x20;

{% hint style="warning" %}
When using a PostgreSQL database on a remote host, the database and user must have been created beforehand. To create the database, ask your database administator to execute a database create statement similar to the one below:

**CREATE DATABASE exdb** \
&#x20; **WITH** \
&#x20; **OWNER = exadmin** \
&#x20; **TEMPLATE = template0** \
&#x20; **ENCODING = 'UTF8'** \
&#x20; **LC\_COLLATE = 'en\_US.UTF-8'** \
&#x20; **LC\_CTYPE = 'en\_US.UTF-8'** \
&#x20; **CONNECTION LIMIT = -1;**&#x20;

In addtion, make sure to set the following minimal (or higher) PostgreSQL configuration parameters:

**`shared_buffers = 2GB`**

**`work_mem = 32MB`**&#x20;

**`wal_buffers = 64MB`**&#x20;

**`max_prepared_transactions = 16`**
{% endhint %}

In case you prefer to install PostgreSQL on Windows, Exivity recommends installingthe PostgreSQL role together with the API/Scheduler backend components during the installation wizard.

### Deploying a RabbitMQ node

Exivity highly recommends deploying your own [RabbitMQ ](https://www.rabbitmq.com/download.html)instance on Linux (or use a managed RabbitMQ service from [AWS](https://aws.amazon.com/about-aws/whats-new/2020/11/announcing-amazon-mq-rabbitmq/), [CloudAMQP](https://www.cloudamqp.com/), or other vendors).&#x20;

### Deploying a Backend node

In order to deploy a backend node, the following steps need to be executed manually or automatically thru the use of the silent installer CLI interface.

After starting the installer, click *Next* and provide a valid license key when asked. After clicking *Next* again, the component screen will be shown:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-Mji_NCREo2UCQ49E_s8%2F-Mji_wgJAf8xpsj7J43o%2Fimage.png?alt=media\&token=f632b057-3237-4e5c-9719-9fa5380aa83d)

Ensure to deselect the *Web Service* . The *API Service* component can also be excluded, although in some cases it is recommended to have the API and Backend Services running on the same system. Please consult with Exivity [support ](mailto:support@exivity.com)in case you are not certain what to select.

Click *Next* to continue. Then provide a folder for the Exivity program files, and afterward select a folder for the Exivity home files.

Provide a custom administrator username and password, or leave the default:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-M32C9Jb5I6VrPiiGpI1%2F-M32EdZUBjy-dYPuMAB2%2Fimage.png?alt=media\&token=9ab8fa13-e075-4530-b4f1-59be14221a31)

Now specify a remote PostgreSQL database instance, or select to install the PostgreSQL database locally on the API/backend node:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-M32JVOghDKQQO9pzqct%2F-M32TGunVUu9esmG5xrg%2Fimage.png?alt=media\&token=0cf994a4-e270-4c4b-a2c8-0267a2e5cfed)

{% hint style="warning" %}
When using a PostgreSQL database on a remote host, the database and user must have been created beforehand. To create the database, ask your database administator to execute a database create statement similar to the one below:

**CREATE DATABASE exdb** \
&#x20; **WITH** \
&#x20; **OWNER = exadmin** \
&#x20; **TEMPLATE = template0** \
&#x20; **ENCODING = 'UTF8'** \
&#x20; **LC\_COLLATE = 'en\_US.UTF-8'** \
&#x20; **LC\_CTYPE = 'en\_US.UTF-8'** \
&#x20; **CONNECTION LIMIT = -1;**&#x20;
{% endhint %}

When you are finished configuring your PostgreSQL database settings, click the *Next* button to configure *RabbitMQ*. To use a remote *RabbitMQ* instance, deselect the '*Install Local RabbitMQ Engine'* and provide the appropriate hostname, username, password, vhost and TCP port. In case you require TLS/SSL towards your RabbitMQ instance, select that checkbox as well:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-Mji_NCREo2UCQ49E_s8%2F-MjiaHm_4krVWB_zYU6v%2Fimage.png?alt=media\&token=c8ce4006-1a84-4927-be0e-0a1ae41efe0c)

Once the installation is finished, ensure to check *'Start the Exivity Windows Services'* to start the Exivity services after clicking *Finish.*

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-M32C9Jb5I6VrPiiGpI1%2F-M32GbN4geBx9DmVM2Z_%2Fimage.png?alt=media\&token=ed54491b-f342-4844-a8a8-3cc7c59144ec)

{% hint style="info" %}
In order to achieve High Availability for the Exivity API/backend node, it is advisable to leverage the HA capabilities of your hypervisor (i.e. vSphere HA). In case you want to achieve OS level HA, you may consider implementing a Windows Failover Cluster. Please reach out to <support@exivity.com> / [support.exivity.com](http://support.exivity.com) to learn more about this kind of configuration.
{% endhint %}

#### Silently install Backend node

The below example will silently install an Exivity API/Backend node while using a remote PostgreSQL database instance as well as a remote RabbitMQ instance using SSL:

```
start /wait Exivity_{version}_setup.exe /S ^
	/PSQL_INSTALLED=0 ^
		/PGUSER=exivityadmin /PGPASSWORD=S3cret!123 /PGHOST=db.exivity.local /PGPORT=5432 /PGDB=exivitydb ^
	/MQ_INSTALLED=0 ^
		/MQHOST=mq.exivity.local /MQPORT=5671 /MQUSER=exivity /MQPASSWORD=My5pecia1pas9 /MQVHOST=exvt /MQSSL=1 ^
	/WEB_INSTALLED=0 ^
	/JOBMAN_INSTALLED=1 ^
	/SCHEDULER_INSTALLED=1 ^
	/API_INSTALLED=1 ^
	/BACKEND_INSTALLED=1 
```

### Deploying a Web/API node

In order to deploy a Web/UI only node (with optional API), the following steps need to be executed manually or automatically thru the use of the silent installer CLI interface.

After starting the installer, click *Next* and provide a valid license key when asked. After clicking *Next* again, the component screen will be shown:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-Mji_NCREo2UCQ49E_s8%2F-Mjiajq-1oL6R0XSY6n3%2Fimage.png?alt=media\&token=6af24c39-bc1f-4ac1-aa8a-394f522e33b4)

Select the Web Service and optionally also the *API Service*. In some cases, the API can also be deployed on the front-end node, but if you are not certain, install only the *Web Service* on the front-end node, and the *API Service* on the backend nod&#x65;*.*

Click *Next* to continue. Then choose a folder for the Exivity program files, and afterward select a folder for the Exivity home files.

In the following screen, it will be required to specify the remote host and port of your Exivity API node:

![](https://1141395848-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHEKskLK6aXinV75Knl%2F-M32JVOghDKQQO9pzqct%2F-M32KpoV9ogrOhGQz5xj%2Fimage.png?alt=media\&token=eeb725e9-1aef-412a-b496-7b37375241dc)

{% hint style="warning" %}
Ensure that the Exivity API host is active and accepting connections. After clicking the *Next* button, the installer will issue a connection attempt to the Exivity API host
{% endhint %}

Once the installation is finished, ensure to check *'Start the Exivity Windows Services'* to start the Exivity services after clicking *Finish.*

#### Silent install Web/UI node

The below example will silently install an Exivity Web/UI node:

```
Exivity_{version}_setup.exe /S ^
	/EXIVITY_PROGRAM_PATH=C:\Exivity\Program /EXIVITY_HOME_PATH=D:\Exivity\home ^
	/PSQL_INSTALLED=0 ^
	/MQ_INSTALLED=0 ^
		/MQHOST=mq.exivity.local /MQPORT=5671 /MQUSER=exivity /MQPASSWORD=My5pecia1pas9 /MQVHOST=exvt /MQSSL=1 ^
	/JOBMAN_INSTALLED=0 ^
	/SCHEDULER_INSTALLED=0 ^
	/API_INSTALLED=0 ^
		/PROXIMITYHOST=remote.api.local /PROXIMITYPORT=443 ^
	/WEB_INSTALLED=1
```
