Failover parameter in /etc/enswitch/databases.ini: Difference between revisions

From Integrics Wiki
Jump to navigation Jump to search
Content deleted Content added
Vlasis (talk | contribs)
Created page with "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 databas..."
 
Vlasis (talk | contribs)
No edit summary
Line 5: Line 5:
This is '''NOT''' related to any HA failover setup for the database.
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.
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.
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.
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.

<pre>
[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
</pre>

Revision as of 14:52, 22 May 2025

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