Skip to content
This repository has been archived by the owner on Jun 1, 2020. It is now read-only.

Docker Riak between multiple hosts with Docker Swarm? #39

Open
bholt opened this issue May 31, 2015 · 3 comments
Open

Docker Riak between multiple hosts with Docker Swarm? #39

bholt opened this issue May 31, 2015 · 3 comments

Comments

@bholt
Copy link

bholt commented May 31, 2015

I'm trying to set up something similar to #10. Thanks, that thread definitely gives me a good place to start.

I know a recent release of Docker introduced "Docker Swarm" which seems aimed to address this kind of issue — allowing docker containers running on different hosts to communicate. Anyone know more about this new feature and know how to use it to run Riak between containers on multiple hosts?

@eproxus
Copy link

eproxus commented Jun 10, 2015

AFAIK, Docker Swarm does nothing for networking? It seems more to be aimed at distributing/scheduling Docker containers over multiple hosts.

@matthub
Copy link

matthub commented Mar 16, 2016

Hi, we've setup riak as swarm cluster here, basically you need first to create an overlay network like

docker network create --driver overlay --subnet=10.0.7.0/24 riak-net

And then we are starting the containers like following

docker run -e "DOCKER_RIAK_CLUSTER_SIZE=5" -e "DOCKER_RIAK_AUTOMATIC_CLUSTERING=1" -e "DOCKER_RIAK_BACKEND=bitcask" -p 32767:8097 -p 32768:8098 --net="riak-net" --name "riak01" -d hectcastro/riak

and then link the next ones with the hard coded address of riak01 (it did not work for me via --link) like following

docker run -e "DOCKER_RIAK_CLUSTER_SIZE=5" -e "DOCKER_RIAK_AUTOMATIC_CLUSTERING=1" -e "DOCKER_RIAK_BACKEND=bitcask" -p 32769:8097 -p 32770:8098 -e "SEED_PORT_8098_TCP_ADDR=10.0.7.2" --net="riak-net" --name "riak02" -d hectcastro/riak

HTH

@bholt
Copy link
Author

bholt commented Mar 16, 2016

Thanks! Docker's new networking stuff is really pretty great, it's come a long way in the last year. On a related project I'm now using overlay networks just like this (but with Cassandra) with no problems. In fact, I've been having a lot of success simulating adverse network conditions (a.la Jepsen) with this setup using tc netem. Hoping to make it into a real tool sometime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants