2

I'm following the steps in the current (2023-03-13) Cassandra quickstart:

STEP 1: GET CASSANDRA USING DOCKER

docker pull cassandra:latest

STEP 2: START CASSANDRA

docker network create cassandra
docker run --rm -d --name cassandra --hostname cassandra --network cassandra \
 cassandra

STEP 3: CREATE FILES

Created the file data.cql with the CQL script:

-- Create a keyspace
CREATE KEYSPACE IF NOT EXISTS store 
 WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' };

-- Create a table
CREATE TABLE IF NOT EXISTS store.shopping_cart (
userid text PRIMARY KEY,
item_count int,
last_update_timestamp timestamp
);

-- Insert some data
INSERT INTO store.shopping_cart
(userid, item_count, last_update_timestamp)
VALUES ('9876', 2, toTimeStamp(now()));
INSERT INTO store.shopping_cart
(userid, item_count, last_update_timestamp)
VALUES ('1234', 5, toTimeStamp(now()));

Step 4:

docker run --rm --network cassandra -v "$(pwd)/data.cql:/scripts/data.cql" \
-e CQLSH_HOST=cassandra -e CQLSH_PORT=9042 -e CQLVERSION=3.4.5 \
 nuvo/docker-cqlsh

STEP 4: LOAD DATA WITH CQLSH is failing with error:

"Can't establish connection, will retry again in 5 sconds
Failed to connect to cassandra at cassandra:9042"

I'm on Windows 10, with Docker Desktop installed as administrator, running the commands on PowerShell 7.3.3

Is there a known workaround for this issue?

4
  • Good point mustaccio. I've rephrased my question in the form of an actual question. Do you think it's understandable now? Commented Mar 13, 2023 at 18:53
  • Yes it is. But its preferable that you post the information here, rather than relying on a link. Commented Mar 13, 2023 at 19:07
  • Thanks Rohit, I've edited the question to include the steps. Commented Mar 13, 2023 at 19:37
  • 1
    And I have upvoted it Commented Mar 14, 2023 at 13:50

1 Answer 1

1

Yes, it does seem to be broken, because the world has moved on.

If you simply run

docker run --network cassandra -ti \
-e CQLSH_HOST=cassandra -e CQLSH_PORT=9042 -e CQLVERSION=3.4.5 \
nuvo/docker-cqlsh cqlsh

you'll get

Connection error: ('Unable to connect to any servers', {'172.18.0.2': ProtocolError("cql_version '3.3.1' is not supported by remote (w/ native protocol). Supported versions: [u'3.4.6']",)})

Apparently, as of today the image "cassandra:latest" wants the CQL version 3.4.6, while the tutorial uses version 3.4.5. So, change the -e CQLVERSION value to 3.4.6 and adjust the subsequent steps accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.