DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

jaydeep.skr@gmail.com avatar image
jaydeep.skr@gmail.com asked ·

Why am I getting the unexpected result in exercise 13 of DS201?

For me the outcome of the following queries are as follows:

ubuntu@ds201-node1:~$ /home/ubuntu/node1/resources/cassandra/bin/nodetool getendpoints killrvideo videos_by_tag 'cassandra'
127.0.0.1
127.0.0.2

As 127.0.0.3 belongs to the same rack, I brought down node 3.

ubuntu@ds201-node1:~$ /home/ubuntu/node1/bin/nodetool status
Datacenter: east-side
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UN 127.0.0.2 279.95 KiB 128 ? 1a713c39-8657-45c9-806b-124a2a60dc35 hakuna-matata
Datacenter: west-side
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UN 127.0.0.1 224.74 KiB 128 ? 3ac39308-3d02-44a4-aa12-449a9ab4fa16 hakuna-matata
DN 127.0.0.3 256.42 KiB 128 ? 0bad66bc-ebdb-47b4-b783-75a5fefc8737 hakuna-matata

After that when I set the consistency to two, I was expected get an error but I got it right as shown below:

cqlsh> consistency two;
Consistency level set to TWO.
cqlsh> consistency
Current consistency level is TWO.
cqlsh> SELECT * FROM killrvideo.videos_by_tag WHERE tag = 'cassandra';

tag | added_date | video_id | title
-----------+---------------------------------+--------------------------------------+-------------------
cassandra | 2016-02-08 00:00:00.000000+0000 | 2ff2e01a-b050-4a92-a277-0bae12dbd6df | Me Lava Cassandra
cassandra | 2014-01-29 00:00:00.000000+0000 | 1645ea59-14bd-11e5-a993-8138354b7e31 | 
Cassandra History
cassandra | 2013-03-17 00:00:00.000000+0000 | 3452f7de-14bd-11e5-855e-8738355b7e3a | Cassandra Intro
cassandra | 2012-04-03 00:00:00.000000+0000 | 245e8024-14bd-11e5-9743-8238356b7e32 | Cassandra & SSDs

Question: Can someone tell me did I misunderstand the instruction and brought down the incorrect node.

Please advise if you need any other information.

Thanks in advance!

ds201
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

Erick Ramirez avatar image
Erick Ramirez answered ·

In step 5 of DS201 Exercise 13, you needed to work out which nodes were the replicas of the partition cassandra using the nodetool getendpoints command. Based on the output you posted, the replicas are:

127.0.0.1
127.0.0.2

In step 6, the instruction was:

6) Bring one of the nodes down

but instead, you brought down 127.0.0.3 which is not a replica you identified in step 5.

It makes no difference if node is 127.0.0.3 down since it does not hold the data required by the query. The data will only be requested from the 2 replicas and since they are both up, the read request succeeded. Cheers!

1 comment 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.