3 Replies Latest reply on Mar 17, 2017 7:06 PM by Scott Reisdorf

    Modeshape 5 Cluster Configuration (not Wildfly)

    Scott Reisdorf Newbie

      Is there any sample configuration that shows how to setup a cluster where 2 separate JVM instances are configured using a clustered Modeshape?

      I am using Modeshape 5..2-Final without Wildfly.

       

      I am unable to get the 2 instances to work correctly in clustered mode.

      I setup the jgroups-config.xml and the modeshape JSON configuration and each instance starts up and says its in  a cluster:

       

      -------------------------------------------------------------------

      GMS: address=ip-172-xx-x-xxx-xxxx, cluster=cluster1, physical address=172.xx.x.xxx:7800

      ------------------------------------------------------------------

       

      The problem I am seeing is if I login to one instance and make a change to modeshape (i.e. add a node) the second instance doesn't see that change.  The only why I can get the other instance to see the change is if that instance adds a new node in the system upon which then its able to query and see the updates from the other instance.

      Any help is appreciated.

       

      I have tried a number of jgroup configurations.  Here is a sample of one attempt that doesnt seem to work:

      Host A and Host B have this jgroup configuration with their respective IP address in the <HOST_A/B_IP> :

      jgroups-config.xml

       

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

            <TCP bind_port="7800"

               recv_buf_size="${tcp.recv_buf_size:5M}"

               send_buf_size="${tcp.send_buf_size:5M}"

               max_bundle_size="64K"

               max_bundle_timeout="30"

               sock_conn_timeout="3000"

               timer_type="new3"

               timer.min_threads="4"

               timer.max_threads="10"

               timer.keep_alive_time="3000"

               timer.queue_max_size="500"

               thread_pool.enabled="false"

               oob_thread_pool.enabled="false"/>

      <TCPPING initial_hosts="<HOST_A_IP>[7800],<HOST_B_IP>[7800]}"         

      port_range="0" num_initial_members="2" />

          <MPING/>

          <MERGE3 min_interval="10000"

                  max_interval="30000"/>

          <FD timeout="3000" max_tries="3" />

          <VERIFY_SUSPECT timeout="1500" />

          <BARRIER />

          <pbcast.NAKACK2 use_mcast_xmit="false"

                          discard_delivered_msgs="true"/>

          <UNICAST3 />

          <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"

                         max_bytes="4M"/>

          <pbcast.GMS join_timeout="3000" view_bundling="true"/>

          <MFC max_credits="2M"

               min_threshold="0.4"/>

          <FRAG2 frag_size="60K" />

          <pbcast.STATE_TRANSFER/>

      </config>

       

      modeshape-config.json

      "clustering" :  {

              "clusterName" : "cluster1",

              "configuration" : "jgroups-config.xml",

              "locking" : "db"

          },

       

       

      Again Any help is appreciated.

       

      Thanks.

       

      -Scott

        • 1. Re: Modeshape 5 Cluster Configuration (not Wildfly)
          Horia Chiorean Master

          The first thing (which is unrelated to your issue) is always make sure you're using the latest major version - in this case 5.3.0.Final.

           

          The clustering section of your configuration looks fine, assuming jgroups-config.xml is available in the root of your classpath.

          If it is, the next step is to enable DEBUG logging for org.modeshape.jcr.clustering.ClusteringService and if the repositories are clustered correctly you should see messages like:

          DEBUG ClusteringService[cluster_name='Test cluster', address=HORIA-LPT-2-53299]: new cluster member joined: [HORIA-LPT-2-53299|1] (2) [HORIA-LPT-2-53299, HORIA-LPT-2-25940], total count: 2
          

           

          If the cluster members don't see each other, you'll have to enable DEBUG and/or TRACE logging for org.jgroups and investigate that. Your JGroups configuration looks fine to me, but I'm no JGroups expert and depending on your local network there may be other issues.

          • 2. Re: Modeshape 5 Cluster Configuration (not Wildfly)
            Scott Reisdorf Newbie

            Thanks for the quick reply.

            I added that log message and it shows that for each instance only 1 is found:

             

            -------------------------------------------------------------------

            GMS: address=ip-172-31-2-220-19677, cluster=kylo-cluster, physical address=172.31.2.220:7800

            -------------------------------------------------------------------

            2017-03-17 13:47:49 DEBUG localhost-startStop-1:ClusteringService:102 - ClusteringService[cluster_name='kylo-cluster', address=ip-172-31-2-220-19677]: new cluster member joined: [ip-172-31-2-220-19677|0] (1) [ip-172-31-2-220-19677], total count: 1

            2017-03-17 13:47:49 DEBUG localhost-startStop-1:ClusteringService:102 - ClusteringService[cluster_name='kylo-cluster', address=ip-172-31-2-220-19677]: there is only one member in cluster; changes will be propagated only locally

             

            I enabled the DEBUG for org.jgroups but nothing shows up in the logs.

            • 3. Re: Modeshape 5 Cluster Configuration (not Wildfly)
              Scott Reisdorf Newbie

              I found my problem.  I am running in AWS so I needed to change it from TCPPING to a different method.

              I got things working using the S3_PING option.

               

              Thanks again for your help