13.4.4. Configuration Reference for Apache Mod_jk Workers
workers.propertiesfile defines the behavior of the worker nodes which mod_jk passes client requests to. In Red Hat Enterprise Linux, the file resides in
workers.propertiesfile defines where the different servlet containers are located, and the way the work load should be balanced across them.
worker.WORKER_NAME.DIRECTIVE, where WORKER_NAME is a unique name for the worker, and DIRECTIVE is the setting to be applied to the worker.
Node templates specify default per-node settings. You can override the template within the node settings itself. You can see an example of node templates in Example 13.6, “Example
Table 13.14. Global properties
|worker.list||The list of worker names used by mod_jk. These workers are available to receive requests.|
Table 13.15. Per-worker properties
The type of the worker. The default type is
For more information on these directives, refer to the Apache Tomcat Connector AJP Protocol Reference at http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html.
Specifies the worker nodes that the load balancer must manage. You can use the directive multiple times for the same load balancer. It consists of a comma-separated list of worker names. This is set per worker, not per node. It affects all nodes balanced by that worker type.
Specifies whether requests from the same session are always routed to the same worker. The default is
Table 13.16. Per-node properties
The hostname or IP address of the worker. The worker node must support the
The port number of the remote server instance listening for defined protocol requests. The default value is
The conditions under which connections are probed for network status. The probe uses an empty AJP13 packet for CPing, and expects a CPong in response. Specify the conditions by using a combination of directive flags. The flags are not separated by a comma or any white-space. The ping_mode can be any combination of
|ping_timeout, connect_timeout, prepost_timeout, connection_ping_interval|| |
The timeout values for the connection probe settings above. The value is specified in milliseconds, and the default value for
Specifies the load-balancing factor for an individual worker, and only applies to a member worker of a load balancer. This is useful to give a more powerful server more of the work load. To give a worker 3 times the default load, set this to
Example 13.6. Example
worker.list=ajp13,lb worker.balancer1.sticky_sessions=1 worker.balancer1.balance_workers=node1 worker.balancer2.sticky_session=1 worker.balancer2.balance_workers=node2,node3 worker.nodetemplate.type=ajp13 worker.nodetemplate.port=8009 worker.node1.template=nodetemplate worker.node1.host=localhost worker.node1.ping_mode=CI worker.node1.connection_ping_interval=9000 worker.node1.lbfactor=1 worker.node1.template=nodetemplate worker.node2.host=192.168.1.1 worker.node2.ping_mode=A worker.node1.template=nodetemplate worker.node3.host=192.168.1.2