title: JGroups doesnt form a cluster while running inside docker across multiple nodes
body: <p>Im running jgroups application inside docker containers. Containers are running across two  nodes (A &amp; B) and they are all connected using docker swarm mode overlay network.</p>
  
  <p>I referred to <a href="https://docs.docker.com/engine/swarm/networking/" rel="nofollow noreferrer">https://docs.docker.com/engine/swarm/networking/</a></p>
  
  <p>Here is what i did and observed.</p>
  
  <ol>
  <li>Jgroup bind address is set to the overlay network IP of the container</li>
  <li>containers running inside the same node are forming a cluster.</li>
  <li>I used <code>nslookup</code> to ensure that the overlay network IP of a container running in node A is reachable by a container running in node B</li>
  <li><code>docker node ls</code> display the nodes correctly and able to schedule the containers instances successfully.</li>
  </ol>
  
  <p>Docker Version: Docker version 17.03.1-ce, build c6d412e</p>
  
  <p>OS: Ubuntu 16.04.2</p>
  
  <p>Cloud: AWS (Port 7946 TCP/UDP and 4789 UDP are open)</p>
  
  <p>JGroups: 3.6.6</p>
  
  <p>Jgroups XML:</p>
  
  <pre><code>&lt;config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="urn:org:jgroups"
      xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"&gt;
  &lt;TCP bind_port="7600"
       recv_buf_size="${tcp.recv_buf_size:5M}"
       send_buf_size="${tcp.send_buf_size:5M}"
       max_bundle_size="64K"
       max_bundle_timeout="30"
       use_send_queues="true"
       sock_conn_timeout="300"
  
       timer_type="new3"
       timer.min_threads="4"
       timer.max_threads="10"
       timer.keep_alive_time="3000"
       timer.queue_max_size="500"
  
       thread_pool.enabled="true"
       thread_pool.min_threads="2"
       thread_pool.max_threads="8"
       thread_pool.keep_alive_time="5000"
       thread_pool.queue_enabled="true"
       thread_pool.queue_max_size="10000"
       thread_pool.rejection_policy="discard"
  
       oob_thread_pool.enabled="true"
       oob_thread_pool.min_threads="1"
       oob_thread_pool.max_threads="8"
       oob_thread_pool.keep_alive_time="5000"
       oob_thread_pool.queue_enabled="false"
       oob_thread_pool.queue_max_size="100"
       oob_thread_pool.rejection_policy="discard"/&gt;
  
  &lt;JDBC_PING connection_url="jdbc:mysql://${database.host:localhost}:3306/mydb"
             connection_username="root"
             connection_password="root"
             connection_driver="com.mysql.jdbc.Driver"
             initialize_sql="CREATE TABLE JGROUPSPING (
                      own_addr varchar(200) NOT NULL,
                      bind_addr varchar(200) NOT NULL,
                      created timestamp NOT NULL,
                      cluster_name varchar(200) NOT NULL,
                      ping_data varbinary(5000) DEFAULT NULL,
                      PRIMARY KEY (`own_addr`,`cluster_name`))"
     insert_single_sql="INSERT INTO JGROUPSPING (own_addr, bind_addr, created, cluster_name, ping_data) values (?,
     '${jgroups.bind_addr:127.0.0.1}',now(), ?, ?)"
     delete_single_sql="DELETE FROM JGROUPSPING WHERE own_addr=? AND cluster_name=?"
     select_all_pingdata_sql="SELECT ping_data FROM JGROUPSPING WHERE cluster_name=?"
  /&gt;
  
  &lt;MERGE3  min_interval="10000"
           max_interval="30000"/&gt;
  &lt;FD_SOCK/&gt;
  &lt;FD timeout="3000" max_tries="3" /&gt;
  &lt;VERIFY_SUSPECT timeout="1500"  /&gt;
  &lt;BARRIER /&gt;
  &lt;pbcast.NAKACK2 use_mcast_xmit="false"
                  discard_delivered_msgs="true"/&gt;
  &lt;UNICAST3 /&gt;
  &lt;pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                 max_bytes="4M"/&gt;
  &lt;pbcast.GMS print_local_addr="true" join_timeout="2000"
              view_bundling="true"/&gt;
  &lt;MFC max_credits="2M"
       min_threshold="0.4"/&gt;
  &lt;FRAG2 frag_size="60K"  /&gt;
  &lt;RSVP resend_interval="2000" timeout="10000"/&gt;
  &lt;pbcast.STATE_TRANSFER/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help is appreciated</p>