Setting Up the HA Search Proxy

To configure a redundant HA search environment, you will need a proxy server to load balance requests to each search server and ingress replicator.

Below is an example of two search nodes, two ingress nodes, and one proxy that load balances each pair. We also recommend setting up one reporting endpoint for the load balancer itself.

The proxy should be running on its own server. This example uses CentOS and haproxy. You may use other proxy services depending on your requirements.

  1. Install a proxy server using yum: yum install haproxy.
  2. Set the proxy so that it starts up automatically whenever the server restarts (chkconfig haproxy on).
  3. Edit the proxy's config file (located in /etc/haproxy/haproxy.cfg) as follows and save the changes. The proxy listens on port 20000 for search and on port 19000 for ingress. It also exposes a status UI on port 8085.
        frontend  main  
            bind haproxy.yourdomain.com:20000,haproxy.yourdomain.com:19000  
            acl ingress-r   dst_port 19000  
            use_backend             ingress-replicator if ingress-r  
            default_backend         search  
          
        backend search  
            balance     roundrobin  
            option httpchk GET /ping  
            server  search01 search01.yourdomain.com:30000 check  
            server  search02 search02.yourdomain.com:30000 check  
          
        backend ingress-replicator  
            balance     roundrobin  
            option httpchk GET /ping  
            server  ir01 ir01.yourdomain.com:29000 check  
            server  ir02 ir02.yourdomain.com:29000 check  
          
        listen status haproxy.yourdomain.com:8085  
           stats enable  
           stats uri /
           
                
  4. Restart the haproxy. (The control scripts are located in /etc/init.d/haproxy).
  5. Test the setup by sending search queries through curl and ensuring they are showing up in the logs of the destination machines.
  6. In the application's Admin Console, go to System > Settings > Search and update the search service host field with haproxy.yourdomain.com and the search service port to 20000.
  7. Restart the application.