Re: Question about adding nodes to a cluster

2015-02-10 Thread Robert Coli
On Mon, Feb 9, 2015 at 5:25 PM, Seth Edwards s...@pubnub.com wrote:

 I see what you are saying. So basically take whatever existing token I
 have and divide it by 2, give or take a couple of tokens?


Yep! bisect the token ranges if you want to be fancy about it.

=Rob


Re[2]: Question about adding nodes to a cluster

2015-02-09 Thread Plotnik, Alexey
Sorry, No - you are not doing it wrong ^)


Yes, Cassandra partitioner is based on hash ring. Doubling number of nodes is 
the best cluster exctending policy I've ever seen, because it's zero-overhead.

Hashring - you get MD5 max (2^128-1), divide it by number of nodes (partitions) 
getting N points and then evenly distribute them across you ring. You can open 
Python script you used to generate the following output ans see how it works.



I am on Cassandra 1.2.19 and I am following the documentation for adding 
existing nodes to a 
clusterhttp://www.datastax.com/docs/1.1/cluster_management#adding-capacity-to-an-existing-cluster.

We are choosing to double our cluster from six to twelve. I ran the token 
generator. Based on what I read in the documentation, I expected to see the 
same first six tokens and six new tokens. Instead I see almost the same tokens 
but off by a few numbers. Is this expected? Should I change the similar tokens 
to the new ones? Am I doing it wrong?


Here is the output I am dealing with.

With six:

DC #1:
  Node #1:0
  Node #2:   28356863910078205288614550619314017621
  Node #3:   56713727820156410577229101238628035242
  Node #4:   85070591730234615865843651857942052863
  Node #5:  113427455640312821154458202477256070484
  Node #6:  141784319550391026443072753096570088105

With twelve:

DC #1:
  Node #01:0
  Node #02:   14178431955039102644307275309657008810
  Node #03:   28356863910078205288614550619314017620
  Node #04:   42535295865117307932921825928971026430
  Node #05:   56713727820156410577229101238628035240
  Node #06:   70892159775195513221536376548285044050
  Node #07:   85070591730234615865843651857942052860
  Node #08:   99249023685273718510150927167599061670
  Node #09:  113427455640312821154458202477256070480
  Node #10:  127605887595351923798765477786913079290
  Node #11:  141784319550391026443072753096570088100
  Node #12:  155962751505430129087380028406227096910


Re: Question about adding nodes to a cluster

2015-02-09 Thread Robert Coli
On Mon, Feb 9, 2015 at 4:59 PM, Seth Edwards s...@pubnub.com wrote:

 We are choosing to double our cluster from six to twelve. I ran the token
 generator. Based on what I read in the documentation, I expected to see the
 same first six tokens and six new tokens. Instead I see almost the same
 tokens but off by a few numbers. Is this expected? Should I change the
 similar tokens to the new ones? Am I doing it wrong?


In your existing cluster, your first token is at
28356863910078205288614550619314017621, which ends in an odd number.

You cannot therefore choose a new token which exactly bisects its range,
because a node cannot own the token 28356863910078205288614550619314017621
/2 =
14178431955039102644307275309657008810.5 ... because tokens are integers.

You will however notice that floor() of your current token divided by two
is your new token (14178431955039102644307275309657008810).

I would personally keep my existing 6 tokens and do the simple math myself
of bisecting their ranges, not move my existing tokens around by one or two
tokens.

=Rob


Re: Question about adding nodes to a cluster

2015-02-09 Thread Seth Edwards
I see what you are saying. So basically take whatever existing token I have
and divide it by 2, give or take a couple of tokens?

On Mon, Feb 9, 2015 at 5:17 PM, Robert Coli rc...@eventbrite.com wrote:

 On Mon, Feb 9, 2015 at 4:59 PM, Seth Edwards s...@pubnub.com wrote:

 We are choosing to double our cluster from six to twelve. I ran the token
 generator. Based on what I read in the documentation, I expected to see the
 same first six tokens and six new tokens. Instead I see almost the same
 tokens but off by a few numbers. Is this expected? Should I change the
 similar tokens to the new ones? Am I doing it wrong?


 In your existing cluster, your first token is at
 28356863910078205288614550619314017621, which ends in an odd number.

 You cannot therefore choose a new token which exactly bisects its range,
 because a node cannot own the token 28356863910078205288614550619314017621
 /2 =
 14178431955039102644307275309657008810.5 ... because tokens are integers.

 You will however notice that floor() of your current token divided by two
 is your new token (14178431955039102644307275309657008810).

 I would personally keep my existing 6 tokens and do the simple math myself
 of bisecting their ranges, not move my existing tokens around by one or two
 tokens.

 =Rob









Question about adding nodes to a cluster

2015-02-09 Thread Seth Edwards
I am on Cassandra 1.2.19 and I am following the documentation for adding
existing nodes to a cluster
http://www.datastax.com/docs/1.1/cluster_management#adding-capacity-to-an-existing-cluster
.

We are choosing to double our cluster from six to twelve. I ran the token
generator. Based on what I read in the documentation, I expected to see the
same first six tokens and six new tokens. Instead I see almost the same
tokens but off by a few numbers. Is this expected? Should I change the
similar tokens to the new ones? Am I doing it wrong?


Here is the output I am dealing with.

With six:

DC #1:
  Node #1:0
  Node #2:   28356863910078205288614550619314017621
  Node #3:   56713727820156410577229101238628035242
  Node #4:   85070591730234615865843651857942052863
  Node #5:  113427455640312821154458202477256070484
  Node #6:  141784319550391026443072753096570088105

With twelve:

DC #1:
  Node #01:0
  Node #02:   14178431955039102644307275309657008810
  Node #03:   28356863910078205288614550619314017620
  Node #04:   42535295865117307932921825928971026430
  Node #05:   56713727820156410577229101238628035240
  Node #06:   70892159775195513221536376548285044050
  Node #07:   85070591730234615865843651857942052860
  Node #08:   99249023685273718510150927167599061670
  Node #09:  113427455640312821154458202477256070480
  Node #10:  127605887595351923798765477786913079290
  Node #11:  141784319550391026443072753096570088100
  Node #12:  155962751505430129087380028406227096910


Re: Question about adding nodes to a cluster

2015-02-09 Thread Plotnik, Alexey
Yes, Cassandra partitioner is based on hash ring. Doubling number of nodes is 
the best cluster exctending policy I've ever seen, because it's zero-overhead.

Hashring - you get MD5 max (2^128-1), divide it by number of nodes (partitions) 
getting N points and then evenly distribute them across you ring. You can open 
Python script you used to generate the following output ans see how it works.



I am on Cassandra 1.2.19 and I am following the documentation for adding 
existing nodes to a 
clusterhttp://www.datastax.com/docs/1.1/cluster_management#adding-capacity-to-an-existing-cluster.

We are choosing to double our cluster from six to twelve. I ran the token 
generator. Based on what I read in the documentation, I expected to see the 
same first six tokens and six new tokens. Instead I see almost the same tokens 
but off by a few numbers. Is this expected? Should I change the similar tokens 
to the new ones? Am I doing it wrong?


Here is the output I am dealing with.

With six:

DC #1:
  Node #1:0
  Node #2:   28356863910078205288614550619314017621
  Node #3:   56713727820156410577229101238628035242
  Node #4:   85070591730234615865843651857942052863
  Node #5:  113427455640312821154458202477256070484
  Node #6:  141784319550391026443072753096570088105

With twelve:

DC #1:
  Node #01:0
  Node #02:   14178431955039102644307275309657008810
  Node #03:   28356863910078205288614550619314017620
  Node #04:   42535295865117307932921825928971026430
  Node #05:   56713727820156410577229101238628035240
  Node #06:   70892159775195513221536376548285044050
  Node #07:   85070591730234615865843651857942052860
  Node #08:   99249023685273718510150927167599061670
  Node #09:  113427455640312821154458202477256070480
  Node #10:  127605887595351923798765477786913079290
  Node #11:  141784319550391026443072753096570088100
  Node #12:  155962751505430129087380028406227096910