I’m following this quickstart: https://cassandra.apache.org/_/quickstart.html
I created this network “cassandra” (step 2)
docker network create cassandra
[ { “Name”: “cassandra”, “Id”:
“90110775f66993f8588559650da813ba1f30bd785ca9b13d2e5fff46cb2685e0”,
“Created”: “2023-06-12T23:03:45.05532Z”, “Scope”: “local”, “Driver”:
“bridge”, “EnableIPv6”: false, “IPAM”: { “Driver”: “default”,
“Options”: {}, “Config”: [ { “Subnet”: “172.21.0.0/16”, “Gateway”:
“172.21.0.1” } ] }, “Internal”: false, “Attachable”: false, “Ingress”:
false, “ConfigFrom”: { “Network”: “” }, “ConfigOnly”: false,
“Containers”: {}, “Options”: {}, “Labels”: {} } ]
After that running (step 2)
docker run –rm -d –name cassandra –hostname cassandra –network
cassandra cassandra
After running (step 5) gotting this error:
docker run –rm -it –network cassandra nuvo/docker-cqlsh cqlsh
cassandra 9042 –cqlversion=‘3.4.5’Traceback (most recent call last): File “/usr/local/bin/cqlsh”, line
2816, in main(*read_options(sys.argv[1:], os.environ)) File
“/usr/local/bin/cqlsh”, line 2795, in main encoding=options.encoding)
File “/usr/local/bin/cqlsh”, line 690, in init
load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]), File
“/usr/local/lib/python2.7/site-packages/cassandra/policies.py”, line
425, in init for endpoint in socket.getaddrinfo(a, None,
socket.AF_UNSPEC, socket.SOCK_STREAM)] socket.gaierror: [Errno -2] Name does not resolve
2
Answers
I found the problem with that.
My docker container was killed by docker because my memory was configured with low values:
https://lucianomolinari.com/2017/06/11/containers-being-killed-on-docker-for-mac/
Unfortunatelly I wasn't getting any error.
The guide works still, but with 1 caveat, the –cqlshversion needs to be incremented to 3.4.6, because cassandra:latest has moved forwards.
Using the
CQLVERSION=3.4.5
does not work as mentioned, attempting to use 3.4.5 generates this response:I would try first to use the 3.4.6 – although the python stack trace indicates that you have a container not in the network?