• No se han encontrado resultados

CAPÍTULO 3 METODOLOGÍA DE LA INVESTIGACIÓN

3.3 INSTRUMENTOS

■ Reconfigure your load balancer so that it no longer directs requests to the removed instance.

■ Remove the instance from OracleAS Clusters by removing the tags that you added to the instance. You added these tags when you set up the cluster. See Section 3.2.1, "Setting up OracleAS Clusters" for details.

■ Remove the instance from application-level clustering by removing these tags: The <distributable/> tag from the web.xml file for all Web modules that

are part of an application configured for clustering The <cluster> tag that you added to the application’s

orion-application.xml file or to the global ORACLE_ HOME/j2ee/home/config/application.xml file

3.2.12 Setting mod_oc4j Load Balancing Options

The mod_oc4j module within Oracle HTTP Server delegates requests to OC4J

processes. Whenever Oracle HTTP Server receives a request for a URL that is intended for OC4J, Oracle HTTP Server routes the request to the mod_oc4j module, which then routes the request to an OC4J process. If an OC4J process fails, OPMN detects the failure and mod_oc4j does not send requests to the failed OC4J process until the OC4J process is restarted.

You can configure mod_oc4j to load balance requests to OC4J processes. Oracle HTTP Server, through mod_oc4j, supports different load balancing policies. Load balancing policies provide performance benefits along with failover and high availability, depending on the network topology and host machine capabilities.

You can specify different load balancing routing algorithms for mod_oc4j depending on the type and complexity of routing you need. Stateless requests are routed to any destination available based on the algorithm specified in mod_oc4j.conf. Stateful HTTP requests are forwarded to the OC4J process that served the previous request using session identifiers, unless mod_oc4j determines through communication with OPMN that the process is not available. In this case, mod_oc4j forwards the request to an available OC4J process following the specified load balancing protocol.

By default, all OC4J instances have the same weight (all instances have a weight of 1), and mod_oc4j uses the round robin method to select an OC4J instance to forward a request to. An OC4J instance’s weight is taken as a ratio compared to the weights of the other available OC4J instances in the topology to define the number of requests the instance should service. If the request belongs to an established session, mod_oc4j forwards the request to the same OC4J instance and the same OC4J process that started the session.

Managing the Active-Active Topology

The mod_oc4j load balancing options do not take into account the number of OC4J processes running on an OC4J instance when determining which OC4J instance to send a request to. OC4J instance selection is based on the configured weight for the instance, and its availability.

To modify the mod_oc4j load balancing policy, set the Oc4jSelectMethod and the Oc4jRoutingWeight directives in the ORACLE_

HOME/Apache/Apache/conf/mod_oc4j.conf file:

1. In the mod_oc4j.conf file on each Oracle Application Server instance, within the <IfModule mod_oc4j.c> section, set the Oc4jSelectMethod directive to one of the values shown in Table 3–4.

If you set the Oc4jSelectMethod directive to either roundrobin:weighted or random:weighted, you may also need to set the Oc4jRoutingWeight directive to specify the weight (see the next step).

See "Choosing a mod_oc4j Load Balancing Algorithm" on page 3-21 for tips on choosing a routing algorithm.

Example:

Oc4jSelectMethod random:local

For information on how to set up metric-based load balancing, see the "Load Balancing Using mod_oc4j" appendix in the Oracle HTTP Server Administrator’s Guide.

Table 3–4 Values for Oc4jSelectMethod

Value Description

roundrobin (default) mod_oc4j places all the OC4J processes in the topology in a list, and it selects processes in order from the list.

roundrobin:local Similar to roundrobin, but the list includes only local OC4J processes. If no local OC4J processes are available, then it selects a remote OC4J process.

roundrobin:weighted mod_oc4j distributes the total request load to each OC4J instance based on routing weight configured on each instance. It then selects OC4J processes from the local instance in a round robin manner.

You configure the weight using the Oc4jRoutingWeight

directive.

random mod_oc4j randomly selects an OC4J process from a list of all OC4J processes in the topology.

random:local Similar to random, but mod_oc4j gives preference to local OC4J processes. If no local OC4J processes are available, then it selects a remote OC4J process.

random:weighted mod_oc4j selects an OC4J process based on the weight configured for each instance in the topology.

You configure the weight using the Oc4jRoutingWeight

directive.

metric mod_oc4j routes requests based on runtime metrics that indicate how busy a process is.

metric:local Similar to metric, but mod_oc4j gives preference to local OC4J processes. If no local OC4J processes are available, then it routes to a remote OC4J process.

2. If you set the Oc4jSelectMethod directive to a weight-based method (that is, roundrobin:weighted or random:weighted), you may also need to set the Oc4jRoutingWeight directive to specify the weight.

If you do not set the Oc4jRoutingWeight directive, it defaults to 1.

Example: If you have a topology that consists of three instances (A, B, and C), and you want B and C to get twice as many requests as A, set the following directives for B and C:

Oc4jSelectMethod roundrobin:weighted Oc4jRoutingMethod 2

For A, you can just set the Oc4jSelectMethod directive. Setting Oc4jRoutingMethod is optional because the default value is 1.

3. Restart Oracle HTTP Server on all instances in the topology for the changes to take

Documento similar