You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (Created) (JIRA)" <ji...@apache.org> on 2012/01/06 19:30:39 UTC

[jira] [Created] (CASSANDRA-3709) Add a token generator to standard tools

Add a token generator to standard tools
---------------------------------------

                 Key: CASSANDRA-3709
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
             Project: Cassandra
          Issue Type: New Feature
          Components: Tools
            Reporter: Jonathan Ellis
            Assignee: paul cannon
            Priority: Minor
             Fix For: 1.1


We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "Brandon Williams (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181499#comment-13181499 ] 

Brandon Williams commented on CASSANDRA-3709:
---------------------------------------------

We should probably include multi-dc support as well, as that commonly confuses people.
                
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "Jonathan Ellis (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181497#comment-13181497 ] 

Jonathan Ellis edited comment on CASSANDRA-3709 at 1/6/12 6:30 PM:
-------------------------------------------------------------------

Here's the one we have in the DataStax docs.  It could stand a little improvement, e.g. adding a help section, being more graceful w/ non integer input.

{code}
#! /usr/bin/python
import sys
if (len(sys.argv) > 1):
    num=int(sys.argv[1])
else:
    num=int(raw_input("How many nodes are in your cluster? "))
for i in range(0, num):
    print 'token %d: %d' % (i, (i*(2**127)/num))
{code}
                
      was (Author: jbellis):
    Here's the one we have in the DataStax docs.  It could stand a little improvement, e.g. adding a help section, being more graceful w/ non integer input.

{{
#! /usr/bin/python
import sys
if (len(sys.argv) > 1):
    num=int(sys.argv[1])
else:
    num=int(raw_input("How many nodes are in your cluster? "))
for i in range(0, num):
    print 'token %d: %d' % (i, (i*(2**127)/num))
}}
                  
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181497#comment-13181497 ] 

Jonathan Ellis commented on CASSANDRA-3709:
-------------------------------------------

Here's the one we have in the DataStax docs.  It could stand a little improvement, e.g. adding a help section, being more graceful w/ non integer input.

{{
#! /usr/bin/python
import sys
if (len(sys.argv) > 1):
    num=int(sys.argv[1])
else:
    num=int(raw_input("How many nodes are in your cluster? "))
for i in range(0, num):
    print 'token %d: %d' % (i, (i*(2**127)/num))
}}
                
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

paul cannon updated CASSANDRA-3709:
-----------------------------------

    Attachment: 3709.patch.txt

New version prefers to optimize for NTS, but keeps the mode for ONTS behind an option.

My 3709 branch is updated at github; new tag is pending/3709-2.
                
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1.3
>
>         Attachments: 3709.patch.txt
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

paul cannon updated CASSANDRA-3709:
-----------------------------------

    Attachment: 3709.patch.txt

This utility is roughly based on Joaquin's tokentoolv2.py in the Datastax AMI repository at https://github.com/riptano/ComboAMI/blob/4305bb1db0/tokentoolv2.py . It allows specification of an arbitrary number of datacenters and an arbitrary number of nodes per each, and does a best effort to spread out same-DC nodes as much as possible, even when the DC sizes vary greatly.

Use with no arguments for an interactive mode, and use {{--graph}} to send a rendering of the generated cluster to your browser. The {{\--help}} option explains the rest.

Patch attached; changes also available via git in the 3709 branch in my github, tagged as pending/3709:

https://github.com/thepaul/cassandra/tree/pending/3709
                
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1.3
>
>         Attachments: 3709.patch.txt
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-3709) Add a token generator to standard tools

Posted by "paul cannon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

paul cannon updated CASSANDRA-3709:
-----------------------------------

    Attachment:     (was: 3709.patch.txt)
    
> Add a token generator to standard tools
> ---------------------------------------
>
>                 Key: CASSANDRA-3709
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3709
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Tools
>            Reporter: Jonathan Ellis
>            Assignee: paul cannon
>            Priority: Minor
>             Fix For: 1.1.3
>
>
> We recommend spacing nodes in a new cluster evenly around the ring; we should provide a tool to generate appropriate tokens for a cluster of size X.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira