incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sasha Dolgy <sdo...@gmail.com>
Subject calculating initial_token
Date Mon, 14 Mar 2011 20:18:15 GMT
Sorry for being a bit daft ... Wanted a bit of validation or rejection ...

If I have a 6 node cluster, replication factor 2 (don't think this is
applicable to the token decision) is the following sufficient and
correct for determining the tokens:

#!/bin/bash
for nodes in {0..5};
do
    echo "$nodes*(2^127/5)" | bc;
done




Gives me a result of:

0
34028236692093846346337460743176821145
68056473384187692692674921486353642290
102084710076281539039012382229530463435
136112946768375385385349842972707284580
170141183460469231731687303715884105725

My ring right now is:


10.0.0.2  Up     Normal  225 KB          40.78%
24053088190195663439419935163232881936
10.0.0.3    Up     Normal  201.21 KB       19.17%
56667357399723182105247119364967854254
10.0.0.4   Up     Normal  213.15 KB       17.61%
86624712919272143003828971968762407027
10.0.0.5   Up     Normal  214.54 KB       11.22%
105714724128406151241468359303513100912
10.0.0.6  Up     Normal  206.39 KB       5.61%
115259729732973155360288052970888447854
10.0.0.7    Up     Normal  247.68 KB       5.61%
124804735337540159479107746638263794797

If my new tokens are correct:

1.  cassandra.yaml is updated on each node with new token
2.  node is restarted and a nodetool repair is run, or is a nodetool
loadbalance run

Thanks in advance ... been staring at
http://wiki.apache.org/cassandra/Operations#Token_selection for too
long

-- 
Sasha Dolgy
sasha.dolgy@gmail.com

Mime
View raw message