Configure API Portal for high availability

You can configure API Portal for active-active high availability (HA) deployment to ensure that there is no single of point of failure in the system. This helps to eliminate any potential system downtime in production environments.

HA in production environment

You can deploy a two-node API Portal behind a load balancer with a shared Network File System (NFS) storage configuration.

Note   API Portal only supports two-node HA deployment.

The HA deployment provides both high availability and horizontal scalability. The load balancer performs Transmission Control Protocol (TCP) checks at the network level on both active API Portal deployments. If either of the crucial services (Apache or MySQL) becomes unavailable in one node, the load balancer redirects traffic to the other available node. When the first node returns to normal operation, then the traffic is evenly distributed between the two nodes.

The following diagram illustrates the API Portal HA setup:

The active-active high availability configuration

  • A user accesses the public IP of the load-balancer using a HTTP or HTTPS connection.
  • The load balancer spreads the connections between the two active API Portal nodes on the Apache web servers and keeps track of the sessions. Sticky session is enabled on the load balancer.
  • When Joomla! makes a SQL query, it connects to the load balancer at port 3306.
  • The load balancer spreads connections between the MySQL servers on the two active nodes.
  • Master-master replication is in place for the two MySQL servers, guaranteeing database consistency. This is direct communication between the two nodes and does not involving the load balancer.
  • All static content (CSS, images, HTML files, and Joomla! PHP files) is located on a shared NFS storage.

Joomla! offers content delivery network (CDN) plugins for the static content that may also benefit you.

Note   It may also be possible to use a disaster recovery or geographically distant portal instance while still sharing sessions and content. For example, you can entirely remove the load balancer from the scheme and use tools such as lsyncd for file synchronization and VPN/sshtunnel for MySQL. However, this setup is not tested or supported.

Related Links