lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: SolrCloud 5.1 startup looking for standalone config
Date Wed, 03 Jun 2015 22:46:40 GMT
On 6/3/2015 2:48 PM, tuxedomoon wrote:
> Yes adding _solr worked, thx.  But I also had to populate the SOLR_HOST param
> for each of the 4 hosts, as in
> SOLR_HOST=ec2-52-4-232-216.compute-1.amazonaws.com.   I'm in an EC2 VPN
> environment which might be the problem.
>
> This command now works (leaving off port)
>
> http://s1/solr/admin/collections?action=CREATE&name=mycollection&numShards=3&collection.configName=mycollection_cloud_conf&createNodeSet=s1_solr,s2_solr,s3_solr
>
> The shard directories do now appear on s1,s2,s3 but the order is different
> every time I DELETE the collection and rerun the CREATE, right now it is
>
> s1: mycollection_shard2_replica1
> s2: mycollection_shard3_replica1
> s3: mycollection_shard1_replica1
>
> I'll look further at your article but any advice appreciated on controlling
> what hosts the shards land on.
>
> Also are these considered leaders?  If so I don't understand the replica1
> suffix.

A leader is merely a replica that has won an election and has a
temporary title.  It's still a replica, even if it's the ONLY replica.

I would need to look at the code to figure out how it works, but I would
imagine that the shards are shuffled randomly among the hosts so that
multiple collections will be evenly distributed across the cluster.  It
would take me quite a while to familiarize myself with the code before I
could figure out where to look.

If you want to have absolute control over shard and replica placement,
then you will probably need to follow steps similar to these:

* Create a collection with replicationFactor=1.
* Create foo_shardN_replica2 cores with CoreAdmin or ADDREPLICA where
you want them.
* Let the replication fully catch up.
* Use DELETEREPLICA on all the foo_shardN_replica1 cores.
* Manually create the foo_shardN_replica1 cores where you want them.
* Manually create any additional replicas that you desire.

Thanks,
Shawn


Mime
View raw message