Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 7 Materials and Homework.

Registrations still open!


question

aidartf_193749 avatar image
aidartf_193749 asked ·

Why does exercise 7 of the DS201 assign tokens but exercise 1 does not?

In "Exercise 7 – Ring" (DS201) we create 2 nodes and specify initial_token as 0 and 9223372036854775807 correspondingly.

It means, we split token in to 2 ranges: [-9223372036854775807; 0] and [1, 9223372036854775807]

But why in "Exercise 1 – Install and Start Apache Cassandra" section we did not comment out or use 9223372036854775807 as initial_token?

After running 'labwork/config_node' I see 'initial_token: 0'

academyds201
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @aidartf_193749,

in exercise 1, we initially set up a single-node cluster. The config_node script configured the cassandra.yaml for a single token archicture (num_tokens: 1). If we are only using one token, it doesn't matter what it is, and 0 is a convenient choice. You need to specify an initial token if num_tokens is 1.

in exercise 7 we are setting up a two-node ring initially, so we want to split the token range in half. One node is configured with initial token 0, so the next node is then configured with 9223372036854775807 to split the token range.

I hope this helps to clarify the choice of 0 for the initial token in the case of the single-node cluster.

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.