infinispanwildfly-10jgroups

WildFly 10 Jgroups allways binding to localhost interface


Hi I'm trying to develop a clustered application that uses Infinispan for caching. First I tried to run in replicated mode by starting two instance of wildfly using the localhost as binding interface (with port offsets). This worked fine. But once I start the server using interface IP, cluster is not forming. Still I can access other services using the interface IP. I tried to telnet the Jgroups port using interface IP address and it failed. But telnetting to localhost works for Jgorups port.

(Then entered localhsot[port] IP's to initial host configuration element in tcpping. Then cluster formation worked.)

So my question is why does it bind to localhost even after starting wildfly using interface IP.

Here is my configuration. (I cant use UDP, therefore need to use tcpping for cluster formation)

Started the wilfly server using

standalone.bat -Djboss.server.base.dir=../standalone_isuru -c standalone-full-ha.xml -b 192.168.17.33 -Djboss.node.name=isuru -Djboss.socket.binding.port-offset=1

Jgourps configuration

<subsystem xmlns="urn:jboss:domain:jgroups:4.0">
<channels default="ee">
    <channel name="ee" stack="tcpping"/>
</channels>
<stacks>
    <stack name="udp">
        .
        .
    </stack>
    <stack name="tcp">
        .
        .
    </stack>
    <stack name="tcpping">
        <transport type="TCP" socket-binding="jgroups-tcp"/>
        <protocol type="TCPPING">
            <property name="initial_hosts">
                192.168.17.33[7601], 192.168.14.39[7700], 192.168.17.33[7800]
            </property>
            <property name="num_initial_members">
                2
            </property>
            <property name="port_range">
                5
            </property>
            <property name="timeout">
                1000
            </property>
        </protocol>
        <protocol type="MERGE3"/>
        <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
        <protocol type="FD"/>
        <protocol type="VERIFY_SUSPECT"/>
        <protocol type="pbcast.NAKACK2"/>
        <protocol type="UNICAST3"/>
        <protocol type="pbcast.STABLE"/>
        <protocol type="pbcast.GMS"/>
        <protocol type="MFC"/>
        <protocol type="FRAG2"/>
    </stack>
</stacks>

Infinispan cache config

<cache-container name="replicated_cache" default-cache="default" module="org.wildfly.clustering.server" jndi-name="infinispan/replicated_cache">
    <transport lock-timeout="60000"/>
    <replicated-cache name="customer" jndi-name="infinispan/replicated_cache/customer" mode="SYNC">
        <transaction locking="OPTIMISTIC" mode="FULL_XA"/>
        <eviction strategy="NONE"/>
    </replicated-cache>
</cache-container>

Solution

  • I posted the same question in Jboss developer since I didn't get any answer here. And this is the answer I got from there.

    By default Jgroups bind to private interface. When starting the server this IP can be provided as well.

    standalone.bat -b 192.168.17.39  -bprivate=192.168.17.39
    

    You can refer to the interfaces section for interface configuration.

    <interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
        <interface name="private">
            <inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
        </interface>
        <interface name="unsecure">
            <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
        </interface>
    </interfaces>
    

    socket bindings, binds jgroups to private interface

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        .
        <socket-binding name="jgroups-tcp" interface="private" port="7600"/>
        .
    </socket-binding-group>
    

    Jgroups subsystem

    <stack name="tcpping">
      <transport type="TCP" socket-binding="jgroups-tcp"/>
      .
    </stack>