You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2017/08/01 04:30:21 UTC
lucene-solr:jira/solr-10821: SOLR-10821: Added documentation for
cluster preferences
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-10821 d77c47869 -> 24e4827f2
SOLR-10821: Added documentation for cluster preferences
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/24e4827f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/24e4827f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/24e4827f
Branch: refs/heads/jira/solr-10821
Commit: 24e4827f2e482929546a6e0de447046f79e1510d
Parents: d77c478
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Tue Aug 1 10:00:15 2017 +0530
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Tue Aug 1 10:00:15 2017 +0530
----------------------------------------------------------------------
...olrcloud-autoscaling-policy-preferences.adoc | 53 +++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/24e4827f/solr/solr-ref-guide/src/solrcloud-autoscaling-policy-preferences.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/solrcloud-autoscaling-policy-preferences.adoc b/solr/solr-ref-guide/src/solrcloud-autoscaling-policy-preferences.adoc
index ea47d17..83992ee 100644
--- a/solr/solr-ref-guide/src/solrcloud-autoscaling-policy-preferences.adoc
+++ b/solr/solr-ref-guide/src/solrcloud-autoscaling-policy-preferences.adoc
@@ -1,6 +1,8 @@
= SolrCloud Autoscaling Policy and Preferences
:page-shortname: solrcloud-autoscaling-policy-preferences
:page-permalink: solrcloud-autoscaling-policy-preferences.html
+:page-toclevels: 1
+:page-tocclass: right
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
@@ -18,7 +20,56 @@
// specific language governing permissions and limitations
// under the License.
+The autoscaling policy and preferences are a set of rules and sorting preferences that help Solr select the target of cluster management operations such that the overall load on the cluster is balanced.
+
== Cluster preferences specification
+A preference is a hint to Solr on how to sort nodes based on their utilization. The default cluster preference is to sort by the total number of Solr cores (or replicas) hosted by the node. Therefore, by default, when selecting a node to add a replica, Solr can apply the preferences and choose the node with the least number of cores.
+
+More than one preferences can be added to break ties. For example, we may choose to use free disk space to break ties if number of cores on two nodes are the same so that the node with the higher free disk space can be chosen as the target of the cluster operation.
+
+Each preference is of the following form:
+[source,json]
+----
+{"<sort_order>": "<sort_param>", "precision" : "<precision_val>"}
+----
+
`sort_order`::
-Value can be ‘maximize’ or ‘minimize’. ‘minimize’ sorts the nodes with least value as the least loaded. e.g : ‘minimize’ : ‘cores’ sorts the nodes with the least number of cores as the least loaded node. ‘maximize’ : ‘freedisk’ sorts the nodes with maximum free disk space as the least loaded node. The objective of the system is to make every node the least loaded. So, it usually targets the ‘most loaded’ node and takes load off of it. In a sort of more loaded to less loaded, minimize is akin to sort in descending order and maximize is akin to sorting in ascending order.
+The value can be either `maximize` or `minimize`. `minimize` sorts the nodes with least value as the least loaded. e.g `{"minimize" : "cores"}` sorts the nodes with the least number of cores as the least loaded node. `{"maximize" : "freedisk"}` sorts the nodes with maximum free disk space as the least loaded node. The objective of the system is to make every node the least loaded. So, e.g. in case of a `MOVEREPLICA` operation, it usually targets the _most loaded_ node and takes load off of it. In a sort of more loaded to less loaded, minimize is akin to sort in descending order and maximize is akin to sorting in ascending order. This is a required parameter.
+
+`sort_param`::
+One and only one of the following supported parameter must be specified:
+1. `cores`: The number of total Solr cores on a node
+2. `freedisk`: The amount of free disk space for Solr's data home directory. This is always in gigabytes.
+3. `sysLoadAvg`: The system load average on a node as reported by the Metrics API under the key `solr.jvm/os.systemLoadAverage`. This is always a double value between 0 and 1 and the higher the value, the more loaded the node is.
+4. `heapUsage`: The heap usage of a node as reported by the Metrics API under the key `solr.jvm/memory.heap.usage`. This is always a double value between 0 and 1 and the higher the value, the more loaded the node is.
+
+`precision`::
+Precision tells the system the minimum (absolute) difference between 2 values to treat them as distinct values. For example, a precision of 10 for `freedisk` means that two nodes whose free disk space is within 10GB of each other should be treated as equal for the purpose of sorting. This helps create ties without which, specifying multiple preferences is not useful. This is an optional parameter whose value must be a positive integer. The maximum value of precision must be less than the maximum value of the `sort_value`, if any.
+
+=== Examples of Cluster Preferences
+
+The following is the default cluster preferences. This is applied automatically by Solr when no explicit cluster preferences have been set using the Autoscaling API.
+[source,json]
+----
+[{"minimize":"cores"}]
+----
+
+In this example, we want to minimize the number of solr cores and in case of tie, maximize the amount of free disk space on each node.
+[source,json]
+----
+[
+ {"minimize" : "cores"},
+ {"maximize" : "freedisk"}
+]
+----
+
+In this example, we add a precision to the `freedisk` parameter so that nodes with free disk space within 10GB of each other are considered equal. In such a case, the tie is broken by minimizing `sysLoadAvg`.
+[source,json]
+----
+[
+ {"minimize" : "cores"},
+ {"maximize" : "freedisk", "precision" : 10},
+ {"minimize" : "sysLoadAvg"}
+]
+----