+

Search Tips   |   Advanced Search

manageODR.py script

Use the manageODR.py script to create a cluster of on demand routers (ODRs), and to manage routing rules and custom logging.

The manageODR.py script is located in the app_server_root/bin directory. Before running this script, ensure that we have the environment variable WAS_HOME configured to point to the directory of the WebSphere installation.


Operations

We can perform the following operations with the manageODR.py script:

convertToCluster <node:odr> <cluster> Convert an existing ODR on node node with name odr to an ODR cluster named <cluster>.
createDynamicCluster <cluster> <nodeGroup> Create an ODR dynamic cluster named <cluster> on nodes in node group <nodeGroup>.
addToCluster <node:odr> <cluster> Create a new ODR on node node with name odr and add it to ODR cluster cluster.
insertMultiClusterRoutingRule <odrServerOrCluster> <protocolFamily> <ruleNumber> <condition> <multiClusterAction> <multiClusterSpecification> Insert an ODR routing rule with an action to load balance or failover between clusters in the same, or different, cells.
insertRedirectRoutingRule <odrServerOrCluster> <ruleNumber> <condition> <redirectURL> Insert an ODR routing rule with an action to return a redirect to the client. This is only supported for the HTTP protocol family.
insertRejectRoutingRule <odrServerOrCluster> <protocolFamily> <ruleNumber> <condition> <errorCode> Insert an ODR routing rule with an action to return a specific error code to the client.
removeRoutingRule <odrServerOrCluster> <protocolFamily> <ruleNumber> Remove the ODR routing rule specified by the protocol family (for example the HTTP protocol family), and rule number.
listRoutingRules <odrServerOrCluster> <protocolFamily> List the ODR routing rules for the specified protocol family (for example the HTTP protocol family).
insertLocalContentRoutingRule <odrServerOrCluster> <ruleNumber> <condition> <localPath> Insert an ODR routing rule with an action to serve static HTML content from the local file system of the ODR.
insertCustomLogRule <odrServerOrCluster> <ruleNumber> <condition> <logFileFormat> Insert a custom log rule into the list at position <ruleNumber>.

RemoveCustomLogRule <odrServerOrCluster> <ruleNumber> Remove the custom log rule number <ruleNumber>.
listCustomLogRules <odrServerOrCluster> List the custom log rules associated with an ODR or ODR cluster.

The arguments are:

The following example shows how to create an HTTP ODR named odr, on node 1:

The following example shows how to convert an ODR named odr on node node1 to an ODR cluster named ODRCluster:

The following example shows how to add a custom log rule to put all requests whose service time is longer than 2 seconds in the slow.log custom log, and include the application server to which the request was sent and the service time:

The following example shows how to add a custom log rule to put all 503 responses in 503.log. The rule is added at position 2. If there is an existing rule at position 2, the new rule is inserted before the existing rule.

The following example shows how to add a custom log rule at position 1 to log errors that can occur when writing a response to a client in the response.write.error.log:


Related:

  • Custom log file format
  • Cell affinity function
  • Configure custom logs
  • Create and configure ODRs
  • Configure ODRs
  • Enable cell affinity
  • Configure cell affinity in a multi-tiered environment
  • Use generic server clusters with cell affinity