From user-return-63821-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Mon May 6 02:48:09 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CACB018066B for ; Mon, 6 May 2019 04:48:08 +0200 (CEST) Received: (qmail 9706 invoked by uid 500); 6 May 2019 02:48:02 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 9696 invoked by uid 99); 6 May 2019 02:48:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 May 2019 02:48:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 593B6C1BA2 for ; Mon, 6 May 2019 02:48:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.798 X-Spam-Level: * X-Spam-Status: No, score=1.798 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id IllTUODBiX4I for ; Mon, 6 May 2019 02:47:59 +0000 (UTC) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5A1996110B for ; Mon, 6 May 2019 02:47:59 +0000 (UTC) Received: by mail-lj1-f176.google.com with SMTP id s7so4309127ljh.1 for ; Sun, 05 May 2019 19:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4TiTFDsX/P+yAhVRtp6Djd6jA2wRRKcwq5M8ViE3KFg=; b=iQ6MS3bgLi6wivrScp3BXN2Vo5zWPjIY2/M/ufRhttX3F9ICpHXg/PD4zk0elmESNf IkJJfI8KEHWltA7DPb8nHhgCW1Em26O/aQpPZx39O+k183wYajd204B+FGm8L5COgZzN IrdxJssWxohBwDf0eOjDEbTlH9g8GtBLWi13bZj4lZ7sdlIKNrDV+KM40AD0+UbVzru1 TIpg+xNjqW6QI0FES18k8VsGzo2Y4+tyKAz9dDPw932VvmGtFD55PhbJvTSKgi5hVAPO C5Kpm2XnFOVEFNqaodYN92uSN5WurO0V0PbvoSN2hwKkTiQLXiEeWFpfdmDBOtGVRMD9 Pxbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4TiTFDsX/P+yAhVRtp6Djd6jA2wRRKcwq5M8ViE3KFg=; b=IGaGDkf6FY2H8cnhzAOOk61j31aFgnT9g2/DZC5K+vZBCVWCNvCmi40GWZ6AIi/R+i Ve/hv9k9MhMUTpiu9veK+dCXwRKq7645zrvER5KIGCT30BeHgveBgM9Uo8v3Nj7aaoFV rnw5ZcU6KnC25EhdCYVSWWSkJEI2DT8N+/+s3VSoU72D00OguTCooQXndjs7zKZct7iz 852RP46a5pKiYJCxJjWCXJ2F7yCdY8HCQ70bRwihz5+ZLFVRrmgkYl6PJXVV2MFFkm5N +tTjEiW1Z4eBhOnkxHYulwqOlrLQ4CIJAc0/ssand1dUyyVB+y8aB+bEWZub5wy+BYWj wwSQ== X-Gm-Message-State: APjAAAWkwZLDd+9Dvv8a63mw3rTU4IISLAKFeFTb/C5RjYiGrpyEPnyC vYnHlWf1eZYtLeeB1wL03o+UJFQHlGDoTLiXoaN56oXK X-Google-Smtp-Source: APXvYqw8EyjcenqC8ewQrSHoYc7DIZxxrBf+oAkAuhRte+lB8LtYuM8jfMxn3uE52RWPCedqJyvagB8vbsywRKv9sIs= X-Received: by 2002:a2e:9252:: with SMTP id v18mr3049020ljg.119.1557110873539; Sun, 05 May 2019 19:47:53 -0700 (PDT) MIME-Version: 1.0 References: <16a821ed499.af3afa5e29208.9163146459405242974@zoho.com> In-Reply-To: <16a821ed499.af3afa5e29208.9163146459405242974@zoho.com> From: Anthony Grasso Date: Mon, 6 May 2019 12:47:14 +1000 Message-ID: Subject: Re: How to set up a cluster with allocate_tokens_for_keyspace? To: user Content-Type: multipart/alternative; boundary="0000000000007e4a1c05882f2060" --0000000000007e4a1c05882f2060 Content-Type: text/plain; charset="UTF-8" Hi If you are planning on setting up a new cluster with allocate_tokens_for_keyspace, then yes, you will need one seed node per rack. As Jon mentioned in a previous email, you must manually specify the token range for *each* seed node. This can be done using the initial_token setting. The article you are referring to ( https://thelastpickle.com/blog/2019/02/21/set-up-a-cluster-with-even-token-distribution.html) includes python code which calculates the token ranges for each of the seed nodes. When calling that python code, you must specify the vnodes - number of token per node and the number of racks. Regards, Anthony On Sat, 4 May 2019 at 19:14, onmstester onmstester wrote: > I just read this article by tlp: > > https://thelastpickle.com/blog/2019/02/21/set-up-a-cluster-with-even-token-distribution.html > > Noticed that: > >>We will need to set the tokens for the seed nodes in each rack > manually. This is to prevent each node from randomly calculating its own > token ranges > > But until now, i was using this recommendation to setup a new cluster: > >> > > You'll want to set them explicitly using: python -c 'print( [str(((2**64 / 4) * i) - 2**63) for i in range(4)])' > > > After you fire up the first seed, create a keyspace using RF=3 (or whatever you're planning on using) and set allocate_tokens_for_keyspace to that keyspace in your config, and join the rest of the nodes. That gives even > distribution. > > I've defined plenty of racks in my cluster (and only 3 seed nodes), should > i have a seed node per rack and use initial_token for all of the seed nodes > or just one seed node with inital_token would be ok? > Best Regards > > > --0000000000007e4a1c05882f2060 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi
=
If you are planning on setting up a new cluster with allocate_tokens_for_keyspace, then yes,= you will need one seed node per rack. As Jon mentioned in a previous email= , you must manually specify the token range for=C2=A0each seed node.= This can be done using the initial_tok= en setting.

The article you are referring t= o (https://thelastpickle.com/blog/2019/02/21/= set-up-a-cluster-with-even-token-distribution.html) includes python cod= e which calculates the token ranges for each of the seed nodes. When callin= g that python code, you must specify the vnodes - number of token per node = and the number of racks.

Regards,
Anthon= y

On Sat, 4 May 2019 at 19:14, onmstester onmstester= <onmstester@zoho.com.invalid> wrote:
I just read this article by = tlp:
=C2=A0
Noticed that:
>>We will need to set the tokens for the seed nodes in each r= ack manually. This is to prevent each node from randomly calculating its ow= n token ranges

=C2= =A0But until now, i was using this recommendation to setup a new cluster:
>>
You'll want to set them explicitly u=
sing: python -c 'print( [str(((2**64 / 4) * i) - 2**63) for i in range(=
4)])'


After you fire up the first seed, create a keyspace using RF=3D3 (or whatev=
er you're planning on using) and set allocate_tokens_for_keyspace to th=
at keyspace in your config, and join the rest of the nodes. That gives even
distribution.

I've = defined plenty of racks in my cluster (and only 3 seed nodes), should i hav= e a seed node per rack and use initial_token for all of the seed nodes or j= ust one seed node with inital_token would be ok?

Best Regards
=


--0000000000007e4a1c05882f2060--