Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Connecting from outside docker #5
It is possible to connect to the first node in the cluster as ports 9160 and 9042 are exposed to the docker host (the one running the containers) on localhost:19160 and localhost:19042, respectively.
The other nodes cannot be reached directly from outside a container – this is why
You'll notice that JMX is not exposed, since the protocol requires that you reconnect to a single-use port and I don't know how this could work with docker...
I hope this helps! If you have any suggestions of how you think it could work better, I'd be happy to hear them.
you could also do something like I did for the web app using this cassandra cluster.
I'd love to get to a point where the vagrant started on an guest only interface on a subnet and then all docker containers started on the same subnet with routing from vagrant guest to container directly. Then we'd have docker for a more full IaaS cloud without the container abstraction getting in the way (as opposed to mapping ports). I ran into other posts of people trying to do the same thing, but I'm not that good of a networking guru.
That's a great diagram! I'd also love to have a better solution for this, and would prefer Docker to handle it rather than have to set this up with
I'd say that the challenges here are due to issues with the discoverability of containers. I'd love to be able to set up "groups" in Docker with clear networking rules between them, like EC2 security groups for example.
First, great project.
I am trying to spin this up via vagrant and then leverage the scripts provided as part of the initial provision process to get the 1..n nodes up and running. I think I have most of it working, but do not seem to be able to connect to the cluster from the host. I followed the steps outlined above with the following results:
$ netstat -atn | grep -E "19042|19160"
Form the VM, here is what I see from a docker ps:
vagrant@ubuntu-12:~$ docker ps
Any thoughts on what I may be missing?
Can you confirm that all the shell commands you quoted are from within vagrant, and not from the VM host?
Yes, I'm pretty sure it is something I am doing wrong especially based on your above example, the post by @aspyker showing it working in his dev environment, and the fact the I'm fairly new to docker.
So the first set are from the HOST (netstat, telnet, cqlsh) not the VM. The second set of commands, docker ps, is from within VM. My host os is Mac OSX 10.9.1.
The version are as follows:
Vagrant::Config.run do |config|
Setup virtual machine box. This VM configuration code is always executed.
config.vm.box = BOX_NAME
Again, I'm fairly confident it is something I am doing wrong based on your above post that shows it working fine. The git.sh, really bad name as of now, installs git and a few other packages, then clones your repo. From there the docker.sh issues the commands to create the image, and startup the docker containers, basically they just invoke your scripts, perhaps this is just wrong on my part.
Thanks again for the assistance.
added a commit
Feb 2, 2014
I've changed the way that ports are exposed on the host. Ports 9160 and 9042 are now exposed as 9160 and 9042, without the prefix "1".
You should then be able to run