1 Reply Latest reply on Feb 13, 2017 1:52 AM by Sebastian Łaskawiec

    Cache replication between 2 nodes (infinispan) using standalone mode

    Mahendiran Thangavel Newbie

      HI all,

       

      I have created 2 nodes in same network and tried to access cache information but its not replicating each others. please find below information.

       

      Wildfly 8.2.0

       

      in Standalone-full-ha.xml

      <cache-container name="trustcache" default-cache="usercache" jndi-name="java:jboss/infinispan/test" aliases="test">

                      <transport stack="tcp" lock-timeout="600000"/>

                      <replicated-cache name="test" start="EAGER" batching="true" mode="ASYNC">

                          <locking isolation="READ_COMMITTED"/>

                          <transaction locking="OPTIMISTIC"/>

                      </replicated-cache>

                      <replicated-cache name="usercache" start="EAGER" batching="true" mode="ASYNC">

                          <locking isolation="READ_COMMITTED"/>

                          <transaction locking="OPTIMISTIC"/>

                          <eviction strategy="LRU" max-entries="10000"/>

                          <expiration max-idle="1900000" lifespan="-1"/>

                      </replicated-cache>

       

      Jgroups

       

      <subsystem xmlns="urn:jboss:domain:jgroups:2.0" default-stack="tcp">

                  <stack name="tcp">

                      <transport type="TCP" socket-binding="jgroups-tcp"/>

                      <protocol type="TCPPING">

                          <property name="initial_hosts">

                              192.168.18.21[7600],192.168.18.111[7600]

                          </property>

                          <property name="num_initial_members">

                              2

                          </property>

                          <property name="port_range">

                              10

                          </property>

                          <property name="timeout">

                              2000

                          </property>

                      </protocol>

                      <protocol type="MERGE2"/>

                      <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"/>

                      <protocol type="RSVP"/>

                  </stack>

       

        <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:232.0.0.4}" multicast-port="45700"/>

              <socket-binding name="jgroups-tcp" port="7600"/>

              <socket-binding name="jgroups-tcp-fd" port="57600"/>.

       

       

       

      Node1: standalone.bat -b 192.168.18.21 -c standalone-full-ha.xml -u 234.0.0.4 -Djboss.node.name=node1

      Node2: standalone.bat -b 192.168.18.111 -c standalone-full-ha.xml -u 234.0.0.4 -Djboss.node.name=node2

       

      the user cache is not even replicating between 2 nodes .

      Ports are accessible between each nodes since both are in same local network.

       

      Server Log:

      2017-02-11 15:48:27,020 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ServerService Thread Pool -- 61) ISPN000078: Starting JGroups Channel

      2017-02-11 15:48:27,048 INFO  [stdout] (ServerService Thread Pool -- 61)

      2017-02-11 15:48:27,048 INFO  [stdout] (ServerService Thread Pool -- 61) -------------------------------------------------------------------

      2017-02-11 15:48:27,049 INFO  [stdout] (ServerService Thread Pool -- 61) GMS: address=solverlaptop384/trustcache, cluster=trustcache, physical address=192.168.18.21:7600

      2017-02-11 15:48:27,049 INFO  [stdout] (ServerService Thread Pool -- 61) -------------------------------------------------------------------

       

       

      2017-02-11 15:48:29,285 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ServerService Thread Pool -- 61) ISPN000094: Received new cluster view: [solverlaptop384/trustcache|0] (1) [solverlaptop384/trustcache]

      2017-02-11 15:48:29,443 INFO  [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (ServerService Thread Pool -- 61) ISPN000079: Cache local address is solverlaptop384/trustcache, physical addresses are [192.168.18.21:7600]

       

       

       

       

      Please suggest me a solution on above case.

        • 1. Re: Cache replication between 2 nodes (infinispan) using standalone mode
          Sebastian Łaskawiec Apprentice

          The main problem is that JGroups does not form a cluster (see this long line: Received new cluster view: [solverlaptop384/trustcache|0] (1) [solverlaptop384/trustcache], there's only one node there).

           

          I would recommend looking into Infinispan Server Guide and following configuration suggestions there. Your configuration should result in something similar to this:

           

          <stack name="tcp">

              <transport type="TCP" socket-binding="jgroups-tcp"/>

              <protocol type="TCPPING">

                  <property name="initial_hosts">192.168.18.111[7800],92.168.18.21[7800]</property>

              </protocol>

              <protocol type="MERGE3"/>

              <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>

              <protocol type="FD_ALL"/>

              <protocol type="VERIFY_SUSPECT"/>

              <protocol type="pbcast.NAKACK2">

                  <property name="use_mcast_xmit">false</property>

              </protocol>

              <protocol type="UNICAST3"/>

              <protocol type="pbcast.STABLE"/>

              <protocol type="pbcast.GMS"/>

              <protocol type="MFC"/>

              <protocol type="FRAG2"/>

          </stack>

           

          If that doesn't work, please check if the servers can ping each other and if the ports are available (e.g. using telnet command).