uCosminexus Application Server, Web Container Functionality Guide
Distributing requests by the URL patterns included in the HTTP requests enables you to execute only the specific processes in the Web container and to distribute requests to multiple Web containers according to the processing contents. Note that, when you use 'Distributing requests by URL pattern' method, as a principle, the requests are distributed in the Web application. Define the URL pattern as an operation of the redirector.
To set the distribution of requests by the URL pattern:
Specify the definition for distributing requests by the URL pattern in the <configuration> tag of the logical Web server (web-server) in the Easy Setup definition file.
The following table lists the definitions in the Easy Setup definition file for distributing requests by the URL pattern:
Table 4-5 Definitions in the Easy Setup definition file for distributing requests by the URL pattern
Category | Parameter | Description |
---|---|---|
Worker definitions | worker.list | Specifies a list of one or multiple worker names. |
worker.worker-name.host | Specifies the worker host name or IP address. | |
worker.worker-name.port | Specifies the worker port number. | |
worker.worker-name.type | Specifies the worker type (ajp13, lb, or post_size_lb). | |
Worker.worker-name.cachesize | Specifies the number of worker connections that are reused in the redirector. This parameter can only be specified in Windows. |
|
worker.worker-name.receive_timeout | Specifies the communication timeout value. | |
worker.worker-name.delegate_error_code | Specifies the error status code used when the creation of the error page is entrusted to the Web server. | |
Definition of mapping between the URL pattern and worker | JkMount | Specifies some combination of workers specified in the URL pattern and worker.list. |
For details on the Easy Setup definition file and the parameters, see 4.6 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.
The following figure shows the distribution of requests by the URL patterns.
Figure 4-5 Example of distribution of requests by the URL patterns
In this example, the Web application app1 is deployed on host A and the Web application app2 is deployed on host B. By including the name of the Web application you want to process in the URL pattern of the request, the request with the URL pattern /app1/* can be processed on the host A and the request with the URL pattern /app2/* can be processed on the host B. The worker name of the host A is worker1 and the worker name of the host B is worker2.
An example of the Easy Setup definition file is described below. To distribute the requests to multiple Web containers, specify the worker processes of multiple Web containers as the distribution destinations, in the redirector registered in the Web server. Also, the URL pattern /app1/* are mapped with worker1 and the URL pattern /app2/* are mapped with worker2.
Note that to implement this configuration, you must distribute requests to multiple Web systems.
... <param> <param-name>JkMount</param-name> <param-value>/app1/* worker1</param-value> <param-value>/app2/* worker2</param-value> </param> <param> <param-name>worker.list</param-name> <param-value>worker1, worker2</param-value> </param> <param> <param-name>worker.worker1.port</param-name> <param-value>8007</param-value> </param> <param> <param-name>worker.worker1.host</param-name> <param-value>hostA</param-value> </param> <param> <param-name>worker.worker1.type</param-name> <param-value>ajp13</param-value> </param> <param> <param-name>worker.worker1.cachesize</param-name> <param-value>64</param-value> </param> <param> <param-name>worker.worker2.port</param-name> <param-value>8007</param-value> </param> <param> <param-name>worker.worker2.host</param-name> <param-value>hostB</param-value> </param> <param> <param-name>worker.worker2.type</param-name> <param-value>ajp13</param-value> </param> <param> <param-name>worker.worker2.cachesize</param-name> <param-value>64</param-value> </param> ...
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.