You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a dynomite cluster with 2 racks and each rack having 7 to 8 nodes, can any one suggest me the token for each node, I tried to find the token for each node using below formula but its giving me the decimal numbers
def calculate_tokens(racks=2, nodes_per_rack=8):
max_token = 4294967295 # 32-bit token space
tokens = []
# Calculate tokens for each rack
for rack_index in range(racks):
# Each rack gets a fraction of the total token range
rack_start_token = (max_token // racks) * rack_index
rack_end_token = (max_token // racks) * (rack_index + 1) - 1
# Calculate the range of tokens for each node in this rack
for node_index in range(nodes_per_rack):
# Tokens are evenly distributed within the rack's range
node_token = rack_start_token + (rack_end_token - rack_start_token) * node_index // (nodes_per_rack - 1)
tokens.append(node_token)
return tokens
# Example: Create tokens for 2 racks and 8 nodes per rack
tokens = calculate_tokens(racks=2, nodes_per_rack=8)
# Print the tokens
for idx, token in enumerate(tokens):
print(f"Node {idx+1}: Token {token}")
I would like to create a dynomite cluster with 2 racks and each rack having 7 to 8 nodes, can any one suggest me the token for each node, I tried to find the token for each node using below formula but its giving me the decimal numbers
nodeToken = (4294967295 / numberOfNodesInRack) * nodeIndex
can any one help me here
The text was updated successfully, but these errors were encountered: