Setting up the HA search proxy
To configure a redundant HA search environment, you 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.
To setup a proxy server for search environment:
- Install a proxy server using yum.
yum install haproxy
- Set the proxy so that it starts up automatically whenever the server restarts.
chkconfig haproxy on
- 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 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 /
- Restart the haproxy.
The control scripts are located in
/etc/init.d/haproxy
. - Test the setup by sending search queries through curl and ensuring they are showing up in the logs of the destination machines.
- In the Admin Console, go to
haproxy.yourdomain.com
and the search service port to20000
.
and update the search service host field with
- Restart the application.