Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. ## start three nodes
  2. ```sh
  3. docker run -d --name "cass0" zmarcantel/cassandra
  4. docker run -d --name cass1 --link cass0:cass0 zmarcantel/cassandra
  5. docker run -d --name cass2 --link cass0:cass0 --link cass1:cass1 zmarcantel/cassandra
  6. ```
  7. ### capture the image names and extract their IPs
  8. ```sh
  9. export CASSDOCK_ID=`docker ps | grep cassandra | awk '{print $1}' | xargs`
  10. docker inspect $CASSDOCK_ID | grep IPAddress | sed 's/"IPAddress": "/ /g' | sed 's/",//g' | sed 's/ //g' | grep -v null | sort -u
  11. ```
  12. ### open bash as root on one node and install then run the python cassandra query tool
  13. ```sh
  14. docker exec -it `docker ps | grep cassandra | awk '{print $1}' | head -1` bash
  15. apt-get update
  16. apt-get install python-setuptools python-dev build-essential
  17. easy_install pip
  18. pip install --upgrade virtualenv
  19. # this next command appeared to hang but eventually completes
  20. pip install cqlsh
  21. # if you see ProtocolError on the following try downgrading cqlsh with: uninstall cqlsh && pip install cqlsh==4.0.1
  22. cqlsh 127.0.0.1
  23. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement