OC4J cluster

zhaozj2021-02-16  86

Step 1: Install your web-application into the OC4J in all clusters.

First, make sure all OC4J in the cluster has the same web-application. Access these Web-Application separately to see if they do not work properly without the cluster.

Step 2: Setting you have a Web-Application to copy its status.

Modify config / global-web-applibility.xml. Add the tab under the tab. Fill in the following example, except for the ID, other can be modified. The ID is set to meaningful information, such as the IP of this unit. Add the tab in Web-INF / Web.xml in the directory of each Web service.

<-!. Tag that is defined if the application is to be clustered Clustered applications have their ServletContext and session data shared between the apps in the cluster, the values ​​have to be either Serializable or be remote RMI-objects (implement java.rmi .Remote) host -.. The multicast host / ip to transmit and receive cluster data on The default is 230.0.0.1 id -. The id (number) of this cluster node to identify itself with in the cluster The default is based on. Local Machine IP. Port - The Port to Transmit and Receive Cluster Data on. The default is 9127. ->

Step 3: Set the cluster point.

Modify the tab in config / default-web-site.xml. Modify its Host property to this machine's IP, the value of Cluster-Island is different on each cluster point.

Step 4: Tell the background server front end Balancer's address.

In the same XML file in the previous step, add the tab in the tab. Host is the machine name running Balancer, Port is the port number. This Host and Port are the server address issued outward, so Port is equipped to 80.

Step 5: Start Balancer

To run Balancer, just run java -jar loadingbalancer.jar. Among them, some parameters can be added. -debug is a useful parameter. It is recommended to join this parameter for the first time in order to debug.

Step Six: Run the background service.

Run java -jar orion.jar. You can see the background server to register to Balancer information. If you don't see it, you will explain that "multicast" may not be supported. If you want to get more debugging information, you can use:

Java -Dhttp.cluster.debug = true -dcluster.debug = true -jar orion.jar

Step 7: Test

Use the browser to access the host name and port of Balancer to see if it is operating normally. Close a background server being used, see if other servers continue to work in place of the server.

appendix

Global-web-application.xml

XSL com.evermind.servlet.xslservlet defaultContentType < / param-name> text / html jsp COM . Evermind.server.http.jspservlet RMI com.evermind.server.rmi.rmihtttunnelServlet

ssi com.evermind.server.http.ssiservlet

cgi com.evermind.server.http.cgiservlet

Perl com.evermind.server.http.cgiservlet interpreter Perl php com.evermind.server. http.cgiservlet interpreter php jsp / *. jsp

CGI / *. cgi

Perl / *. pl

php / *. php

php / *. php3 PHP < / servlet-name> / *. phtml

si / *. shtml Index.html Default.jsp

Clustered Applications Have The Their ServletContext and Session

Data Shared Between the apps in the cluster, the value

Be Either Serializable or Be Remote Rmi-Objects (Implement Java.rmi.Remote).

Host - The Multicast Host / IP To Transmit and Receive Cluster Data ON.

The Default IS 230.0.0.0.1.

ID - The id (Number) of this cluster node to identify itself with in the cluster.

The Default Is Based on local Machine IP.

Port - The Port to Transmit and Receive Cluster Data on. The default is 9127.

->

Default-web-site.xml

->

->

Web.xml

snoop snoopservlet

转载请注明原文地址:https://www.9cbs.com/read-15201.html

New Post(0)