Appboard/2.5/builder/data source failover: Difference between revisions

imported>Jason.nicholls
m (1 revision)
imported>Jason.nicholls
No edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:AppBoard Data Source Failover}}
{{DISPLAYTITLE:AppBoard Data Source Failover}}
[[Category:AppBoard 2.5]]
[[Category:AppBoard 2.5]]
[[Image:FailoverConfig.png|thumb|center|700px|The Failover Configuration Panel in AppBoard Builder]]
The option to provide failover for SQL Data Sources is available in AppBoard versions 2.4 or higher.  This page provides instructions for configuring this component in the AppBoard Builder.
== Overview ==
== Overview ==


AppBoard designers and administrators want to configure the system to be resilient and provide fresh data, even in cases where connectivity to a Data Source may be lost.  Failover allows the system to check if a Data Source is no longer accessible, and if so, to switch over to a backup Data Source.
AppBoard Database Table and Database Query Data Adapters support configuring multiple connection end-points for failover purposes. This is to ensure clients are offered uninterrupted service even in the event of a database failure, or failure to reach a database.


[[Image:FailoverConfig.png|thumb|center|700px|The Failover Configuration Panel in AppBoard Builder]]


To configure failover for a Data Source, follow the instructions on this page to enable failover on the Data Source configuration panel.
To configure failover for a Data Source, follow the instructions on this page to enable failover on the Data Source configuration panel.




== Pre-Requisites ==
== Enabling Failover ==
 
=== Pre-Requisites ===


Before implementing failover on a Data Source, the AppBoard administrator must confirm the following:
Before implementing failover on a Data Source, the AppBoard administrator must confirm the following:


* The back-end databases must be configured such that the various available servers present a redundant and consistent view of the data (the same required tables must be available, the table structure should be consistent, and so on).
* The back-end databases must be configured such that the various available servers present a redundant and consistent view of the data (the same required tables must be available, the table structure should be consistent, and so on).
* The back-end databases must be online and the AppBoard server must have permanent connectivity to all of the database servers.
* The back-end databases must be online and the AppBoard server must have permanent connectivity to all of the database servers.
* The authentication credentials must be known (and ideally consistent) between all the database instances.
* The authentication credentials must be known for each database instance.
 
 
== Failover Configuration Panel ==
 
Perform the following steps to enable and display the failover configuration panel:
 
# Log in to AppBoard as an administrator.
# Create or edit a Data Source that supports failover.
# Go to the "Explore" configuration screen.
# Click the "Enable Failover" toggle switch to set it to "Yes".  The "Fail-over Connections" panel is displayed.


=== Configuration ===


== Configuring Failover ==
Access the failover configuration by creating or editing a [[appboard/2.5/builder/data_sources/database|Database Data Source]]:


Perform the following steps to configure failover for a Data Source:
# On the ''Connect'' step click the ''Enable Failover'' toggle switch to the ''Yes'' position.
 
# This will display the ''Fail-over Connections'' list.
# Enable failover by following the instructions detailed above under "Failover Configuration Panel".
# Observe that the "Primary" connection is selected in the "Fail-over Connections" panel.  A question mark icon indicates that AppBoard has not yet validated connectivity to the connection.  The icon will be updated later to indicate updated connectivity status.
# Observe that the "Primary" connection is selected in the "Fail-over Connections" panel.  A question mark icon indicates that AppBoard has not yet validated connectivity to the connection.  The icon will be updated later to indicate updated connectivity status.
# On the main screen, enter the URL and all of the other basic connection and configuration values for the Primary connection just as you would for any standard Data Source.
# On the main screen, enter the URL and all of the other basic connection and configuration values for the Primary connection just as you would for any standard Data Source.
# Click "Add" in the "Fail-over Connections" panel.  A "Secondary" connection label will be added to the list of "Fail-over Connections".
# Click "Add" in the "Fail-over Connections" panel.  A "Secondary" connection label will be added to the list of "Fail-over Connections".
# Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to the Primary data source.  Note that all of the other configuration settings are assumed to be the same as what you entered for the Primary connection.
# Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to the Primary data source.  Note that all of the other configuration settings are assumed to be the same as what you entered for the Primary connection.
Line 47: Line 33:
# [optional] Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to both the Primary and Secondary data sources.  Note that all of the other configuration settings are set to be the same as what you entered for the Primary connection.
# [optional] Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to both the Primary and Secondary data sources.  Note that all of the other configuration settings are set to be the same as what you entered for the Primary connection.
# [optional] Change the names of the connections by selecting each connection and clicking "Edit".
# [optional] Change the names of the connections by selecting each connection and clicking "Edit".


One of the following status icons will be displayed by AppBoard for each data source to indicate the current status of that connection:
One of the following status icons will be displayed by AppBoard for each data source to indicate the current status of that connection:
Line 53: Line 38:
[[Image:DB_status_summary.png|thumb|center|700px|Database Connection Status Icons in the Failover Configuration Panel]]
[[Image:DB_status_summary.png|thumb|center|700px|Database Connection Status Icons in the Failover Configuration Panel]]


== Testing Failover ==
== Additional Information ==
 
=== Manual Failover ===
 
Sometime for maintenance purposes, testing, or otherwise it may be necessary to manually failover, or disable one of the configured failover connections.
 
This can be done by editing the appropriate datasource, selecting the particular connection from the ''Fail-over Connections'' list, and un-checking the ''Enabled'' toggle box. The status icon for the particular connection will change to a wrench icon to indicate it is in maintenance mode.
 
=== Failback ===
 
AppBoard will attempt to re-establish communications with a higher priority connection at the configured ''Connection Retry Interval'', which is part of the data source configuration. This value defaults to 300 seconds (5 minutes) so this means it may take up to 5 minutes for failback to occur once a higher priority database connection has been restored.
 
{{Note|It is important ''Connection Retry Interval'' is not set too low for a number of reasons, including interfering with other internal timeouts of the connection manager. However it's also important in a high-availability scenario where the primary database is having ongoing issues and flapping (up/down/up/down). Having this setting too low will result failing back too often, potentially to a service which is not working correctly.}}
 
 
=== Testing Failover ===


Perform the following steps to test your failover configuration:
Perform the following steps to test your failover configuration:

Latest revision as of 05:54, 29 May 2015

Overview

AppBoard Database Table and Database Query Data Adapters support configuring multiple connection end-points for failover purposes. This is to ensure clients are offered uninterrupted service even in the event of a database failure, or failure to reach a database.

The Failover Configuration Panel in AppBoard Builder

To configure failover for a Data Source, follow the instructions on this page to enable failover on the Data Source configuration panel.


Enabling Failover

Pre-Requisites

Before implementing failover on a Data Source, the AppBoard administrator must confirm the following:

  • The back-end databases must be configured such that the various available servers present a redundant and consistent view of the data (the same required tables must be available, the table structure should be consistent, and so on).
  • The back-end databases must be online and the AppBoard server must have permanent connectivity to all of the database servers.
  • The authentication credentials must be known for each database instance.

Configuration

Access the failover configuration by creating or editing a Database Data Source:

  1. On the Connect step click the Enable Failover toggle switch to the Yes position.
  2. This will display the Fail-over Connections list.
  3. Observe that the "Primary" connection is selected in the "Fail-over Connections" panel. A question mark icon indicates that AppBoard has not yet validated connectivity to the connection. The icon will be updated later to indicate updated connectivity status.
  4. On the main screen, enter the URL and all of the other basic connection and configuration values for the Primary connection just as you would for any standard Data Source.
  5. Click "Add" in the "Fail-over Connections" panel. A "Secondary" connection label will be added to the list of "Fail-over Connections".
  6. Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to the Primary data source. Note that all of the other configuration settings are assumed to be the same as what you entered for the Primary connection.
  7. [optional] Click "Add". A "Tertiary" connection label will be added to the list of "Fail-over Connections".
  8. [optional] Enter the URL, Username, and Password for the data source that AppBoard should switch to if connectivity is lost to both the Primary and Secondary data sources. Note that all of the other configuration settings are set to be the same as what you entered for the Primary connection.
  9. [optional] Change the names of the connections by selecting each connection and clicking "Edit".

One of the following status icons will be displayed by AppBoard for each data source to indicate the current status of that connection:

Database Connection Status Icons in the Failover Configuration Panel

Additional Information

Manual Failover

Sometime for maintenance purposes, testing, or otherwise it may be necessary to manually failover, or disable one of the configured failover connections.

This can be done by editing the appropriate datasource, selecting the particular connection from the Fail-over Connections list, and un-checking the Enabled toggle box. The status icon for the particular connection will change to a wrench icon to indicate it is in maintenance mode.

Failback

AppBoard will attempt to re-establish communications with a higher priority connection at the configured Connection Retry Interval, which is part of the data source configuration. This value defaults to 300 seconds (5 minutes) so this means it may take up to 5 minutes for failback to occur once a higher priority database connection has been restored.

Template-note.png
It is important Connection Retry Interval is not set too low for a number of reasons, including interfering with other internal timeouts of the connection manager. However it's also important in a high-availability scenario where the primary database is having ongoing issues and flapping (up/down/up/down). Having this setting too low will result failing back too often, potentially to a service which is not working correctly.


Testing Failover

Perform the following steps to test your failover configuration:

  1. Make sure your AppBoard server has connectivity to all of the data sources to be tested and confirm that they are all online.
  2. Create individual Data Sources that access each of your Primary, Secondary, and [optional] Tertiary data sources. Identify or create a small distinction in the source data that will indicate which data source is being accessed when the data is viewed in a Data Collection.
  3. Validate that AppBoard can successfully connect to each of the data sources independently, by viewing data in each Data Collection and confirming that it matches the data in each raw data source.
  4. Configure failover as detailed above.
  5. Validate that the Data Collection is showing the data from the Primary data source.
  6. Disconnect the Primary data source from AppBoard.
  7. Validate that the Data Collection fails over to show the data from the Secondary data source. Note: you may need to wait for polling/caching settings to expire before the next update shows the change in the data.
  8. Reconnect AppBoard to the Primary data source and disconnect the Secondary data source from AppBoard.
  9. Validate that the Data Collection fails back to show the data from the Primary data source. Note: you may need to wait for polling/caching settings to expire before the next update shows the change in the data.
  10. [optional] Disconnect the Primary and Secondary data sources from AppBoard.
  11. [optional] Validate that the Data Collection fails over to show the data from the Tertiary data source. Note: you may need to wait for polling/caching settings to expire before the next update shows the change in the data.