The Dynamic Routing feature enables routing of HTTP requests to members of Liberty
collectives without having to regenerate the WebSphere®
plug-in configuration file when the environment changes. When servers, cluster members,
applications, or virtual hosts are added, removed, started, stopped, or modified; the new
information is dynamically delivered to the WebSphere
plug-in. Requests will be routed based on up-to-date information. The feature provides the Dynamic
Routing service, which dynamically retrieves routing information from the collective repository and
delivers this information to the WebSphere plug-in. The
feature also provides three new dynamicRouting command actions. These actions are used together to
generate a keystore that is needed for secure communication between the plug-in and the Dynamic
Routing service, as well as a plug-in configuration file that enables Intelligent Management in the
WebSphere plug-in.
Before you begin
For the Dynamic Routing function to work, the dynamicRouting feature is required in collective
controllers only. There is no requirement to upgrade every collective member. Dynamic Routing can be
used to route to applications installed in any Liberty server in a collective, including Network
Deployment, Core and Base editions.
Important: The interim fix for Intelligent
Management in the web server plug-in for WebSphere
Application Server APAR number PI27023 is necessary to use the Dynamic Routing feature. You must
install a web server that is supported by the web server plug-in for WebSphere Application Server, such as the IBM HTTP Server, install an
8.5.5 or higher web server plug-ins for WebSphere
Application Server, then install the interim fix before enabling the Dynamic Routing feature.
- Download and install the latest version of the IBM Installation
Manager. For more information on installing IBM Installation Manager, see Installing Installation Manager and preparing to install the product.
- Use Installation Manager to access online product repositories to install the Web Server Plug-in
for WebSphere Application Server and the needed interim
fix for the Dynamic Routing feature. Open the Installation Manager GUI preferences page by selecting
File > Preferences . Use the Installation Manager to install the product
from the web-based repository that is located at
http://www.ibm.com/software/repositorymanager/com.ibm.websphere.PLGILAN.v85
Note: You need an IBM ID to access the repository. This repository is only for Distributed
platforms.
- Use the Install wizard to install both the web server plug-ins and the required interim
fix.
- When prompted by the wizard, specify the installation location and proceed with the
installation.
Watch: The Enabling IHS for Liberty Dynamic Routing video shows how to install IHS,
install Web Server Plug-in for WebSphere Application Server, and apply the interim fix for Dynamic
Routing. [Transcript]
About this task
To use Intelligent Management to route HTTP requests to a Liberty Collective the user must enable
the Dynamic Routing feature on one or more collective controllers in a
collective.
Procedure
- Enable Dynamic Routing in a controller by adding the following code to the
featureManager tag in the server.xml of the
controller.
<feature>dynamicRouting-1.0</feature>
- Start all of the controllers that have the Dynamic Routing feature enabled.
- Run the dynamicRouting setup command on one of the controllers to generate
the keystore and plug-in configuration files. For example:
./dynamicRouting setup --port=9444 --host=controller1.acme.com --user=admin --password=passw0rd --keystorePassword=webAS --pluginInstallRoot=/opt/HTTPServer_Plugins/ --webServerNames=webserver1
For more information on Dynamic Routing commands, see
Dynamic routing command.
Note: Make sure a specified
user name (value of the --user argument) is present in a user registry and has an administrative
role assigned.
- Copy the generated plugin-key.jks and plugin-cfg.xml
files to a temporary directory on the web server host.
- On the web server host, run gskcmd (included in the IHS package) to convert
the keystore to CMS format and to set personal certificate as the default. CMS format is the
supported format of the WebSphere Plug-in. For example:
gskcmd -keydb -convert -pw webAS -db /tmp/plugin-key.jks -old_format jks -target /tmp/plugin-key.kdb -new_format cms -stash
gskcmd -cert -setdefault -pw <<password>> -db /tmp/plugin-key.kdb -label default
- Copy the plugin-key.kdb, plugin-key.rdb, and
plugin-key.sth files that are created by gskcmd from the
temporary directory to the directory <value of the
--pluginInstallRootargument>/config/<web server name>/
- Copy the plugin-cfg.xml to the directory specified in the
WebSpherePluginConfig directive in the IBM HTTP Server (IHS)
httpd.conf file. The plugin-cfg.xml is generated with the
<IntelligentManagement> stanza. When Dynamic Routing is enabled in a collective,
there is one <Connector> stanza for each collective controller.
For example:
<IntelligentMangement>
<Property name="webserverName" value="webServer1"/>
<ConnectorCluster enabled="true" maxRetries="-1" name="default" retryInterval="60">
<Property name="uri" value="/ibm/api/dynamicRouting"/>
<Connector host="controller1.acme.com" port="9444" protocol="https">
<Property name="keyring" value="/opt/HTTPServer_Plugins/config/webserver1/plugin-key.kdb"/>
</Connector>
</ConnectorCluster>
</IntelligentManagement>
- Start the web server and begin routing to the application installed in the collective.
Optionally, the
<dynamicRouting> tag can be added to the
server.xml of the controller to specify
<ConnectorCluster>
properties such as
maxRetries and
retryInterval. For
example:
<dynamicRouting maxRetries="4" retryInterval="20" connectorClusterName="collective1"/>
<TraceSpecification name="default" specification=":DEBUG"/>
</dynamicRouting>
The generated
plugin-cfg.xml looks like
this:
<IntelligentMangement>
<TraceSpecification name="default" specification=":DEBUG"/>
<Property name="webserverName" value="webServer1"/>
<ConnectorCluster enabled="true" maxRetries="4" name="collective1" retryInterval="20">
<Property name="uri" value="/ibm/api/dynamicRouting"/>
<Connector host="controller1.acme.com" port="9444" protocol="https">
<Property name="keyring" value="/opt/HTTPServer_Plugins/config/webServer1/plugin-key.kdb"/>
</Connector>
</ConnectorCluster>
</IntelligentManagement>
Results
With the
Dynamic Routing feature enabled, Intelligent Management can
now dynamically route HTTP requests to Liberty collectives.