Caddy

Caddy Load Balancer Configuration for SearchBlox Cluster

Caddy can be configured as a load balancer to distribute search queries among the Search Servers in a SearchBlox Cluster.

Install caddy service

  1. Open Command Prompt:
    Navigate to the Caddy directory:
C:\SearchBloxServer\caddy
  1. Install Caddy Service:
    Run the following command to install the Caddy service.
caddy-service.exe install

  1. Start Caddy Service:
    Go to Control Panel > System and Security > Administrative Tools > Services.
    Locate the Caddy Web Server service and start it.

Load Balancer Configuration

  1. Edit the Caddyfile:
    Open the Caddyfile located at:
<SearchBlox-Installation-Directory>/caddy
  1. Add the following sample configuration to set up the load balancer. Replace Server1_IP and Server2_IP with the IP addresses of your Search Servers:
:80 {
        # Set this path to your site's directory.
        root * /usr/share/caddy
        # Enable the static file server.
        file_server
        # Another common task is to set up a reverse proxy:
        # reverse_proxy localhost:8080
        reverse_proxy https://Server1_IP:8443 https://Server2_IP:8443 {
                        lb_policy round_robin
                        lb_try_duration 5s
                        health_status 200
                        health_interval 10s
                        fail_duration 30s
          transport http {
            tls
            tls_insecure_skip_verify
          }
        }
}
  1. Restart Caddy Service:
    Save the Caddyfile and restart the Caddy service to apply the changes.

Uninstall caddy

  1. Stop Caddy Service:
    Go to Control Panel > System and Security > Administrative Tools > Services.
    Locate the Caddy Web Server service and stop it.

  1. Uninstall Caddy Service:
    Open Command Prompt and navigate to:
C:\SearchBloxServer\caddy

Run the following command to uninstall the Caddy service:

caddy-service.exe uninstall

By following these steps, you can set up Caddy as a load balancer for your SearchBlox Cluster, ensuring efficient distribution of search queries and high availability.