Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article describes a high availability (HA) configuration for those who want to host

Companyname
internally. A simple HA configuration features a pair a pair of synced machines with an Nginx load balancerProxy.

In this configuration, a primary server runs

Companyname
as the default source. When all systems are working, it answers all queries and receives all traffic.

This server uses SQL Replication (E.g.  MS SQL Replication or MySQL Replication) and a filesystem sync (e.g. MS Robocopy on Windows or lsyncd on Linux) to synchronize data from the database and attached files respectively to a secondary replica server. The secondary should be in a different physical location from the primary so that events like earthquakes, fires, or other disasters don't destroy both servers.

A third server acts as a load balancer and Nginx proxy to direct traffic to the appropriate server, the primary by default and the replica when the primary is not available.

...

Failover and Restoration

A script on the load balancer server proxy server monitors the primary server for unscheduled downtime. If unscheduled downtime is detected, it triggers a failover condition where the script performs the following actions:

...

The filesystem sync should be monitored to make sure that is not falling behind due to bandwidth or other issues. For SQL replication, MS Replication Monitor can be used to warn of sync issues with a MS SQL database; for a MySQL database, monitoring the field “Seconds behind master” within MySQL replication can warn of sync issues.

Nginx

...

Proxy

In order to properly route traffic, clients will hit a load balancer proxy that is running another separate instance of Nginx. This redirects clients to the appropriate server depending on the status of the primary server. A separate Nginx instance also provides other benefits, such as being able to display a notice when maintenance is being performed. The Nginx load balancer can proxy can itself be clustered for further failure resilience.

...