4 Replies Latest reply on Jan 8, 2015 3:07 PM by Yu Feng

    Need some example

    Yu Feng Newbie

      Hi, I am wondering if there is some (complete) example on Distributed Execution Framework. We are using WildFly 8.2, so it is based on Infinispan 6.0.2. I would like to distribute some work across servers on the cluster by using Infinispan. Each task will read some parameters, so each server in the cluster will read different parameters . The PiAppx example from User Guide is not reading parameters. Thanks for help!

        • 1. Re: Need some example
          Tristan Tarrant Master

          I have thrown together a quick example @ tristantarrant/infinispan-playground-distexec · GitHub

          Basically it uses a "parameter" cache keyed by Address to pass a Map<String, ?> of parameters to each node.

          • 2. Re: Need some example
            Yu Feng Newbie

            What a gift! Thank you Tristan!

             

            I will learn it today and let you know how it goes.

             

            Have a good day!

            • 3. Re: Need some example
              Yu Feng Newbie

              I have tried integrating the example into WildFly server and tested with cluster setup: Apache proxy with two servers running in standalone-full-ha mode. I invoked a web service call to trigger the execution made in ParametrizedDistExec code. Let's say server A and B and when I call the web service call, Apache directs call to server A or B.

               

              Two issues that bother me a lot:

              1. When the web service is invoked (assume server A is called), JGroup can see two nodes in the cluster, while DefaultCacheManager.getClusterSize() only returns 1. If I keep hit the web service call several times, then server B in the cluster gets called and then DefaultCacheManager.getClusterSize() becomes 2. Server B is slave and will not do anything. If the web service call hits server A again, then example works since server A is the coordinator.  My question is that is there anyway for DefaultCacheManager to know server A and B before both servers have to be hit by web service?

               

              2. When server A is first invoked, it becomes coordinator in the cache manager. So when B is invoked, it is slave and will not do anything. I would like any server in the cluster can behave like coordinator, how could we do that?

               

              Thank you!

              • 4. Re: Need some example
                Yu Feng Newbie

                Seems #2 can be resolved now if I use EmbeddedCacheManager instead of creating a cache manager myself. Don't know why ...

                 

                #1 remains and any help is appreciated!

                 

                Thanks!