4 Replies Latest reply on Aug 6, 2010 4:39 AM by galder.zamarreno

    Using JBoss Cache Across Clusters

    servosimpson

      Using JBoss AS 4.2.3 and JBoss Cache 1.4.1

       

      I have 4 servers.  3 are clustered together to host a web application.  The 4th is a dedicated EJB to process batch requests from the three other servers.  I need the 4th server to be able to access the cache that is used/modified by the web app on the other servers.

       

      The admin is telling me that if he adds the 4th server to the cluster, then the EJB will be put on the other 3 machines and the web app will be put on the EJB server.  I don't want this.  I've been trying to find a way for the EJB to access the cache without having to join the cluster.  I've creating a second cluster to host the EJB and tweaked the replSync-service.xml on both so that they are the same, but I can't get them to share the cache.

       

      I've tried to find doc on this, but have been unable to do so.

       

      So my two questions are: Can the cache replicate across clusters?  If not, can the cluster be configured so that 3 nodes have only the web app and the 4th node has only the EJB.

       

      Thanks in advance.

        • 1. Re: Using JBoss Cache Across Clusters
          galder.zamarreno

          The EJB would be deployed in the other 3 servers if the deployment is located in farm/ directory, otherwise unless you manually copied to the other 3 server's deploy directory, it wouldn't be there. I don't see a need for a 2nd cluster. More info on Farm deployment can be found in  http://www.jboss.org/community/docs/DOC-10380

           

          If you need the 4th server to access the cache, you need to deploy the cache descriptor and any cache client code in the 4th server.

          • 2. Re: Using JBoss Cache Across Clusters
            b_nannuri

            Hi Galder,

             

            I have a related question about JBOSS cache clustering.

            We have a situation where we have 4 nodes in PROD environment running JBOSS AS 4.2.3 , but they are not clustered. And we are planning to introduce JBOSS cache which needs to be replicated across all 4 nodes. So, does JBOSS cache needs the JBOSS AS to be clustered in-order to replicate?.

             

            Based on the documentation, JBOSS AS doesn't have to be clustered as JBOSS cache can run on any app server and stnadalone as well. To prove the same, I have installed JBOSS cache as a stand alone on 2 nodes in the same LAN and tried to run the tutorial with total replication. Appearantly they don't see each other, and hence the replication is not happening. Attached is the cache configuration I have used which is packaged  as part of JBOSS Cache 3.2.5.

             

            Another interesting thing I found is Jgroups probe identifies both the nodes as they share the same group name "JBossCache-Cluster".

             

            As this is key to our decision on which cache product we will use, Any help is highly appreciated.

             

            Thanks,

            Bala.

            • 3. Re: Using JBoss Cache Across Clusters
              b_nannuri

              Just an update, I could solve the problem by adding bind_addr to the Jgroups UDP configuration. Earlier it was trying to braodcast messages using non-NIC ip (127.0.0.1) , so they are not getting broadcasted.

               

              Hope this helps someone.

               

              Cheers/Bala.

              • 4. Re: Using JBoss Cache Across Clusters
                galder.zamarreno

                Balakrishna Nannuri wrote:

                ...

                I have a related question about JBOSS cache clustering.

                We have a situation where we have 4 nodes in PROD environment running JBOSS AS 4.2.3 , but they are not clustered. And we are planning to introduce JBOSS cache which needs to be replicated across all 4 nodes. So, does JBOSS cache needs the JBOSS AS to be clustered in-order to replicate?.

                ...

                Thanks,

                Bala.

                No, it does not need AS to be clustered.