-->

WebSphere: issue merging plugin-cfg.xml for load b

2019-09-06 15:18发布

问题:

I'm trying to merge and load balance several stand-alone WebSphere 6.1 Express servers. I'm using the instructions provided here:

Merging plugin-cfg.xml files from multiple nodes http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/twsv_configsimplelb.html?lang=en

and here:

Configuring simple load balancing across multiple application server profiles http://www-01.ibm.com/support/knowledgecenter/SSAW57_6.1.0/com.ibm.websphere.base.doc/info/aes/ae/twsv_configsimplelb.html

I merged two plugin-cfg.xml files from two different WAS servers into one, updated the two WAS server's webserver settings to point to this new file, and also updated the plugin to use the new merged file. The servers start, but I only get requests going to the first WebSphere server. I'm pretty sure what I did for the <VirtualHostGroup> elements is not correct, and is behind that issue. I think that I need to put all of the <VirtualHost> elements into one combined <VirtualHostGroup> element, and also put all of the <Server> elements into one <ServerCluster> element, but I'm just guessing.

WebSphere server1 plugin-cfg.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--HTTP server plugin config file for the webserver websphere02Node19Cell.custTestNode.webserver1 generated on 2014.09.25 at 06:45:03 PM EDT-->
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" VHostMatchingCompat="false">
   <Log LogLevel="Error" Name="E:\eStorefront\Cust\Test\plugin/logs/webserver1/http_plugin.log"/>
   <Property Name="ESIEnable" Value="true"/>
   <Property Name="ESIMaxCacheSize" Value="1024"/>
   <Property Name="ESIInvalidationMonitor" Value="false"/>
   <Property Name="ESIEnableToPassCookies" Value="false"/>
   <VirtualHostGroup Name="default_host">
      <VirtualHost Name="*:9098"/>
      <VirtualHost Name="*:80"/>
      <VirtualHost Name="*:9475"/>
      <VirtualHost Name="*:5097"/>
      <VirtualHost Name="*:5096"/>
      <VirtualHost Name="*:443"/>
   </VirtualHostGroup>
   <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="server1_custTestNode_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTestNode_server1" ServerIOTimeout="0" WaitForContinue="false">
         <Transport Hostname="websphere02" Port="9098" Protocol="http"/>
         <Transport Hostname="websphere02" Port="9475" Protocol="https">
            <Property Name="keyring" Value="E:\eStorefront\Cust\Test\plugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:\eStorefront\Cust\Test\plugin/config/webserver1/plugin-key.sth"/>
         </Transport>
      </Server>
   </ServerCluster>
   <UriGroup Name="default_host_server1_custTestNode_Cluster_URIs">
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/gatewayRMIWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ccWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ccStandAlone/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ivt/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/monitorServerWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/customerInquiry/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontAdminWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2BWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2CWEB/*"/>
   </UriGroup>
   <Route ServerCluster="server1_custTestNode_Cluster" UriGroup="default_host_server1_custTestNode_Cluster_URIs" VirtualHostGroup="default_host"/>
   <RequestMetrics armEnabled="false" loggingEnabled="false" rmEnabled="false" traceLevel="HOPS">
      <filters enable="false" type="URI">
         <filterValues enable="false" value="/snoop"/>
         <filterValues enable="false" value="/hitcount"/>
      </filters>
      <filters enable="false" type="SOURCE_IP">
         <filterValues enable="false" value="255.255.255.255"/>
         <filterValues enable="false" value="254.254.254.254"/>
      </filters>
      <filters enable="false" type="JMS">
         <filterValues enable="false" value="destination=aaa"/>
      </filters>
      <filters enable="false" type="WEB_SERVICES">
         <filterValues enable="false" value="wsdlPort=aaa:op=bbb:nameSpace=ccc"/>
      </filters>
   </RequestMetrics>
</Config>

WebSphere server2 plugin-cfg.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--HTTP server plugin config file for the webserver websphere02Node23Cell.custTest2Node.webserver1 generated on 2014.09.29 at 04:40:12 PM EDT-->
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" VHostMatchingCompat="false">
   <Log LogLevel="Error" Name="E:\eStorefront\Cust\Test\plugin/logs/webserver1/http_plugin.log"/>
   <Property Name="ESIEnable" Value="true"/>
   <Property Name="ESIMaxCacheSize" Value="1024"/>
   <Property Name="ESIInvalidationMonitor" Value="false"/>
   <Property Name="ESIEnableToPassCookies" Value="false"/>
   <VirtualHostGroup Name="default_host">
      <VirtualHost Name="*:9133"/>
      <VirtualHost Name="*:80"/>
      <VirtualHost Name="*:9491"/>
      <VirtualHost Name="*:5105"/>
      <VirtualHost Name="*:5104"/>
      <VirtualHost Name="*:443"/>
   </VirtualHostGroup>
   <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="server1_custTest2Node_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTest2Node_server1" ServerIOTimeout="0" WaitForContinue="false">
         <Transport Hostname="websphere02" Port="9133" Protocol="http"/>
         <Transport Hostname="websphere02" Port="9491" Protocol="https">
            <Property Name="keyring" Value="E:\eStorefront\Cust\Test\plugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:\eStorefront\Cust\Test\plugin/config/webserver1/plugin-key.sth"/>
         </Transport>
      </Server>
   </ServerCluster>
   <UriGroup Name="default_host_server1_custTest2Node_Cluster_URIs">
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/gatewayRMIWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ivt/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/customerInquiry/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontAdminWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2BWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2CWEB/*"/>
   </UriGroup>
   <Route ServerCluster="server1_custTest2Node_Cluster" UriGroup="default_host_server1_custTest2Node_Cluster_URIs" VirtualHostGroup="default_host"/>
   <RequestMetrics armEnabled="false" loggingEnabled="false" rmEnabled="false" traceLevel="HOPS">
      <filters enable="false" type="URI">
         <filterValues enable="false" value="/snoop"/>
         <filterValues enable="false" value="/hitcount"/>
      </filters>
      <filters enable="false" type="SOURCE_IP">
         <filterValues enable="false" value="255.255.255.255"/>
         <filterValues enable="false" value="254.254.254.254"/>
      </filters>
      <filters enable="false" type="JMS">
         <filterValues enable="false" value="destination=aaa"/>
      </filters>
      <filters enable="false" type="WEB_SERVICES">
         <filterValues enable="false" value="wsdlPort=aaa:op=bbb:nameSpace=ccc"/>
      </filters>
   </RequestMetrics>
</Config>

Merged plugin-cfg.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--HTTP server plugin config file for the webserver websphere02Node19Cell.custTestNode.webserver1 generated on 2014.09.25 at 06:45:03 PM EDT-->
<Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="HostHeader" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" VHostMatchingCompat="false">
   <Log LogLevel="Trace" Name="E:\eStorefront\CTire\Test\plugin/logs/webserver1/http_plugin.log"/>
   <Property Name="ESIEnable" Value="true"/>
   <Property Name="ESIMaxCacheSize" Value="1024"/>
   <Property Name="ESIInvalidationMonitor" Value="false"/>
   <Property Name="ESIEnableToPassCookies" Value="false"/>
   <VirtualHostGroup Name="default_host">
      <VirtualHost Name="*:9098"/>
      <VirtualHost Name="*:9475"/>
      <VirtualHost Name="*:5097"/>
      <VirtualHost Name="*:5096"/>
      <VirtualHost Name="*:80"/>
      <VirtualHost Name="*:443"/>
   </VirtualHostGroup>
   <VirtualHostGroup Name="default_host2">
      <VirtualHost Name="*:9133"/>
      <VirtualHost Name="*:9491"/>
      <VirtualHost Name="*:5105"/>
      <VirtualHost Name="*:5104"/>
      <VirtualHost Name="default_host2:80"/>
      <VirtualHost Name="default_host2:443"/>
   </VirtualHostGroup>
   <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="server1_custTestNode_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTestNode_server1" ServerIOTimeout="0" WaitForContinue="false">
         <Transport Hostname="websphere02" Port="9098" Protocol="http"/>
         <Transport Hostname="websphere02" Port="9475" Protocol="https">
            <Property Name="keyring" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.sth"/>
         </Transport>
      </Server>
  </ServerCluster>
  <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="server1_custTest2Node_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTest2Node_server1" ServerIOTimeout="0" WaitForContinue="false">
         <Transport Hostname="websphere02" Port="9133" Protocol="http"/>
         <Transport Hostname="websphere02" Port="9491" Protocol="https">
            <Property Name="keyring" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.sth"/>
         </Transport>
      </Server>
   </ServerCluster>
   <UriGroup Name="default_host_server1_custTestNode_Cluster_URIs">
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/gatewayRMIWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ivt/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/customerInquiry/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontAdminWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2BWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2CWEB/*"/>
   </UriGroup>
   <UriGroup Name="default_host2_server1_custTest2Node_Cluster_URIs">
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/gatewayRMIWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ivt/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/customerInquiry/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontAdminWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2BWEB/*"/>
      <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2CWEB/*"/>
   </UriGroup>
   <Route ServerCluster="server1_custTestNode_Cluster" UriGroup="default_host_server1_custTestNode_Cluster_URIs" VirtualHostGroup="default_host"/>
   <Route ServerCluster="server1_custTest2Node_Cluster" UriGroup="default_host2_server1_custTest2Node_Cluster_URIs" VirtualHostGroup="default_host2"/>
   <RequestMetrics armEnabled="false" loggingEnabled="false" rmEnabled="false" traceLevel="HOPS">
      <filters enable="false" type="URI">
         <filterValues enable="false" value="/snoop"/>
         <filterValues enable="false" value="/hitcount"/>
      </filters>
      <filters enable="false" type="SOURCE_IP">
         <filterValues enable="false" value="255.255.255.255"/>
         <filterValues enable="false" value="254.254.254.254"/>
      </filters>
      <filters enable="false" type="JMS">
         <filterValues enable="false" value="destination=aaa"/>
      </filters>
      <filters enable="false" type="WEB_SERVICES">
         <filterValues enable="false" value="wsdlPort=aaa:op=bbb:nameSpace=ccc"/>
      </filters>
   </RequestMetrics>
</Config>

回答1:

There are a few issues with your file.

First you need to setup cloneId for both of your servers as documented here configure a unique HTTP session clone ID :

To configure a unique HTTP session clone ID using the administrative console, complete the following steps:

  • Click Servers > Server Types > WebSphere application servers > server_name.
  • Under Container Settings, click Web Container Settings > Web container.
  • Under Additional Properties, click Custom properties > New.
  • Enter HttpSessionCloneId in the Name field, and a unique value for the server in the Value field.
    The unique value must be 8 - 9 alphanumeric characters in length. For example, test1234 is a valid cloneID value.
  • Click Apply or OK.
  • Click Save to save the configuration changes to the master configuration.

Then you actually need to merge (not copy both), specific section of your plugin-cfg.xmls (I'll just post merged section not the whole file). So you need one VirtualHostGroup, ServerCluster, UriGroup and Route. For VirtualHostGroup you just need 80 and 443 ports.

<VirtualHostGroup Name="default_host">
  <VirtualHost Name="*:80"/>
  <VirtualHost Name="*:443"/>
</VirtualHostGroup>
<ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="server1_custTestNode_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
  <Server CloneID="s111111" LoadBalanceWeight="1" ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTestNode_server1" ServerIOTimeout="0" WaitForContinue="false">
     <Transport Hostname="websphere02" Port="9098" Protocol="http"/>
     <Transport Hostname="websphere02" Port="9475" Protocol="https">
        <Property Name="keyring" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.kdb"/>
        <Property Name="stashfile" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.sth"/>
     </Transport>
  </Server>
  <Server CloneID="s22222" LoadBalanceWeight="1" ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="custTest2Node_server1" ServerIOTimeout="0" WaitForContinue="false">
     <Transport Hostname="websphere02" Port="9133" Protocol="http"/>
     <Transport Hostname="websphere02" Port="9491" Protocol="https">
        <Property Name="keyring" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.kdb"/>
        <Property Name="stashfile" Value="E:\eStorefront\CTire\Test\plugin/config/webserver1/plugin-key.sth"/>
     </Transport>
  </Server>
 <PrimaryServers>
   <Server Name="custTestNode_server1"/>
   <Server Name="custTest2Node_server1"/>
  </PrimaryServers>
</ServerCluster>
<UriGroup Name="default_host_server1_custTestNode_Cluster_URIs">
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/gatewayRMIWEB/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ccWEB/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ccStandAlone/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/ivt/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/monitorServerWEB/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/customerInquiry/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontAdminWEB/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2BWEB/*"/>
  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/storefrontB2CWEB/*"/>
 </UriGroup>
<Route ServerCluster="server1_custTestNode_Cluster" UriGroup="default_host_server1_custTestNode_Cluster_URIs" VirtualHostGroup="default_host"/>

I hope you get the idea. You will have to test it. You can remove these Uris you don't want to handle e.g. monitorServerWEB. The easy way to test, if it can route to given server is set LoadBalanceWeight=0 for the other server. I see you've already enabled tracing in the plugin, so it will give you more details how plugin is trying to match uri, vhost and server.