2
votes

In a solr cloud setup is there any way to force a solr node to start under a specific shard?

The current setup i have in my project has

  1. 4 solr nodes
  2. 4 zookeeper instances
  3. For the solr node which will be started as a very first instance has the following startup parameters

    -DnumShards=2 -DshardId=1, but still for some reason the first server starts as a leader in the second shard.

I also tried setting -DshardId=shard1.

Am I following the correct configuration setup? or missing anything?

2
My first node also always gets assigned to shard 2 also, with or without -DshardId=1SimplyInk

2 Answers

0
votes

Unfortunately not. But when you initially bootstrap the solr nodes, the order of bootstrapping decides which node will belongs to which shard.Ideally node which you starts first becomes shard1,next node becomes shard2,next node becomes shard1 replica 1 and next node becomes shard 2 replica 2.This process will continue for all nodes started in cluster

0
votes

You can set it at the core level for solr 4 in the solr.xml (legacy format).

<solr>
    <cores>
        <core name="core1" instanceDir="core1" shard="shard1" />
    </cores>
</solr>