WebSphere:为负载平衡问题合并插件cfg.xml



我正在尝试合并和负载平衡几个独立的WebSphere 6.1 Express服务器。我使用这里提供的说明:

从多个节点合并插件cfg.xml文件http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/twsv_configsimplelb.html?lang=en

这里:

在多个应用程序服务器配置文件之间配置简单的负载平衡http://www-01.ibm.com/support/knowledgecenter/SSAW57_6.1.0/com.ibm.websphere.base.doc/info/aes/ae/twsv_configsimplelb.html

我将来自两个不同WAS服务器的两个plugin-cfg.xml文件合并为一个,更新了两个WAS服务器上的Web服务器设置以指向这个新文件,还更新了插件以使用新合并的文件。服务器启动,但我只收到发送到第一台WebSphere服务器的请求。我很确定我为<虚拟主机组>元素不正确,是这个问题的幕后推手。我想我需要把所有<虚拟主机>元素组合成一个<虚拟主机组>元素,并且还将所有<服务器>元素合并为一个<服务器群集>元素,但我只是猜测。

WebSphere server1插件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="Error" Name="E:eStorefrontCustTestplugin/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:eStorefrontCustTestplugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:eStorefrontCustTestplugin/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插件cfg.xml文件:

<?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:eStorefrontCustTestplugin/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:eStorefrontCustTestplugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:eStorefrontCustTestplugin/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>

合并插件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:eStorefrontCTireTestplugin/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:eStorefrontCTireTestplugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:eStorefrontCTireTestplugin/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:eStorefrontCTireTestplugin/config/webserver1/plugin-key.kdb"/>
            <Property Name="stashfile" Value="E:eStorefrontCTireTestplugin/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>

您的文件存在一些问题。

首先,您需要为两台服务器设置cloneId,如本文所述,配置一个唯一的HTTP会话克隆ID:

要使用管理控制台,完成以下步骤:

  • 单击Servers > Server Types > WebSphere application servers > server_name
  • 在"Container Settings"下,单击"Web Container Settings > Web container"
  • 在"Additional Properties"下,单击"Custom properties > New"
  • 在名称字段中输入HttpSessionCloneId,在值字段中输入服务器的唯一值
    唯一值的长度必须是8-9个字母数字字符。例如,test1234是一个有效的cloneID
  • 单击ApplyOK
  • 单击Save将配置更改保存到主配置

然后,您实际上需要合并(而不是同时复制两者),plugin-cfg.xml的特定部分(我只是发布合并的部分,而不是整个文件)。所以您需要一个VirtualHostGroupServerClusterUriGroupRoute。对于VirtualHostGroup,您只需要80和443个端口。

<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:eStorefrontCTireTestplugin/config/webserver1/plugin-key.kdb"/>
        <Property Name="stashfile" Value="E:eStorefrontCTireTestplugin/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:eStorefrontCTireTestplugin/config/webserver1/plugin-key.kdb"/>
        <Property Name="stashfile" Value="E:eStorefrontCTireTestplugin/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"/>

我希望你明白。你必须测试它。你可以删除这些你不想处理的小便器,例如monitorServerWEB。如果它能路由到给定的服务器,测试的简单方法是为另一台服务器设置LoadBalanceWeight=0。我看到你已经在插件中启用了跟踪,所以它将为你提供插件如何匹配uri、vhost和服务器的更多细节。

最新更新