2 Replies Latest reply on Oct 31, 2012 2:54 AM by nami_30

    Clustered Singleton Services and Election Policy

    nami_30 Newbie

      Hi All,

       

      I am new to JBoss clustering. I want to know how to cluster singleton service (hasingleton) and election policy using jboss-5.0.0.GA

      I referred for the follwoing link : http://docs.jboss.org/jbossclustering/cluster_guide/5.1/html/deployment.chapt.html

       

      Accordingly , I created war file from my application and placed under deploy-hasingleton folder.

      And used the following command = ./run.sh -c node1 -g DefaultPartition -b ipAddress1 -Djboss.messaging.ServerPeerID=1 for node 1

      and ./run.sh -c node2 -g DefaultPartition -b ipAddress2 -Djboss.messaging.ServerPeerID=2 for node2.

       

      But what other configurations to be done and how to check for its working.

       

      Where i can find the details or steps for it.

       

      Looking forward for any suggestions/help

       

      Thanks in advance

        • 1. Re: Clustered Singleton Services and Election Policy
          Wolf-Dieter Fink Master

          If you use a configuration based on 'all' it will work out of the box, I hope this also true for 5.0.0.

          There might be a message in the logfile on the node where it is started, you might add something in your app to see that all requests going to one node.

          • 2. Re: Clustered Singleton Services and Election Policy
            nami_30 Newbie

            Can you please give the details of configurations required.

            Files and location in which modifications to be done

             

            With my current understanding, i have deployed fail-over and load balancing using modjk and apache server.

            Now for deployinh hasingleton, we just need to put war file under deploy-hasingleton in the location server/node1/

             

            But if i do only this, and if i check by accessing, both node 1 and node2 are used as seen from url of browsers.

             

            With my understanding , if hasingleton is deployed only one node should have been displayed??? either node1 or node2

             

            Also if i stop one node i get the follwoing error message in node console which stops:

            java.lang.RuntimeException: DistributedCacheManager is null.

                    at org.jboss.web.tomcat.service.session.ClusteredSession.establishDistributedCacheManager(ClusteredSession.java:1802)

                    at org.jboss.web.tomcat.service.session.ClusteredSession.setManager(ClusteredSession.java:506)

                    at org.jboss.web.tomcat.service.session.ClusteredSession.<init>(ClusteredSession.java:399)

                    at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.<init>(SessionBasedClusteredSession.java:56)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.createEmptyClusteredSession(JBossCacheManager.java:1410)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.loadSession(JBossCacheManager.java:1491)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.findSession(JBossCacheManager.java:462)

                    at org.apache.catalina.connector.Request.doGetSession(Request.java:2322)

                    at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2241)

                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:394)

                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)

                    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                    at java.lang.Thread.run(Thread.java:636)

            12:11:57,820 INFO  [HypersonicDatabase] Database standalone closed clean

            12:11:58,598 ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing

            java.lang.RuntimeException: DistributedCacheManager is null.

                    at org.jboss.web.tomcat.service.session.ClusteredSession.establishDistributedCacheManager(ClusteredSession.java:1802)

                    at org.jboss.web.tomcat.service.session.ClusteredSession.setManager(ClusteredSession.java:506)

                    at org.jboss.web.tomcat.service.session.ClusteredSession.<init>(ClusteredSession.java:399)

                    at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.<init>(SessionBasedClusteredSession.java:56)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.createEmptyClusteredSession(JBossCacheManager.java:1410)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.loadSession(JBossCacheManager.java:1491)

                    at org.jboss.web.tomcat.service.session.JBossCacheManager.findSession(JBossCacheManager.java:462)

                    at org.apache.catalina.connector.Request.doGetSession(Request.java:2322)

                    at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2241)

                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:394)

                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:436)

                    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                    at java.lang.Thread.run(Thread.java:636)

             

             

            And the follwoing error message in another node that is still running:(say if ABC.war is deployed on node 1 and node2)

            2012-10-31 12:12:11,451 ERROR [org.jboss.management.j2ee.WebModule] (AsynchKeyChangeHandler Thread) Could not create JSR-77 WebModule: ABC.war

            javax.management.InstanceAlreadyExistsException: jboss.management.local:j2eeType=WebModule,J2EEServer=Local,J2EEApplication=null,name=ABC.war already registered.

                at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)

                at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)

                at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

                at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

                at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)

                at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

                at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)

                at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

                at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

                at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)

                at java.security.AccessController.doPrivileged(Native Method)

                at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)

                at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)

                at org.jboss.management.j2ee.WebModule.create(WebModule.java:148)

                at org.jboss.management.j2ee.deployers.WebModuleJSR77Deployer.deployJsr77(WebModuleJSR77Deployer.java:50)

                at org.jboss.management.j2ee.deployers.WebModuleJSR77Deployer.deployJsr77(WebModuleJSR77Deployer.java:38)

                at org.jboss.management.j2ee.deployers.AbstractVFSJSR77Deployer.deployJsr77(AbstractVFSJSR77Deployer.java:46)

                at org.jboss.management.j2ee.deployers.AbstractJSR77Deployer.deploy(AbstractJSR77Deployer.java:173)

                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)

                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)

                at org.jboss.ha.singleton.HASingletonDeploymentScanner.deploySingletons(HASingletonDeploymentScanner.java:126)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.ha.singleton.HASingletonController.invokeSingletonMethod(HASingletonController.java:229)

                at org.jboss.ha.singleton.HASingletonController.startSingleton(HASingletonController.java:153)

                at org.jboss.ha.framework.server.HASingletonImpl.startNewMaster(HASingletonImpl.java:263)

                at org.jboss.ha.framework.server.HASingletonImpl.makeThisNodeMaster(HASingletonImpl.java:243)

                at org.jboss.ha.framework.server.HASingletonImpl.partitionTopologyChanged(HASingletonImpl.java:182)

                at org.jboss.ha.framework.server.HAServiceImpl.replicantsChanged(HAServiceImpl.java:295)

                at org.jboss.ha.framework.server.DistributedReplicantManagerImpl.notifyKeyListeners(DistributedReplicantManagerImpl.java:875)

                at org.jboss.ha.framework.server.DistributedReplicantManagerImpl.processEvent(DistributedReplicantManagerImpl.java:401)

                at org.jboss.ha.framework.server.AsynchEventHandler.run(AsynchEventHandler.java:108)

                at java.lang.Thread.run(Thread.java:662)