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

MaxChoo avatar image
MaxChoo asked ·

Why can't I connect with cqlsh in exercise 13 of DS201?

Exercise 13 - Consistency Levels

18) Now bring down the other node that was up when we originally did our write. Wait for the node to terminate before continuing.

19) Start cqlsh again and re-execute the SELECT command.

1622909780998.png

I first shut down node 3 and do the exercise and finished when i reached Q18 i shutdown node2 and it show me error. My node 2 and 3 is in the same rack. So this Q18 is to ask me shutdown node 1?

ds201
1622909780998.png (26.3 KiB)
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 ·

It looks like you want to connect to node1 but you haven't specified the correct CQL port.

cqlsh by default connects to CQL port 9042 but because all DSE instances are running in the same VM, they have to be configured to listen to different ports. The nodes in the DS201 VM are configured as follows:

$ for _node in node*; do echo "$_node - `grep ^native_transport_port $_node/resources/cassandra/conf/cassandra.yaml`"; done
node1 - native_transport_port: 9041
node2 - native_transport_port: 9042
node3 - native_transport_port: 9043

When I check on my copy of the VM, here are the running ports:

$ sudo lsof -nPi | grep LISTEN | grep 904
java      1544 ubuntu  481u  IPv4  19709      0t0  TCP 127.0.0.1:9041 (LISTEN)
java      2135 ubuntu  485u  IPv4  24848      0t0  TCP 127.0.0.1:9042 (LISTEN)
java     18820 ubuntu  480u  IPv4  45516      0t0  TCP 127.0.0.1:9043 (LISTEN)

If you want to connect to node1, you need to specify the IP and port:

$ cqlsh 127.0.0.1 9041

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.