OK, so running default JGroups between nodes in a Docker swarm will
*not* work as IP multicasting between docker nodes is *not* supported;
see [1] for details (and vote for it!).
Default JGroups (udp.xml) uses IP multicasting for discovery, so it
won't work in a docker swarm for the time being. Also, UDP as transport
uses IP multicasting, too, so this needs to be disabled
(ip_mcast=false), or use TCP instead.
However, there are alternatives:
* Use a docker plugin (e.g. weave) to implement multicasting in a swarm
network
* Use a different discovery mechanism, e.g. TCPPING, TCPGOSSIP,
FILE_PING (to an NFS server), JDBC_PING (to a shared DB), NATIVE_S3_PING
or GOOGLE_PING (cloud store) etc...
Once you switch to AWS, you can use TCP/NATIVE_S3_PING, this has been
tested and works.
[1]
https://github.com/docker/libnetwork/issues/552
On 23/09/18 08:42, Prateek Kumar wrote:
> Hi!
>
> I wanted to check if there's any *progress *towards a feasible/working
> solution to support _container services which can coalesce into a single
> cluster using Jgroups 4 and are spread across separate docker hosts._
>
> It seems the last update was in *2015 *as below:
>
> * Not gone beyond single host -
>
https://issues.jboss.org/browse/JGRP-1840?focusedCommentId=13011991&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-13011991
> * Still need to investigate beyond single host
> -
http://belaban.blogspot.com/2014/10/jgroups-and-docker.html
> * OOTB support is missing and might require changes in docker to
> Have not tried some /possible /solutions since I would like to first
> *confirm if its possible OOTB (or not)*, before trying those like -
> /So could someone please advise if this is possible?/
>
> _*Scenario*:_
>
> * On premise private LAN network (not in AWS yet).
> * 2 docker hosts in a swarm cluster
> * Containers deployed as services stack (not containers like docker
> run with/without --net=host) so they will form a bridge network and
> get distributed across multiple docker hosts.
> * Jgroups 4 inside each container - for testing here we can use
> belaban/jgroups itself (but deployed using docker stack deploy
> instead), although in our application has an embedded Infinispan
> cache running in distributed nodes and is using Jgroups to discover
> multiple instances of our webapp.
>
> *_What's working_* - multiple service containers on a /single /docker
> *_Not working_ *- when deployed across the 2 (or multiple) docker hosts.
> Atthispoint suppose containerId1 ison dockerHost1 andcontainerId2 went
> to dockerHost2 -ifwe run the following commands on each host,they should
> form a cluster but are failing to coalesce intosingle cluster.
> [root@localhost jgroups]# docker exec -it containerId1 /bin/bash
>
> bash-4.3$ cd jgroups-docker/conf/
> bash-4.3$ chat.sh -props udp.xml
> **view:[containerId1 -38465|0](1)[containerId1 -38465]
>
> exit
> |
>
>
> *If the above were to be done on a single docker host running in swarm
> mode (which is possible even for single host), then the above shows view
> : 2. Similarly in multiple host mode with replicas above, the containers
> form clusters on each host, but do not coalesce into a single cluster
> /across /the docker hosts.*
> *
> *
> Am hoping there's a solution here! Will provide any/more details if sought.
> Thanks,
> Prateek Kumar
>
> --
> You received this message because you are subscribed to the Google
> Groups "jgroups-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
jgroups-dev...@googlegroups.com
> <mailto:
jgroups-dev...@googlegroups.com>.
>
https://groups.google.com/d/msgid/jgroups-dev/e70f7b94-6367-4148-b9fe-b973c2266817%40googlegroups.com
> <
https://groups.google.com/d/msgid/jgroups-dev/e70f7b94-6367-4148-b9fe-b973c2266817%40googlegroups.com?utm_medium=email&utm_source=footer>.