ffriend
ffriend

Reputation: 28552

Replication in distributed Solr config

I'm trying to add replication for every slave in Solr cloud to make the whole cluster more reliable. The idea is to spread one shard to several machines to let the cluster work even if one of machines is down.

Solr has excellent built-in replication feature, that works perfectly in the normal (not distibuted) Solr setup. However, when adding this feature to Solr cloud, I get an error, telling that /solr/replication handler is not found (and actually it doesn't appear in Solr output when starting Solr, though it is defined in solrconfig.xml).

SolrWiki also points to distributed update handler, but from author's note I understand it doesn't actually replicate data, but just sends new documents to one of nodes defined in config.

My questions are:

  1. Why built-in Java-based replication doesn't work in distributed Solr setup? Is it an issue with the Solr cloud, more fundamental problem or just error in my configuration (I checked everything several times, but still could miss something)?
  2. What are other good approaches to replication in distributed Solr?

Upvotes: 4

Views: 2112

Answers (1)

MatsLindh
MatsLindh

Reputation: 52912

Although I'm a bit late to the party here for an old question; the answer is that Solr Cloud handles replication internally. The Solr Cloud wiki page explains this in detail. If you've set numShards=2 and add more servers (so that you have four in total), the shard will be replicated to the new servers - ensuring that your shard live on more than one node.

To answer your questions directly;

  1. SolrCloud does the replication setup and logic for you, and you should let it do it's own thing instead of introducing "manual" setup replication in the mix as well.

  2. The whole point of SolrCloud is to hide the replication and sharing logic, allowing you to simply add more servers as they are available. You can of course create logically separate cloud clusters and index to both, but that shouldn't be necessary.

Upvotes: 2

Related Questions