J2EE Clustering 2
Cluster and error recovery services
Providing J2EE services on a Server is negligible compared to the entire cluster. Given the complexity of cluster technology, each Application Server has its own unique implementation. You should understand how they achieve clusters and Erity Bean, Stateless Session Bean, Stateful Session Bean, and JMS error Restore. Many vendors claim their support of cluster components, but they are often involved in components in the cluster. For example, BEA WebLogic Server 5.1 supports clustering Stateful session bean, but if the server itself collapsed, all the states are also lost. Customers have to recreate the Stateful Session Bean, making the original in the cluster. Us until the BEA WebLogic 6.0 released, Stateful session beans implemented memory Copy to cluster and error recovery.
All Application Servers supports EJB Clustering, but has a big difference in support for automatic error recovery that can be configured. Some Application Servers do not support automatic error recovery of EJB Client. For example, Sybase Enterprise Application Server supports Stateful session bean error Recovery, the premise is that you are from the database or by serializing the status of the Load Bean. As mentioned earlier, the BEA WebLogic 6.0 supports the status of the STATEFUL Session bean by memory replication. Most Application Server can run in the cluster. JMS, but Topics and Queues that are named by individuals do not provide load balancing and error recovery. This way you may need to purchase a clustered JMS product, such as SonicMQ, to get topics and queues load balancing.
Another important consideration, what we have to mention now is: httpsession error recovery.
HTTPSESSION error recovery
When you originally created a session, HttpSession error recovery allows users to seamlessly get session information from another server. Bea WebLogic Server implements SESSION information memory replication, and HP Bluestone Total-E-Server uses a centralized Session Server, it comes with HA's backup. Silverstream Application Server and Sybase Enterprise Application Server uses a centralized database or file system, and each Application Servers reads you from.
The main disadvantage of session persistence with database / file system is: when storage large or many objects are limited in Session. Users add an object to httpsession to httpsession, all objects in the session must be serialized and Write a database or shared file system. Most database implementation session persistence Application Server as possible to store Object as little as possible, but this limits the structure and design of the Web Application, especially when storing user data with HttpSession.
The memory-based session persistence writes the SESSION information in the memory to a backup server. There are two practices. The first one writes the httpsession information to a centralized status server. All machines in the cluster HttpSession Objects is written to this Server. Second method, each node in the cluster arbitrarily selects a node stores session information. Each user adds Object to httpsession, which is sequenced separately in writing there Backup Server.
In the above two methods, if the number of machines in the cluster is small, use a dedicated State Server than any specified backup server, which saves CPU to process Transaction and dynamic web pages.
On the other hand, when the number of machines of the cluster is large, special State Server is a bottleneck, and the consumption of any designated Backup Server replicate memory will grow as the number of machines increases. When the machine is added, use specialized State Server, you need to add more RAM and CPU. With any specified Backup Server, you only add the machine, and the session will be averaged between all machines. Based on memory-based persistence provides flexible Web application design, scale and high reliability. Now we will check a single order failed.
Single point failed
Cluster services that do not provide backup will cause a single point failure, they will cause the entire cluster or part of the application to crash. For example, WebLogic JMS can only have a Topic run on a machine in the cluster. If that machine happens to crash, then The application relying on the JMS Topics does not work until another WebLogic Instance starts (note that only durable message can be sent when the new Server Instance starts.)
Check if your cluster has a single point failure. If there is, you have to estimate whether you can meet the application needs.
The scalable topology is mentioned below.
Flexible telescopic topology
The cluster also requires a flexible topology layout. Most Application Server can also act as HTTP Server, see Figure 1.
Figure 1. Multiple topology
This structure is good when your Website is a dynamic web page. However, when most is a static page, it is very expensive to expand the price of the website because you have to add Application Server to a static HTML page request. So The appropriate approach is to extend the static part, increase the web server, to extend the dynamic part, increase the Application Server, as shown in Figure 2.
Figure 2. Separated topology
The main drawback of the above figure is: increasing the dynamic page request delay. But compared to flexible independent extensions, it is slightly.
Finally, the discussion of Application Server is terminated in maintenance.
Maintenance
A large number of machines in the cluster generally avoid maintenance issues: maintaining the cluster operation, notifying the application changes. Theapplication server should provide the Agent to realize the collapse of the main service, then restart them. Or activate Backup Server. Further, Application Server should provide a simple Method to update and synchronize all Server in the cluster.
Sybase Enterprise Application Server and HP Blure Total-E-Server provide files and configuration synchronization services. Sybase Enterprise Application Server provides these services on hosts, groups, and cluster levels. Bluestone only provides host Level. If you want deploy big Application or Many Application, it takes a long time. Bea WebLogic Server only provides configuration synchronization. In both, configuration synchronization plus Storage Area Network better, because you can write change to a logical storage medium, so All machines can receive changes in Application File. Each machine only needs to receive configuration changes from a centralized Configuration Server. SilversTream Application Server is loaded with Dynamic Class Loader from the database into Application Files and Configuration. Dynamic Class Loader makes it more convenient to receive the APPLICATION Server reception.
We have discussed an important feature that Application Server needs to consider. The following is a comparison of 4 popular Application Server according to our criterion.
Application Server Compare
Since we have learned the general knowledge about the cluster, let us focus on each Application Server, link the and the real world. We have to be:
HP Bluestone Total-E-Server 7.2.1
Sybase Enterprise Application Server 3.6
Silverstream Application Server 3.7Bea WebLogic Server 6.0
The discussion of each Application Server includes a HA structural diagram, followed by a summary of its important feature.
HP Bluestone Total-E-Server 7.2.1
Figure 3. HP Bluestone 7.2.1 topology
Cluster general characteristics Summary:
Bluestone implements a stand-alone JNDI Tree cluster. As a lbb running in Web Server as a PLUG-I, the LBB, which provides HTTP requests. LBB knows what Application is running on which UBS (Universal Business Server), you can Correctly oriented. Erp Years Erb Proxy Service and Proxy LBB supports EJB Proxy Service's main disadvantage is to increase the latency of each EJB request, and it runs with UBS On the same machine. EjB proxy service and UBS Stub support UBS crash, but does not support the error recovery of hardware crash. In the case of the latter, the error recovery is configured by the client to configure the APSERVER.TXT or Proxy LBB pair. APSERVER.TXT configuration. All components in the cluster are listed in the client's APSERVER.TXT. When new components are added, all customers need to update this file or manually updated by Handmade. in Proxy. In PROXY The LBB is configured to isolate the changes in the user and the cluster, but the new delay is introduced for the EJB. HP Bluestone is the only APPLICATION Server that provides clustering and load balancing JMS.
Cluster concentration time:
In relatively centralized and global shadring JNDI TREE, fewer words.
HTTPSESSION error recovery:
Centralized State Server and Backup State Server or database, memory replication.
Single point failed:
no
Flexible cluster topology:
Support all cluster topologies.
maintain:
Bluestone is better than other Server.Bluestone, which provides a dynamic application loader (Dynamic Application Launcher DAL), which is called when the application or machine crashes. DAL can restart the application on the host or backup machine. In addition, BluestOne is also available A configuration and publishing tool called Bluestone Application Manager (BAM), used to deploy Application Package and their related files. The only disadvantage of this tool is that only one machine can only be configured - it is inconvenient to large clusters.
Sybase Enterprise Application Server 3.6
Figure 4 Sybase Enterprise Application Server 3.6 topology
Cluster general characteristics Summary:
Enterprise Application Server implements a centralized JNDI Tree cluster, with a hardware load balancer to complete the load balancing and error recovery of HTTP requests. The two Name Servers in a cluster can handle HTTP Request alone, but for performance, it is best Still dedicated to JNDI Request.
Enterprise Application Server 3.6 No Web Server Plug-in, but in February 3.6.1 EBF (Error and Bug Fixes) version will be available. It supports the error recovery between STATEFUL, STATELESS SESSION bean and Entity Bean. Remember Enterprise Application Server provides any monitoring agent or a dynamic application loader, you need to purchase a third-party product for a single point or automatic Server, such as the Veritas Cluster Server.Enterprise Application Server does not support JMS.
Cluster concentration time:
The concentration time depends on the number of Name Server and the number of members Server. In three cluster implementations, the concentration of centralized JNDI Tree clusters is the worst. Although the concentration time indicator is important, Server can be object bind to NAME Server starts receiving a request (of course, it is best not to do this) .httpsession error Recovery:
HTTPSession error Recovery is implemented with a centralized database, and memory replication is not supported.
Single point failed
If you run multiple Name Server, there is no single point failed.
Flexible cluster topology:
The topology is limited to no Web Server Plug-in.
maintain:
Sybase uses files and configuration synchronization, which provides the best choice for Application Deployment. It can synchronize on Component, Package, Servlet, Application, and even Web Application Level. You can also choose to synchronize the entire cluster, a set of machines or individual hosts. Very good feature! But if there are too many machines in the cluster, synchronization will continue to have a long time. It is a weakness that is no dynamic application loading service, which means you have to purchase a third-party product, such as Veritas Cluster Server.
Silverstream Application Server 3.7
Figure 5. Silverstream Application Server
Dispatcher topology.
Figure 6. Silverstream Application Server
WSI topology
Cluster general characteristics Summary:
When setting the SilversTream cluster, there are two configurations: based on Dispatcher and web server integration-module (Web Server Integration-Module WSI). In Dispatcher-based clusters, users connect Dispatcher or hardware-based Dispatcher - such as Alteon 180E, then Dispatcher redirects HTTP to a machine of the masses. From that moment, users are physically bound. Therefore, there is no difference between a cluster and a server in this way. The main disadvantage is that the static part and the dynamic part cannot be expanded independently.
In a WSI-based cluster, the user first connects Dispatcher, the latter controls the Web Server's load balancing and HTTP request error recovery. Each web server has a Plug-in point to a load balancer in the cluster. WSI cluster is not used Direction, each HTTP request can be balanced on any machine. The sub-load balancer is used when the Application Server layer crashes. A WSI structure is superior to the Dispatcher structure: can expand the static and dynamic parts independently. However, the main shortcomings It is necessary for ArgopersistenceManager to make HTTPSession error recovery. In any way, users cannot get errors and recovery between methods. EjB error recovery is completely responsible. Finally, SilversTream does not support clustering JMS.
HTTPSESSION error recovery:
Silverstream provides HTTPSESSION error recovery with centralized databases and ArgopersistenceManager. Unfortunately, this solution has all rights issues. Do not use regular ways to store Session information into the database, and use a product's ArgopersistenceManager Class - a big shortage.
Cluster concentration time:
Relatively centralized and global shadring JNDI Tree cluster, least.
Single point failed:
The above structure is not.
Flexible cluster topology:
Support all cluster topologies.
maintain:
Cache Manager and Dynamic Class-Loader provide a convenient way for deploy and updated applications that do not disturb the current active client. When the application update on a Server in the cluster, the updated section is written to the database. Then the cache manager sets the cache on all machines to invalid, force them to re-acquire new Application. There is only one shortcoming, it is to take the time to remove the application from the database and transfer to memory.
BEA WebLogic Server 6.0
Figure 7. BEA WebLogic Server 6.0
Cluster general characteristics Summary:
WebLogic Server implements global sharing JNDI Tree clusters. In this way of work, when a Server starts, put your own JNDI
Tree is written to the global shared JNDI Tree. The Server uses this global Tree's backup to provide services, enabled all objects in the cluster. The user uses STUB to do the entire cluster, which means they request the original Server request However, there is also information about the restraint of other Application Server. It is because of this, Stub can transparently error recovery. A unique feature of Weblogic Server is the memory replication and configurable EJB Remote Objects automatically errors. Restore. WebLogic defines the clusterable as a service in the cluster. JMS is such a service, but each topic or queue is only running on a server, so it cannot load the balance and error recovery - a big disadvantage of WebLogic JMS implementation .
HTTPSESSION error recovery:
WebLogic Server enables httpsession error recovery by copying memory in any specified Backup Server or Database Server. The cluster is selected for each machine. If the primary server crashes, Backup Server becomes the primary server, and then re-re- Pick a Backup Server. WebLogic has a unique feature: Cookie's independence. Both HP Bluestone and Enterprise Application Server require cookies to perform HTTPSession error recovery, but WebLogic can use the information encrypted in the URL to direct the user to Backup Server. .
Single point failed:
JMS and Administration Server.
Flexible cluster topology:
Support all cluster topologies.
maintain:
WebLogic's weak lies in maintenance. Although BEA has taken positive measures in configuration synchronization, WebLogic Server still does not have any monitoring agents, dynamic application loaders, or file synchronization services. So you need to fail to purchase third-party programs for single points or HA purchase If you use SAN, you don't have to use the file synchronous service, but most developers have just begun to recognize the benefits of SAN.
analysis
Overall, BEA WebLogic Server 6.0 is most stronger, the cluster implementation is the most thorough. HP Blueestone Total-E- Server 2.7.1, Sybase Enterprise Application Server 3.6, Silverstream Application Server 3.7 is arranged in turn.
Choosing the right Application Server requires trade-off. If you have EJB Clients (Applet and Applications), Web Clients, Web Client, for the httpsession (for caching), requires extended and error recovery, you need Bea WebLogic 6.0. If you Application requires a lot of JMS, vast majority of clients, Bluestone may be better. From the cluster point of view, Sybase Enterprise Application Server 3.7 lacks important cluster features, such as JMS, HttpSession memory, web server plug-in Wait. However, Sybase Enterprise Application Server 3.7 does bring files and configuration synchronization services. If you use SAN, these are a bit negligible. The cluster of Silverstream Application Server is unpleasant, lack of clustering JMS, HttpSession memory replication And error recovery, etc.
in conclusion
In this article, you have gained a general understanding of the cluster, a cluster approach and important cluster service. We examine the advantages and disadvantages of each Application Server, discuss the characteristics related to the cluster. After these knowledge, you know how to build High reliability and scalability clusters. But this is just the beginning of learning, find some Evaluation Clustering License, and Application Server, verify. In the second part, we have to start writing code, verify the commitment of the Application Server supplier We will also use the J2EE Java PET Store routine to do load and cluster concentration testing.