Pilot Data Server Administrator Guide

Version PDS-9.1 | Published July 17, 2024 ©

Proxy Support

Pilot Data Server can be installed along with a proxy/reverse-proxy server. The proxy server must either populate the X-Forwarded headers or the Forwarded header in order for Pilot Data Server to serve the appropriate hostname, port and protocol in its responses:

  • Forwarded

  • X-Forwarded-Host

  • X-Forwarded-Port

  • X-Forwarded-Proto

Use a proxy server with the above headers configured. If the Forwarded or X-Forwarded headers are not configured, then the proxy server must be configured to pass the Host header it received from the client to Pilot Data Server.

Redundancy and Failover

Although Pilot Data Server has been designed without built-in redundancy, it does support being used with off-the-shelf third-party HTTP load balancers. As the name suggests, a load balancer's main function is to distribute requests among multiple servers. Multiple servers provide redundancy, and most load balancers come with an option to only route requests to servers that respond, which provides failover.

Both Barracuda Load Balancer ADC and HAProxy have successfully been used in front of Pilot Data Server.

Load Balancer Quick Setup

Quickly set up a HAProxy load balancer:

Prerequisites

  • Two (or more) hosts running Pilot Data Server, connected to the same database. They have host names pds1.example and pds2.example for the purpose of these instructions. Static IP addresses may be used instead.

  • A Linux host that turns into a load balancer. It has the host name proxy.example for the purpose of these instructions. This is the host used in the installation steps below.

Installation Steps

  1. On the Linux host, install HAProxy with the command sudo apt-get install haproxy.

  2. Edit /etc/haproxy/haproxy.cfg (for example with sudo nano /etc/haproxy/haproxy.cfg) and append the following lines:

    frontend http-in
    bind :8177
    default_backend servers
     
    backend servers
    server server1 pds1.example:8177 check
    server server2 pds2.example:8177 check
     
    listen stats
    bind :80
    mode http
    stats enable
    stats uri /
  3. Restart HAProxy with the command sudo service haproxy reload.

Notes

  • After following the steps above, it should be possible to use proxy.example:8177 in place for pds1.example:8177 and pds2.example:8177. Check whether the setup works by opening http://proxy.example:8177/ in a browser. The Pilot Data Server index page should load.

  • The above configuration also provides a monitoring page at http://proxy.example/ that shows which Pilot Data Server hosts are responding. This does not tell you whether Pilot Data Server is working correctly, as hosts still respond when they cannot reach the database.