Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
docked cassandra cluster

Adapted from to install CQLSH the Python based Cassandra CLI

Documented at

start three nodes

docker run -d --name "cass0" zmarcantel/cassandra
docker run -d --name cass1 --link cass0:cass0 zmarcantel/cassandra
docker run -d --name cass2 --link cass0:cass0 --link cass1:cass1 zmarcantel/cassandra

capture the image names and extract their IPs

export CASSDOCK_ID=`docker ps | grep cassandra | awk '{print $1}' | xargs`
docker inspect $CASSDOCK_ID | grep IPAddress | sed 's/"IPAddress": "/ /g' | sed 's/",//g' | sed 's/ //g' | grep -v null | sort -u

open bash as root on one node and install then run the python cassandra query tool

docker exec -it `docker ps | grep cassandra | awk '{print $1}' | head -1` bash
apt-get update
apt-get install python-setuptools python-dev build-essential
easy_install pip
pip install --upgrade virtualenv
# this next command appeared to hang but eventually completes
pip install cqlsh
# if you see ProtocolError on the following try downgrading cqlsh with: uninstall cqlsh && pip install cqlsh==4.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.