On 7/10/2019 2:49 AM, Maciej Milaszewski IQ PL via dovecot wrote:
On the other hand solr replication is quite complicated process and rollback or master-slave switch in this case is non-trivial task, that may have result in whole dataset inconsistency.
Do you have any experience in such cases ? Maby load-balance in HAProxy colud do the thing ? Something like:
......... server search1 192.168.1.1:8983 check port 8983 inter 20s fastinter 2 server search2 192.168.1.2:8983 backup .........
If you are using master-slave replication, you do not want to do this. Say the master went down, and it took you a while to get it back up. Unless you change the replication config, any data indexed on the slave would be gone as soon as the master was started back up, because the index would be replicated from the master. You are quite correct that switching replication roles is non-trivial.
Using a load balancer in this manner is a great option if Solr is running in SolrCloud mode. SolrCloud is a true cluster -- no masters, no slaves. You can send indexing or queries to any system in the cloud and everything works. The only real downside is that ZooKeeper (which is what turns Solr into SolrCloud) requires three servers for high availability, not two. The third server could have much lower specs than the other two, as ZooKeeper's system requirements are typically quite modest.
Thanks, Shawn