+

Search Tips   |   Advanced Search

Set up Dynamic Routing for Liberty collectives

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, stopped, started, 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 collective command actions. These actions are used together to generate a keystore 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.

To use the Dynamic Routing feature, all applications containing the same web modules must have the same application name. That is, we cannot have applications with different names serving the same URIs.

To use Intelligent Management to route HTTP requests to a Liberty Collective enable the Dynamic Routing feature on one or more collective controllers in a collective.

  1. 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>

  2. Start all of the controllers that have the Dynamic Routing feature enabled.

  3. Log on to one of the controllers and and 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

  4. Copy the generated plugin-key.jks and plugin-cfg.xmlfiles to a temporary directory on the web server host.

  5. On the web server host, convert the keystore to CMS format, and set personal certificate as the default. 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

  6. Copy the plugin-key.kdb, plugin-key.rdb, and plugin-key.sth files created by gskcmd from the temporary directory to the directory...

      <value of the --pluginInstallRoot argument>/config/<web server name>/

  7. Copy the plugin-cfg.xml to the directory specified in the WebSpherePluginConfig directive in the 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>

  8. Make sure a specified user name (value of the --user argument) is present in a user registry and has an administrative role assigned.


  9. 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.


Subtopics


Parent topic: Set up collectives

Concepts:

  • Collective architecture
    Liberty collective troubleshooting
    File transfer in a Liberty collective

    Tasks:

  • Configure a Liberty collective
    Register host computers with a Liberty collective