[ 
https://issues.apache.org/jira/browse/SOLR-13329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16849421#comment-16849421
 ] 

Noble Paul edited comment on SOLR-13329 at 5/30/19 9:30 PM:
------------------------------------------------------------

h4. New {{nodeset}} & {{put}} attributes

The {{put}} attribute (optional) can have 2 values
 * {{on-any}} : (default) means place evenly on any of the nodes in the set of 
nodes
 * {{on-each}} : place replicas in every node

The {{nodeset}} attribute is introduced to make the syntax more readable. It's 
basically a selector for a set of nodes with one or more properties. This means 
that the list of top level attributes are always limited to
 * {{collection}}
 * {{shard}}
 * {{replica}}
 * {{nodeset}}  (or {{node}} for backcompat) 
 * {{put}}
 * {{strict}}

{code:java}
 
//Keep exactly one replica in a set of nodes 'node-1', 'node-2' on a random node
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"name" :["node-1","node-2"]}
 
//Keep exactly one replica on each nodes in the set 'node-1', 'node-2' on a 
random node

{"shard" : "#EACH" , "replica" : 1 , "put" : "on-each", "nodeset" : {"name" 
:["node-1","node-2"]}

//Keep exactly one replica of each shard in a set of nodes with system-property 
"prop-name"== "prop-val"
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"sysprop.prop-name" : 
"prop-val"}}

// Keep exactly one replica of each shard on every node with system property 
"prop-name"== "prop-val". 

{"shard" : "#EACH","replica" : 1, "put" : "on-each", "nodeset" : 
{"sysprop.prop-name" : "prop-val"}}


//Keep exactly one replica in a set of nodes on port '8901','8902'
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"port" : [8901,8902] } }

//Keep 50% of replicas in a set of nodes with system-property "prop-name"== 
"prop-val" evenly distributed
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"sysprop.prop-name" : 
"prop-val"}}

{code}
this could be usable with any of the other properties as well such as 
{{nodeRole}}, {{freedisk}} , {{diskType}}


was (Author: noble.paul):
h4. A a new {{nodeset}} attribute
{code:java}
 //eg: 1
//Keep exactly one replica in a set of nodes 'node-1', 'node-2'
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : ["node-1","node-2"]}

//Keep exactly one replica in a set of nodes with system-property "prop-name"== 
"prop-val"
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"sysprop.prop-name" : 
"prop-val"}}


Keep exactly one replica in a set of nodes on port '8901','8902'
{"replica" : 1 , "shard" : "#EACH" , "nodeset" : {"port" : [8901,8902] } }
{code}
this could be usable with any of the other properties as well such as 
{{nodeRole}}, {{freedisk}} , {{diskType}}
h4. Support ratios.

The value of replica can be an array . When it's an array,
  * the attribute {{nodeset}} must be present
 * the value of {{nodeset}} must be an array
 * no:of elements in the {{replica}} array must be same as the no:of elements 
in the {{nodeset}} array.
{code:java}
[{
    //for each shard keep 2 on port 8983 and 3 on port 7574
    "shard": "#EACH",
    "replica": [2,3],
    "nodeset": [
      {"port": 8983},
      {"port": 7574}]
  },
  {
   //for each collection, keep 40% on zone 'east', 40% on zone 'west' & 20% on 
zone= 'apac'
    "replica": ["40%","40%","20%"],
    "nodeset": [
      {"sysprop.zone": "east"},
      {"sysprop.zone": "west"},
      {"sysprop.zone": "apac"}]
  }]
{code}

> Placing exact number of replicas on a set of solr nodes, instead of each solr 
> node.
> -----------------------------------------------------------------------------------
>
>                 Key: SOLR-13329
>                 URL: https://issues.apache.org/jira/browse/SOLR-13329
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: AutoScaling
>    Affects Versions: master (9.0)
>            Reporter: Amrit Sarkar
>            Priority: Major
>
> Let's say we have a requirement where we would like to place:
> {code}
> exact X replica on a set of solr nodes comprises of solr-node-1, solr-node-2, 
> ... solr-node-N.
> {code}
> e.g. exact 1 replica on either of the respective 3 solr nodes, solr-node-1, 
> solr-node-2, solr-node-3, and rest of the replicas can be placed on 
> corresponding solr nodes.
> Right now we don't have a straightforward manner of doing the same. 
> Autoscaling cluster policy also doesn't support such behavior, but instead 
> takes an array of solr node names and treat them as separate rules as per 
> https://lucene.apache.org/solr/guide/7_7/solrcloud-autoscaling-policy-preferences.html#sysprop-attribute.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to