docker-library/cassandra

Can't connect to cassandra from cqlsh

reachmehasy opened this issue · 1 comments

Sequence of commands executed:

$ docker network create some-network
$ docker run --name some-cassandra -d --network some-network cassandra:latest
$ docker run --name some-cassandra2 -d --network some-network -e CASSANDRA_SEEDS=some-cassandra cassandra:latest
$ docker run -it --network some-network --rm cassandra cqlsh some-cassandra

Error:
Traceback (most recent call last):
File "/opt/cassandra/bin/cqlsh.py", line 2443, in
main(*read_options(sys.argv[1:], os.environ))
File "/opt/cassandra/bin/cqlsh.py", line 2421, in main
encoding=options.encoding)
File "/opt/cassandra/bin/cqlsh.py", line 485, in init
load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]),
File "/opt/cassandra/bin/../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/policies.py", line 417, in init
socket.gaierror: [Errno -2] Name or service not known

Issue fixed:

In the last command use

$ docker run -itd --network some-network --rm cassandra cqlsh some-cassandra

interactive -tty -detach
(itd)