You can configure the Dynamic Routing feature to route HTTP requests to members of
Liberty collectives without having to regenerate the WebSphere plug-in configuration file when the
environment changes. For single-collective dynamic routing, a particular application can exist in
only one of the collectives.
About this task
To use Intelligent Management to route HTTP requests to a Liberty collective, you must enable the
dynamicRouting-1.0 feature on one or more collective controllers in a collective.
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 the
dynamicRouting command. Use its setup,
genPluginCfg, and genKeystore command actions together to
generate the keystores that are 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.
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 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
Note: Make sure a specified user name (value of the --user argument) exists in a
user registry and has an administrative role assigned.
For more information, see 動的ルーティング・コマンド.
- 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
For z/OS, see Conversion of the keystore to CMS format on z/OS.
- 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
--pluginInstallRootargument_value/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.
- Optional: Add the <dynamicRouting> element to the controller
server.xml to specify properties for dynamic routing.
The connectorClusterName property specifies the name that dynamic routing
associates with this collective. If the connectorClusterName property is not
specified, the name of the collective is used. The retryInterval property
specifies how long to wait before retrying a connection to a controller if a connection fails. The
maxRetries property specifies the number of times to try to reconnect to a
failed collective controller.
For example:
<dynamicRouting maxRetries="4" retryInterval="20" connectorClusterName="collective1"/>
<TraceSpecification name="default" specification=":DEBUG"/>
</dynamicRouting>
The generated
plugin-cfg.xml has the
<ConnectorCluster>
properties:
<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 dynamicRouting-1.0 feature enabled, Intelligent Management can now
dynamically route HTTP requests to Liberty collectives.