On 3/20/2018 2:22 AM, Zheng Lin Edwin Yeo wrote:
However, for query that are using URL, if the URL is still pointing to the
main replica  http://192.168.2.11:8983/solr, it will not go through. We
have to manually change the URL to point it to the other replica
http://192.168.2.12:8984/solr before the query can work.

Is there anyway that we can make this automatic?

One solution is to write code that can switch the URL when it goes down.

An easier solution would be to put a load balancer in front of Solr and point your clients at the load balancer.  I'm using haproxy for this.

If your servers are in cloud mode, you have a fault tolerant ZK setup, and your clients are Java, then you can use CloudSolrClient, and it will automatically adjust when servers go down, without the need for a load balancer.  I think somebody might have invented a cloud-aware client for Python too, but if they have, it's third-party.

Thanks,
Shawn

Reply via email to