2 Replies Latest reply on Jun 24, 2009 10:11 AM by pferraro

    Clustering of the Seam-booking example

    steppi

      Hey Guys,
      Currently I'm writing a work for school about the JBoss AS and HA-Clustering.

      I'm working with 2 Ubuntu VMs and everything is perfect up to this point.
      Jboss is Version 5.1.0.GA.
      Moreover I use the Seam Framework booking-example.
      I started everything with the all-Config and Farming works perfect.
      My problem now is to got to the booking application without choosing a server from client-side. How I can access both servers with one IP? How can I create redundancy if one node fails?
      For now, if I create a user or a booking on server1, there is no change on server2?

      HELP... the clustering guide doesn't help me, seems like it isn't really up to date :(

      Better german Version of my text :


      zitieren
      Beitrag Verfasst: 15. Juni 2009 15:22

      Hi Leute,... ich schreibe zur Zeit an ner Facharbeit über den JBoss AS und Hochverfügbarkeitskonzepte. Hab den Server auch am laufen und das Clustering funktioniert halbwegs. Soll heißen, ich habe 2 Ubuntu-VMs laufen, auf beiden ist der JBoss AS 5.1.0 GA mit der Standard "all"-Config (Node-IDs sind einizigartig bei beiden Servern).

      Das Farming z.B. funktioniert erstklassig. Ich kann auch beide Server ansprechen über einen Client und die darauf laufenden Applikationen. Aus dem Seam Framework habe ich jetzt das Booking-Example genommen (wurde auf einem installiert, auf den anderem repliziert und läuft auf beiden).

      Zu meinem Problem... ich kann beide Server jeweils über ihre IP ansprechen, wie bekomm ich das hin, dass die über eine Virtuelle IP laufen und damit quasi beide angesprochen werden (entweder mit verteilter Last od. als primär und sekundär Server) ?? Wenn ich auf Server1 in der Applikation z.Z. einen Nutzer anlege wird die Datenbank mit Server2 nicht synchronisiert. D.h. momentan sind beide Server doch noch irgendwie Standalone unterwegs.

      Danke schonmal...

      P.S. wenns hier falsch ist bitte verschieben. Wenn jemand ne gute deutsche JBoss-Community-Seite kennt immer her damit

      DANKE

        • 1. Re: Clustering of the Seam-booking example
          steppi

          So I got something new.

          I read in the seam-clustering tutorial about changing the code of the example a little bit.
          Everythink works perfect up to the point I log into the application. Following Error occur:

          11:43:37,804 WARN [/seam-booking] Failed to replicate session 0pskpPW-ReEg3gLA7JF6PA__
          org.jboss.seam.security.NotLoggedInException
          at org.jboss.seam.security.Identity.checkRestriction(Identity.java:217)
          at org.jboss.seam.security.SecurityInterceptor$Restriction.check(SecurityInterceptor.java:113)
          at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:159)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
          at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
          at org.javassist.tmp.java.lang.Object_$$_javassist_4.hashCode(Object_$$_javassist_4.java)
          at java.util.HashMap$Entry.hashCode(HashMap.java:737)
          at java.util.AbstractMap.hashCode(AbstractMap.java:494)
          at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.(SimpleCachableMarshalledValue.java:74)
          at org.jboss.ha.framework.server.SimpleCachableMarshalledValue.(SimpleCachableMarshalledValue.java:80)
          at org.jboss.web.tomcat.service.session.distributedcache.spi.SessionSerializationFactory.createMarshalledValue(SessionSerializationFactory.java:74)
          at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.getMarshalledValue(AbstractJBossCacheService.java:635)
          at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.SessionBasedJBossCacheService.storeSessionAttributes(SessionBasedJBossCacheService.java:124)
          at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.SessionBasedJBossCacheService.storeSessionAttributes(SessionBasedJBossCacheService.java:37)
          at org.jboss.web.tomcat.service.session.distributedcache.impl.jbc.AbstractJBossCacheService.storeSessionData(AbstractJBossCacheService.java:403)
          at org.jboss.web.tomcat.service.session.ClusteredSession.processSessionReplication(ClusteredSession.java:1166)
          at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1937)
          at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:309)
          at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:51)
          at org.jboss.web.tomcat.service.session.ClusteredSessionValve.handleRequest(ClusteredSessionValve.java:147)
          at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:94)
          at org.jboss.web.tomcat.service.session.LockingValve.invoke(LockingValve.java:62)
          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.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:636)


          • 2. Re: Clustering of the Seam-booking example
            pferraro

            I was not able to reproduce this error myself. The session created after login is successfully replicated to the other node. May I ask the full extent of the changes you made to the booking example to enable clustering?

            Regarding accessing both servers via a single IP, you'll need another server to act as a load balancer (e.g. Apache HTTP server w/ mod_proxy+mod_cluster, or mod_proxy+mod_proxy_balancer, or mod_jk). The client will access the IP/port of the load balancer which in turn directs the request to one of the servers. More info here:
            http://httpd.apache.org/docs/2.2/
            http://www.jboss.org/mod_cluster
            http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
            http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html
            http://tomcat.apache.org/connectors-doc/index.html

            Regarding creating redundancy if one node fails, this is achieved through proper replication of all of the stateful elements of your application. You've already enabled session replication, by adding to web.xml. You will also want to replicate any stateful session beans, by adding the @Clustered annotation to the bean classes. If any of your entity beans use hibernate's 2nd-level cache, you'll need to configure hibernate to use a distributed 2nd-level cache, as described here:
            http://www.jboss.org/community/docs/DOC-13200