Search code examples
solrshardingsolrj

How to add shards dynamically to collection in solr?


Using the following query when I create the collection I set two shards for the collection10.

/solr/admin/collections?action=CREATE&name=collection10&numShards=2&replicationFactor=2

But what is my requirement is, I have to add 3rd shard dynamically after 10000 documents has been indexed in first two shards.

Is it possible to add shards dynamically once we started the collection and indexing at existing shards? If it possible means how to add shards dynamically once after we started the collection?

And also, is it possible to add replicas dynamically once we started the collection.For example I set replicationFactor=2, then later I need to start the new replication for the already started collection. Is it possible to do? If it so, how to do it?


Solution

  • Now it's possible with Solr 4.4.0 (feature introduced in 4.3):

    https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-SplitaShard