Failover parameter in /etc/enswitch/databases.ini

From Integrics Wiki
Revision as of 14:52, 22 May 2025 by Vlasis (talk | contribs)
Jump to: navigation, search

In the configuration file /etc/enswitch/databases.ini the following parameter is available:

failover = yes

This is NOT related to any HA failover setup for the database.

The 'failover' parameter is used to set up failover connections to alternative database addresses that use the same database handle.

An example use case for this would be if a report server was set up to run reports on slave db servers, then 'failover' could be set to yes in order to select a second slave db server, in case the first one was not available.

So, if HA is set for the database system, then the 'failover' parameter has limited functionality.

The example below shows the database configuration on a server that uses two report servers with the same database handle. If the connection to db1.example.com fails, then a connection to db2.example.com will be attempted.

[select/cdrs]
database = enswitch
host = db1.example.com
port = 3306
username = enswitch
password = any
failover = yes

[select/cdrs]
database = enswitch
host = db2.example.com
port = 3306
username = enswitch
password = any
failover = no