Appboard/2.4/admin/clustering and failover
Overview
AppBoard is implemented using a highly scalable web application architecture. As a Java application running inside an Apache Tomcat server, AppBoard is able to make use of multi-core and multi-processor systems with large amounts of RAM on 64-bit operating systems. In addition to scaling vertically on a single system, AppBoard supports horizontal scaling to handle even greater loads and/or to provide for high availability environments through the use of a shared configuration database. AppBoard can be used in the following configurations:
- Load Balanced: Two or more nodes are fully operational at all times. The load balancer directs traffic to nodes based on standard load balancing techniques such as round-robin, fewest sessions, smallest load, etc... If a server is detected as down it is removed from the active pool.
- Failover: A two-node configuration with both nodes running but all traffic is routed to the primary node unless it is detected to be down. At this point the load balancer re-directs traffic to the secondary node.
- Cold Standby: A two-node configuration where the secondary node is offline in normal operation. If the primary node is detected to be down the secondary node is brought online and traffic re-directed.
In cases where high-availability is required then regardless of the load a cluster configuration is recommended. In cases where load is a concern refer to the Performance Tuning & Sizing documentation for more information.
Architecture & Licensing
Whether running a load-balanced, failover, or cold-standby configuration the following components are required:
- AppBoard installation per node, this requires a separate license for each node.
- External (shared) configuration database. This database is not provided by Edge and is recommended to reside on a different host to the AppBoard servers. In high availability environments the database itself should also highly available. See the System Requirements for supported external configuration databases.
- Load Balancer. This component is not provided by Edge but is required in cluster configurations.
Cluster Configuration
The overall cluster configuration is made up of separate parts that follow the cluster architecture:
- Load Balancer configuration
- Shared AppBoard configuration: via an external shared configuration database.
- per-node AppBoard configuration and filesystem artifacts.
Also consider that establishing a new cluster and maintaining the cluster may have different approaches as outlined below.
In simple single-server AppBoard configurations it is recommended to use the built-in, in-memory, H2 configuration database. However, in cluster configurations the configuration needs to be shared and kept in sync across two or more nodes so an external configuration database is required. Setting up an external database for redundancy operation has two main steps:
- Configure AppBoard to use an external database (versus the build-in H2). This process is documented in isolation on the Configuration Database page.
- Configure AppBoard to operate in redundancy mode. This is enabling the following setting in [INSTALL_HOME]/server/webapps/enportal/WEB-INF/config/custom.properties:
- hosts.redundant=true
AppBoard installs may have additional shared resources on the filesystem beyond the configuration stored in the configuration database. These too must be kept in sync across all cluster nodes.
Load Balancer
The Load Balancer can distribute sessions to one or more AppBoard nodes using any standard load balancing algorithm (e.g. Round-Robin, smallest load, fewest sessions, etc.). The only requirement is that the session affinity is maintained such that a single user is always routed to the same AppBoard node during the full duration of the session.
The two session cookies used by AppBoard are JSESSIONID and enPortal_sessionid. When configuring the Load Balancer for session affinity, it is recommended to use enPortal_sessionid to avoid any conflicts with other applications that may also have a JSESSIONID cookie.
The following URL can be used by the load balancer as a means of testing AppBoard availability:
http://server:port/enportal/check.jsp
This script returns a HTTP status code 200 (success) if all components of AppBoard are running properly, otherwise it returns a 500 (internal error) if there is an issue. And in the case the AppBoard server isn't running, then of course there will be no response.
Establishing a Cluster
When redundancy is enabled the following message will be logged to system.log on startup:
... - INFO - system - Redundancy support enabled
Maintaining a Cluster
Virtualized Environments
Whether running on the bare metal or within virtualized environments the clustering configuration remains the same.
Some virtualization environments may offer their own layer of fault tolerance although this is usually targeted at reducing/eliminating the impact of hardware failure - e.g. VMware Fault Tolerance to transparently failover a guest from a failed physical host to a different physical host such that everything continues un-interrupted. This type of system is useful on it's own but may not be aware of application-level failures that can also occur.