High Availability setup

High Availability setup

For multi-server installations with high availability, we support an active-active setup with multiple active application server instances, supported by a shared relational database. A load balancer should be in front, to distribute HTTPS requests between the instances. As database we recommend MySQL, but PostgreSQL is also expected to work well.

 

Such a setup can be illustrated by the image below:

 

 

NG2LoadBalancer0001

 

 

Such a High Availability setup/load balancer can e.g. be setup if you setup the multiple InterFormNG2 servers to use one common database like indicated above.

 

A suggestion for the database configuration is covered in the section below.

 

 

High Availability - Database Configuration

In a high-availability setup with multiple application servers, data can be shared between the application servers in a relational database. All resources, settings, job logs, user information, printer queue items etc. should be stored in the database, to be available to all application servers.

 

The recommended database is MySQL. Alternatively PostgreSQL also works well.

 

To configure use of a shared database, a number of properties must be set in the configuration file, application-default.properties.

This file is covered here for the IBM i platform and here for Windows.

For new customers running version 3.4.0 og higher of InterFormNG2, we recommend the following configuration (replace database host name, username and password with the correct ones for your system):

 

ng2db.dbdatasource.url = jdbc:mysql://localhost:3306/data_{TENANTID}?useSSL=true&enabledTLSProtocols=TLSv1.2&createDatabaseIfNotExist=true&serverTimezone=UTC

ng2db.dbdatasource.driver = com.mysql.jdbc.Driver

ng2db.dbdatasource.hibernateDialect = org.hibernate.dialect.MySQL5InnoDBDialect

ng2db.dbdatasource.username = username

ng2db.dbdatasource.password = password

 

settings=database

userRepository=database

interform.defaultResources=database:ng2db.dbdatasource

versioning.provider=database

 

ng2.poolProvider=com.interform400.connectionPool.InterFormConnectionPool

ng2.combinePools=true

enable.multiServer=true

ng2.maxIdleTime=60

ng2.maxPoolSize=5

 

Note that this configuration is for a database connection with TLS encryption.

 

Each tenant will have its own database (the tenant name will replace {TENANTID} in the URL). Initially the default home tenant will have the database name “data_home”.

 

If you are often running a lot of concurrent workflows on a single tenant, you may see improved performance by increasing the connection pool size, to allow for more concurrent database connections. This can be done by changing the value of ng2.maxPoolSize to a number higher than 5. Note that the database has a limit on how many connections it allows. Make sure that the connection limit on the database is set to more than:

 

ng2.maxPoolSize * (number_of_tenants + 1) * number_of_application_servers

 

On MySQL the default connection limit is typically 151. To increase it to for instance 1000, you can run this SQL as a user with SUPER privileges:

 

SET GLOBAL max_connections = 1000;

 

Existing customers

For existing customers, that set up a shared database before InterFormNG2  Version 3.4.0 and are running a multi-tenant environment, we recommend switching to the new InterForm connection provider which is available in Version 3.4.0 and newer. The InterForm connection provider only has a single pool for each tenant database, whereas the default connection provider has one pool per application domain. For instance the configuration suggested for previous versions of InterFormNG2 would have resources and settings in the same database, but separate connection pools for each.

Using the InterForm connection provider will reduce the maximum number of connections required.

 

To use the InterForm connection provider, add the following properties in the configuration file, application-default.properties:

(This file is covered here for the IBM i platform and here for Windows.)

 

ng2.poolProvider=com.interform400.connectionPool.InterFormConnectionPool

ng2.maxIdleTime=60

ng2.maxPoolSize=5

 

Again, ng2.maxPoolSize should be adjusted depending on the actual load.

Some cloud services impose a limit on the maximum connection setting on the database. For multi-tenant environments with a high number of low-load tenants, it can therefore be a good idea to reduce this to a number less than 5, to limit the maximum number of connections. The setting ng2.maxIdleTime is the number of seconds that a connection is kept open after its last use. Another way to reduce the number of concurrent connections, it to reduce this value.

    • Related Articles

    • Global email server setup

      You need to setup a global email server order to be able to send system emails from InterFormNG2 e.g. to reset emails. Notice a similar email configuration for each tenant is normally also required. In order to setup the global email server, you ...
    • Global Active MQ setup

      If you want to use ActiveMQ, then you can use the embedded ActiveMQ of InterFormNG2. In order to setup the global email server, you first need to sign in as described here. Then you click Message Queue on the left below Workflow: Now you can enable ...
    • Setup AS400 command workflows

      The third of the prerequisites for calling functions in InterFormNG2 via commands on the IBM i platform is, that you have setup matching workflows, that are triggered by the AS400 commands, that you call. The workflows that you create must have the ...
    • Global remote output setup

      It is possible to print on other networks, that are protected by a firewall. For that you need a remote client in the remote network, that is able to access the InterFormNG server. To do that you first need to enable this feature globally in ...
    • Setup InterFormNG2 AS400 command API

      The second of the prerequisites for calling functions in InterFormNG2 via commands on the IBM i platform is, that you have setup the InterFormNG2 AS400 command API on the IBM i platform. This needs to be setup in order to tell the commands how to ...