[
https://issues.apache.org/jira/browse/SOLR-11476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207163#comment-16207163
]
Franz Wimmer commented on SOLR-11476:
-------------------------------------
I was able to narrow down the problem to wether Solr is started with a -h
argument (hostname). If I supply a hostname at startup (and I have to, because
IP addresses change quite frequently), shard distribution produces this weird
results.
([See also
here|https://stackoverflow.com/questions/46773456/solr-cloud-distribution-of-shards-across-nodes]).
> Solr seems to ignore replica placement rules
> --------------------------------------------
>
> Key: SOLR-11476
> URL: https://issues.apache.org/jira/browse/SOLR-11476
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: v2 API
> Affects Versions: 6.6.1, 7.0, 7.0.1
> Reporter: Franz Wimmer
>
> I'm running Solr Cloud in OpenShift. I have set up 5 pods across the cluster,
> each running one solr node. The instances are managed by a ZooKeeper ensemble.
> In Solr 6.1, when I created a collection with 5 shards and a
> replicationFactor of 2, it would distribute all 10 replicas evenly on the
> nodes. With Solr 6.6 and 7.0, the distribution is random (why would I even
> want to gather many shards on one node and leave another node empty?).
> I tried using "Rule-based Replica Placement", but my rules seem to be
> ignored. I tried:
> {code}
> <solr-url>/solr/admin/collections?action=CREATE&name=wikipedia&numShards=5&maxShardsPerNode=2&replicationFactor=2&replica:<3,node:*&collection.configName=wikipedia
> <solr-url>/solr/admin/collections?action=CREATE&name=wikipedia&numShards=5&maxShardsPerNode=2&replicationFactor=2&shard:*,replica:1,node:*&collection.configName=wikipedia
> <solr-url>/solr/admin/collections?action=CREATE&name=wikipedia4&numShards=5&maxShardsPerNode=2&replicationFactor=2&replica:2,node:*&collection.configName=wikipedia
> {code}
> In all three cases, shards are distributed unevenly, often leaving one node
> completely empty.
> What seems odd is, when i try a replicationFactor of 1, it still doesn't
> work, but the API response is suggesting otherwise:
> {code}
> {
> "responseHeader":{
> "status":0,
> "QTime":3368},
> "success":{
> "solr-3.solr:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1836},
> "core":"wikipedia5_shard5_replica_n1"},
> "solr-2.solr:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1852},
> "core":"wikipedia5_shard4_replica_n1"},
> "solr-4.solr:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1859},
> "core":"wikipedia5_shard3_replica_n1"},
> "solr-0.solr:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1867},
> "core":"wikipedia5_shard2_replica_n1"},
> "solr-1.solr:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1872},
> "core":"wikipedia5_shard1_replica_n1"}}}
> {code}
> Other than the returned JSON, the collection looks like this:
> !https://i.imgur.com/UwqwQ5e.png!
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]