I've uploaded an image with JGroups and a few demos to DockerHub [2].
The image is based on Fedora 20 and contains JGroups, plus a few scripts which run a chat demo, a distributed lock demo and a distributed counter demo.
To run this, it's as simple as executing
docker run -it belaban/jgroups
This will drop you into a bash shell and you're ready to run any of the three demos.
Start multiple containers and you have a cluster in which you can try out things, e.g. a cluster node acquiring a lock, another node trying to acquire it and blocking, the first node crashing and the second node finally acquiring the lock etc.
Note that this currently runs a cluster on one physical box. I'll still need to investigate what needs to be done to run Docker containers on different hosts and cluster them [3].
The Dockerfile is at [1] and can be used to derive another image from it, or to build the image locally.
[1] https://github.com/belaban/jgroups-docker
[2] https://registry.hub.docker.com/u/belaban/jgroups/
[3] https://issues.jboss.org/browse/JGRP-1840
Physical box means on single IP (single JVM). How can provide multiple IPs while using UDP.xml
ReplyDeleteYou can run multiple JVMs on the same box, but spanning multiple boxes hasn't been done yet. I guess that's more a missing feature of Docker than JGroups though...
ReplyDeleteMy requirement is using multiple IPs on multiple boxes using JGroups. How can I achieve those configuration. Please guide me.
DeleteThanks
It will be great if you can provide me your email id.
Deletemy email id - cmtripathi@gmail.com
Hi Bela,
DeleteCan you please suggest using JGroups how to write and run same application in multiple boxes as cluster.
Thanks in advance,
Hemant
Chandra: belaban at yahoo dot com, but I suggest post to the JGroups mailing lists for questions on JGroups.
ReplyDeleteHemant: what do you mean ? I also suggest the mailing list rather than the blog for questions on JGroups.