Slashdot Mirror


Building a Stable and Clustered J2EE Environment?

royles asks: "I am working with several J2EE Application Servers and all seems fine until I start to scale and cluster. The goal is to ensure a web and EJB session is maintained across a pool of Application Servers. The level of complexity to achieve this straightforward requirement is proving too much. It quickly becomes evident that vendors claims of 'robust and scalable' go straight out the window in favour of extortionate support and consultant costs when the installation becomes large. Anybody else experienced this type of problem? What are other peoples experienceâ(TM)s in this area? Any recommendations on Application servers that âdo what they say on the tinâ(TM)? Any good online resources for achieving a highly scaled and robust solution?"

9 of 43 comments (clear)

  1. WebObjects by Anonymous Coward · · Score: 1, Informative
    WebObjects is inexpensive, stable and scalable plus it runs on pretty much any J2EE server environment:

    Develop apps quickly

    Provides a powerful integrated development environment

    Allows you to create web services or three-tier Java server apps

    Generates code-free prototypes in minutes

    Build services dynamically

    Allows you to create or use web services based on SOAP, XML and WSDL

    Includes tools for code-free generation, configuration, and testing of web services from existing database assets

    Integrates easily with services written in Java, AppleScript, Perl and .Net

    Access data automatically

    Reverse-engineers your database, modeling all tables, columns and relationships

    Generates Java objects from JDBC and JNDI data sources, transparently handling data persistence

    Offers database independence and simultaneous access to multiple databases

    Generate pages seamlessly

    Generates HTML, XML and SMIL from reusable templates

    Builds data-driven web pages from visual development tools

    Streamlines delivery of multi-lingual content

    Deploy painlessly

    Deploys to virtually any J2EE server or the WebObjects J2SE application server

    Provides easy scalability with built-in clustering support and low-cost licensing

    Supports Servlet/JSP, EJB, RMI-IIOP and JTA/JTS (J2EE technologies)

  2. JBoss does this now by GOD_ALMIGHTY · · Score: 4, Informative

    First of all, do not store data on the application server. Secondly, make sure that all of your objects associated with a session in either the EJB layer or the HTTP session implement Serializable.

    I'd recommend running JBoss + Tomcat on Linux with Apache frontending it with mod_jk2. Put all your static web content on Apache to free up Tomcat. The easiest way to do this is to use a load-balancing solution in front. Have it pass the sessions through to the Apache server which will offload any JSP/Servlet requests to Tomcat. Have the JBoss/Tomcat installation on each node of the cluster clustered using JBoss' JavaGroups based clustering. You can also use the JBoss Farm service to deploy the EAR file to one node in the cluster then have the other nodes pick it up from there.

    If you use a seperate set of machines for the database cluster than the JBoss/Tomcat nodes can be set up as copies of each other with no data on board. Using Linux boxes, this is easy (dd the drives). If a node goes down for some reason, swap it with a spare. Any session info is already serialized and passed to the other nodes in the cluster, and the load-balancer w/ failover should handle the client end of that.

    By the way this thing scales to at least 100 boxes from the stories I've heard. I've done it my self in small (5 box) installations. I've also used F5 equip for the load balancer/failover on the front. Everything worked well.

    Buy the JBoss docs to help with the clustering. I've also got some docs I wrote on setting up JBoss clustering somewhere around here.

    You'll be suprised how simple clustering is with JBoss once you understand a bit how JBoss works and is configured. You will also be amazed at how well it works.

    The best part of course is that it's all Open Source, so no license fees. Hell, I'll set it up for you for 30% of the licenses and support you would have bought if you want. ;-)

    --
    Arrogance is Confidence which lacks integrity. -- me
    1. Re:JBoss does this now by oz_ko · · Score: 3, Informative
      You really should read the Jboss clustering doco. Then read them another 2 times.

      It took about 1 week for us to set up our cluster with hot deploy and session replication working properly, though I think the next time round it would be a lot quicker.

      I don't think there are really any big issues in setting up a cluster though to set up a _good_ app server cluster you need to understand how the clustering implementation of your app server works and decide what is best for your solution.

      Unfortunately there are no magical "click here to cluster" buttons.

  3. check out Resin by ubiquitin · · Score: 3, Informative

    Caucho's resin application clusters are a great way to get load balacing and distributed sessions into your appserver farm. Cost is around $1k per server, so real enterprise jocks will laugh at it, but unlike some of the "three engineers per server" solutions, it really works without having to spend all your time troubleshooting and hand-coding things.

    --
    http://tinyurl.com/4ny52
  4. one tip by Anonymous Coward · · Score: 2, Informative
    with clustering is to do setup pairs. sharing session cross three or more servers is tricky to configure and setup. It requires a lot of experience and care. It works best in pairs and you have to know what your doing. It's best to play with a stagging environment and do some serious load testing to see first hand how misconfiguration can create cascading problems. On one project, we had a BEA consultant come in to configure the clustering. It took him a week to do it and he had prior experience setting up Weblogic 5 in a clustered mode.

    Also be care to only cluster stateful EJB. with stateless stuff, it's better to no cluster and simply load balance it.

  5. I have heard great thing about these people by Plague_nz · · Score: 1, Informative

    www.opencloud.co.nz

    They create a SDK for creating appilcations that run over multiple systems and is extremly fault tolerant.

  6. Check out this article by Bill Burke by jawahar · · Score: 4, Informative
    Chief architect of JbossGroup

    http://www.onjava.com/lpt/a/1517

  7. Re:Aren't these goals the rationale for EJB? by hargettp · · Score: 2, Informative

    Yes, the EJB design pattern helps with clustering by abstracting out many bits of code that make clustering hard (e.g, direct database access); your code simply trusts the app server to manage those bits for you. However, EJB support in an application server of and by itself does not constitute clustering. That's an extra, layered feature that a good app server supports...and JBoss is definitely one of the good ones.

  8. Re:Clustering is hard, you can't avoid it by mlq · · Score: 2, Informative

    Yep, you've hit upon the clincher.

    How does the session know to replicate an object that's changing? For example, if during a request/response a mutator method is called on that object?

    This is the problem. The session doesn't know, in this situation.

    The only time a (key, object) pair in a session gets replicated is if Session.set...() has been called for that pair during this request/response cycle.

    If you call a mutator on an object (where that object has been pulled out of the session), then that mutated copy of the object WILL NOT be replicated unless you call Session.set...() again!

    This is something that can really kill you when you try to deploy an app that works well in a non-clustered environment into a cluster.