7 Replies Latest reply on Aug 9, 2011 3:01 AM by maku01

    Restrict replication to 1 computer

    maku01

      Hi,

       

      I'm new with Infininspan and have a question regarding replication.

       

      I've a cache with CacheMode.REPL_ASYNC. But I want to restrict the replication to 1 machine (where several JVM's run -> only the JVM's on this machine should be included in the replication mechanism.)

       

      Can anybody of you give me a hint what I've to do? (best would be programmatically config).

       

      TIA

       

      Martin

        • 1. Re: Restrict replication to 1 computer
          sannegrinovero

          Not sure I understood. How many machines do you have?

           

          If you have many and want them all to replicate to a single other node, how are you going to solve conflicts on the same keys?

           

          If that doesn't matter, you could configure all caches to be "LOCAL" as cluster mode, and configure a Remote CacheLoader which writes to the single node.

          • 2. Re: Restrict replication to 1 computer
            ckulenk

            As I understand you, you want some kind of asymmetric cluster where each key only replicates to nodes/JVMs that reside on the same physical machine. Asymmetric clusters are not supported (yet).

            Maybe you can use a unique clusterName for all JVMs that should back this special cache up and reside on the same machine (e.g. ip address as clusterName). Maybe you can use FILE_PING for node discovery. To access the cache from other physical machines you can use a client API.

            Another approach might be implementing a custom ConsistentHash that replicates to all addresses that contain some special topology information.

            • 3. Re: Restrict replication to 1 computer
              maku01

              HI,

               

              @Sanne

              I have ony 1 machine with several JVM's. No ohther pyhsical machine should involved in the replication process.

               

              @Christian

              yes, it would be a possible solution to use a unique cache name for the JVM's on the 1 machine. It is NOT necessary that the cache is accesible by other machines.

               

              I thought it would be useful to "configure" this kind of requirement to save resources... (my assumption was that it is much more effective when the replication mechanism is aware that replication is only needed for 1 machine).

               

              But it seems this kind of requirement is not invented, right??

               

              TIA

               

              Martin

              • 4. Re: Restrict replication to 1 computer
                ckulenk

                Just out of curiosity, why do you want to replicate on the same machine?

                • 5. Re: Restrict replication to 1 computer
                  maku01

                  The main part of the app uses a old 32 bit windows dll (calculation engine). So I have to use a 32 bit java vm. To make use of the machines resources (RAM) the plan is to run several instances of the same app. With this approach it is also possible to turn of instances of the app for maintenance (a load balancer handles the usage of the app instances)

                  • 6. Re: Restrict replication to 1 computer
                    sannegrinovero

                    ah, now I understand.

                    You don't have to do much special, you can start any number of instances on the same machine, just make sure that JGroups is configured to use the localhost/loopback network interface so you avoid sending packets out to the real network.

                     

                    These JVM properties should do the trick if you have a fairly standard JGroups configuration (but it depends from the configuration), so if you didn't change it much you could try them first:

                     

                    -Dbind.address=127.0.0.1 -Djava.net.preferIPv4Stack=true

                     

                    now just start some instances, they should form a cluster and you're all set.

                    • 7. Re: Restrict replication to 1 computer
                      maku01

                      @Sanne

                       

                      thanks, this is exactly what I want. Now replication occurs only on 1 machine.

                       

                      Best regards,

                      Martin