From commits-return-105157-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Mon Nov 26 19:16:49 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CA67B180647 for ; Mon, 26 Nov 2018 19:16:48 +0100 (CET) Received: (qmail 23210 invoked by uid 500); 26 Nov 2018 18:16:47 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 23201 invoked by uid 99); 26 Nov 2018 18:16:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Nov 2018 18:16:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 89EBCE12B3; Mon, 26 Nov 2018 18:16:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ctargett@apache.org To: commits@lucene.apache.org Message-Id: <8c279f53e345402c88dc4e0a3d3100d1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: lucene-solr:master: SOLR-12740: revise migration docs for clarity and typos Date: Mon, 26 Nov 2018 18:16:47 +0000 (UTC) Repository: lucene-solr Updated Branches: refs/heads/master dc134be44 -> 68c077445 SOLR-12740: revise migration docs for clarity and typos Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/68c07744 Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/68c07744 Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/68c07744 Branch: refs/heads/master Commit: 68c0774458f9d0697bf7875e677474bae07dd266 Parents: dc134be Author: Cassandra Targett Authored: Mon Nov 26 12:15:15 2018 -0600 Committer: Cassandra Targett Committed: Mon Nov 26 12:15:15 2018 -0600 ---------------------------------------------------------------------- .../src/migrate-to-policy-rule.adoc | 140 +++++++++++-------- .../src/solrcloud-autoscaling.adoc | 2 +- 2 files changed, 82 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/68c07744/solr/solr-ref-guide/src/migrate-to-policy-rule.adoc ---------------------------------------------------------------------- diff --git a/solr/solr-ref-guide/src/migrate-to-policy-rule.adoc b/solr/solr-ref-guide/src/migrate-to-policy-rule.adoc index 587147e..38b0cd6 100644 --- a/solr/solr-ref-guide/src/migrate-to-policy-rule.adoc +++ b/solr/solr-ref-guide/src/migrate-to-policy-rule.adoc @@ -1,4 +1,4 @@ -= Migrate to Policy Rules += Migrating Rule-Based Replica Rules to Autoscaling Policies // 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 @@ -16,52 +16,83 @@ // specific language governing permissions and limitations // under the License. -Replica placement rules (legacy) are deprecated in favor of the new policy and preferences syntax (new). This document helps you to migrate your existing replica placement rules to the new syntax. +Creating rules for replica placement in a Solr cluster is now done with the <>. +This document outlines how to migrate from the legacy <> to an <>. -Every rule in the legacy framework can be expressed in the new syntax. Please refer to <> document for more details. +The autoscaling framework is designed to fully automate your cluster management. +However, if you do not want actions taken on your cluster in an automatic way, you can still use the framework to set rules and preferences. +With a set of rules and preferences in place, instead of taking action directly the system will suggest actions you can take manually. +The section <> describes the capabilities of an autoscaling policy in detail. +Below we'll walk through a few examples to show how you would express the your legacy rules in the autoscaling syntax. +Every rule in the legacy rule-based replica framework can be expressed in the new syntax. + +== How Rules are Defined + +One key difference between the frameworks is the way rules are defined. + +With the rule-based replica placement framework, rules are defined with the Collections API at the time of collection creation. + +The autoscaling framework, however, has its own <>. +Policies can be configured for the entire cluster or for individual collections depending on your needs. + +The following is the legacy syntax for a rule that limits the cluster to one replica for each shard in any Solr node: -The following is the legacy syntax for a rule that limits maximum one replica for each shard in any Solr node [source,text] ---- replica:<2,node:*,shard:** ---- -The rules are specified along with a collection creation operation as the `rules` parameter -The equivalent new syntax is +The equivalent rule in the autoscaling policy is: + [source,json] ---- -{"replica":"<2","node":"#ANY","shard":"#EACH"} +{"replica":"<2", "node":"#ANY", "shard":"#EACH"} ---- -The new policy rules have to be created separately using an API call <> +== Differences in Rule Syntaxes + +Many elements of defining rules are similar in both frameworks, but some elements are different. [[rule-operators1]] -== Rule Operators +=== Rule Operators -All the following operators can be directly used in the new policy syntax and they mean the same. +All of the following operators can be directly used in the new policy syntax and they mean the same in both frameworks. -* *equals (no operator required)*: `tag:x` means tag value must be equal to ‘x’ -* *greater than (>)*: `tag:>x` means tag value greater than ‘x’. x must be a number -* *less than (<)*: `tag:)*: `tag:>x` means the tag value must be greater than `'x'`. In this case, `'x'` must be a number. +* *less than (<)*: `tag:>. -*legacy:* +The following examples are intended to help you translate your existing rules into new rules that fit the autoscaling framework. +*Keep less than 2 replicas (at most 1 replica) of this collection on any node* + +For this rule, we define the `replica` condition with operators for "less than 2", and use a pre-defined tag named `node` to define nodes with any name. + +.Rule-based replica placement framework: [source,text] ---- replica:<2,node:* ---- -*new:* - +.Autoscaling framework: [source,json] ---- {"replica":"<2","node":"#ANY"} ---- -[[keep-less-than-2-replicas--per-shard]] -=== For a given shard, keep less than 2 replicas on any node -For this rule, we use the `shard` condition to define any shard, the `replica` condition with operators for "less than 2", and finally a pre-defined tag named `node` to define nodes with any name. +*For a given shard, keep less than 2 replicas on any node* -*legacy:* +For this rule, we use the `shard` condition to define any shard, the `replica` condition with operators for "less than 2", and finally a pre-defined tag named `node` to define nodes with any name. +.Rule-based replica placement framework: [source,text] ---- shard:*,replica:<2,node:* ---- -*new:* - +.Autoscaling framework: [source,json] ---- {"replica":"<2","shard":"#EACH", "node":"#ANY"} ---- -[[all-replicas-on-shard-730]] -=== Assign all replicas in shard1 to rack 730 - -This rule limits the `shard` condition to 'shard1', but any number of replicas. We're also referencing a custom tag named `rack`. Before defining this rule, we will need to configure a custom Snitch which provides values for the tag `rack`. +*Assign all replicas in shard1 to rack 730* -*legacy:* +This rule limits the `shard` condition to 'shard1', but any number of replicas. We're also referencing a custom tag named `rack`. +.Rule-based replica placement framework: [source,text] ---- shard:shard1,replica:*,rack:730 ---- -*new:* - +.Autoscaling framework: [source,json] ---- {"replica":"#ALL", "shard":"shard1", "sysprop.rack":"730"} ---- -Please note that all your nodes must be started with a system property `-Drack=` +In the rule-based replica placement framework, we needed to configure a custom Snitch which provides values for the tag `rack`. -[[less-than-5-cores]] -=== Create replicas in nodes with less than 5 cores only +With the autoscaling framework, however, we need to start all nodes with a system property to define the rack values. For example, `bin/solr start -c -Drack=`. -This rule uses the `replica` condition to define any number of replicas, but adds a pre-defined tag named `core` and uses operators for "less than 5". +*Create replicas in nodes with less than 5 cores only* -*legacy:* +This rule uses the `replica` condition to define any number of replicas, but adds a pre-defined tag named `core` and uses operators for "less than 5". +.Rule-based replica placement framework: [source,text] ---- cores:<5 ---- -*new:* - +.Autoscaling framework: [source,json] ---- {"cores":"<5", "node":"#ANY"} ---- -[[do-not-create-on-host]] -=== Do not create any replicas in host 192.45.67.3 -*legacy:* +*Do not create any replicas in host 192.45.67.3* +.legacy syntax: [source,text] ---- host:!192.45.67.3 ---- -*new:* - +.autoscaling framework: [source,json] ---- {"replica": 0, "host":"192.45.67.3"} ---- - -[[defining-rules1]] -== Defining Rules - -Rules are always defined in along with the collection in the legacy system. The new syntax allows you to specify rules globally as well as on a <> http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/68c07744/solr/solr-ref-guide/src/solrcloud-autoscaling.adoc ---------------------------------------------------------------------- diff --git a/solr/solr-ref-guide/src/solrcloud-autoscaling.adoc b/solr/solr-ref-guide/src/solrcloud-autoscaling.adoc index 61b8b6e..5f9f148 100644 --- a/solr/solr-ref-guide/src/solrcloud-autoscaling.adoc +++ b/solr/solr-ref-guide/src/solrcloud-autoscaling.adoc @@ -32,4 +32,4 @@ The following sections describe the autoscaling features of SolrCloud: * <> * <> * <> -* <> +* <>