cqlsh to Cassandra single node running in docker cqlsh to Cassandra single node running in docker docker docker

cqlsh to Cassandra single node running in docker


Happened to me, able to cqlsh within container, but unable to connect from outside the docker container host, when I realized using v2.1 that DOES NOT use 9160:

From the cqlsh documentation:

So, you should get clqsh client to use IP of the host containing the docker container at 9042 and not 9106. Use docker ps and netstat -atun | grep LIST and telnet to confirm the right port is in LISTEN status.

docker run -d -p 9042:9042 cassandra:2.2docker run -d -p 9042:9042 poklet/cassandra

Requirements

In Cassandra 2.1, the cqlsh utility uses the native protocol. In Cassandra 2.1, which uses the Datastax python driver, the default cqlsh listen port is 9042.

In Cassandra 2.0, the cqlsh utility uses the Thrift transport. In Cassandra 2.0.x, the default cqlsh listen port is 9160.

Cassandra cqlsh - connection refused


You should set the listen_address to the IP address assigned to the container. You can find this using 'boot2docker inspect' against the container.

Normally the container's IP address will be on the private network established by boot2docker, and so will not be accessible outside the boot2docker VM unless you route traffic through the VM something like this: https://gist.github.com/bhyde/be920f1a390db5f4148e