Python Unable to Connect to Cassandra through Docker Python Unable to Connect to Cassandra through Docker docker docker

Python Unable to Connect to Cassandra through Docker


After discovering a thread on grokbase that dealt with problems getting Cassandra to listen to port 9042 on an interface rather than the localhost address, I was able to find a configuration setting that works.

find private ip of container:

CONTAINER_IP=`docker inspect -f '{{ .NetworkSettings.IPAddress }}' container`

edit cassandra.yaml file:

seed: "CONTAINER_IP"listen_address: CONTAINER_IPbroadcast_address: CONTAINER_IPstart_rpc: truerpc_address: 0.0.0.0broadcast_address: CONTAINER_IP

Although this works for a single-node running in a Docker container in VirtualBox, this configuration is unlikely to work either when deployed to ec2 or when linking to other nodes in a cluster.