Java-EE cluster development deployment Combat

Source: Internet
Author: User

Java-EE cluster development deployment Combat

Overview

A cluster system is a group of loosely combined servers, forming a virtual server, providing a unified service for client users. For this client, it is generally not aware of which server the service is provided by the cluster system. Cluster systems should typically have special features such as high availability, scalability, load balancing, fault recovery, and maintainability. More and more critical tasks and large applications are running on the Java EE platform, where applications like banks require high availability (HA), and large systems such as large Web sites require better scalability. Java-ee cluster is the most common technology, used to provide high availability and scalability of fault-tolerant services, stand-alone deployment and multi-machine clustering deployment is very different, the information on the Internet is mostly vague, even if the document is illustrated, but also to the key to the deployment of success, in fact, to do some work after the line, And more than a single server to deploy multiple servers to simulate a clustered deployment, in fact, and the real multiple-machine deployment is still quite different. This article only takes the WebLogic application server as an example to illustrate the cluster deployment. Cluster Hierarchy Description

Web-level cluster is the most important and basic function of Java EE cluster. Web-tier clustering technology includes: Web load balancing and httpsession failure transfer. Web load balancing, basically placing a load balancer between the browser and the Web server.

Application-level cluster, EJB cluster, EJB is the core of Java application Platform, EJB is used to develop and deploy multi-layer architecture, distributed, object-oriented Application System Cross-platform component architecture. Primarily business applications, deployed on EJB containers.

A database-level cluster is an Oracle database that sets up multiple database instances, all mapped to a database. WebLogic Cluster Concept

Ødomain: A logical unit managed by the WebLogic server instance configured as Administrator server, which is a collection of all related resources.

Øserver: A relatively independent unit that is combined in order to achieve certain functions. It can be divided into domain server and managed server by function. A domain can contain one or more WebLogic server instances, or even a server cluster. There is one in domain and only one server functions as a Management server, and other servers specifically implement a specific logical function.

Ødomain server: In a cluster, there is and only one Domain server, the Management Server, which is responsible for managing multiple managed servers (managed servers), that is, domain server is only administrative collar Guidance, attendance and other activities, such as a managed sever state, is unknown (UnKnown), or run (run), or stop (shutdown), remote boot, etc., is not responsible for specific business. Therefore, do not deploy specific tasks on domain server at deployment time, after all, people are officials.

Ømanaged Server: Real doers, deploying specific applications. Application and business logic components are distributed across multiple managed servers (Managed server).

WebLogic Cluster Requirements

Ø all servers in the cluster must be in the same network segment and must be reachable by IP broadcast (UDP)

Ø all servers in the cluster must use the same version, including service packs

Ø servers in a cluster must use a permanent static IP address. Dynamic IP address assignment cannot be used in a clustered environment. If the server is behind a firewall and the client is outside the firewall, then the server must have a public static IP address in order for the client to access the server

Ø using the WebLogic support cluster of licence

Project Combat Project Overview

Our project is struts-ejb-hibernate-spring because both hibernate and spring must be initialized and the initialization depends on the servlet, initializing the data at system startup, And we are deployed to the web and EJB tiers as Web clusters and EJB clusters, and Hibernate and spring are deployed on the application server. To this end, we played two deployment packages, one is Cnlife.war, Cnlife_app.ear, where the Cnlife.war package is deployed on the Web cluster, Cnlife

_app.ear is deployed on the EJB cluster, Cnlife_app.ear includes two packages, one of which is Cnlifeejb.jar (EJB package),

The other is the initialization data that Backgroudinit.war,backgroudinit.war uses to initialize Spring,hibernate.

Cnlife.war (deployed in Web Server)

_backgroudinit.war

|

cnlife_app.ear-| (Deployed in Application Server)

|_cnlifeejb.jar

EJB is the stateless session bean, the purpose of using EJB is to apply the server cluster, the deployment diagram is as follows:

web-level clustering

using the memory replication policy in a Web cluster

Weblogic.xml is as follows

using Jndi to connect EJB clusters

The rules of writing are:

Managed server uses the same port number, "t3://acme1,acme2,acme3:7001"

Managed server uses different port numbers, "t3://node1:7001,node2:7002,node3:7003"

Weblogic Proxy

EJB-level clustering

Set cluster address

Set the cluster address, where the IP address is the address and port number of the managed server, and multiple managed servers are separated by ",".

Hibernate configuration File settings data source

Configure the Hibernate profile using the WebLogic Connection pool: (fragment) where Mypool is the jndi of the data source

<property name= "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.