2014-09-30 62 views
0

我試圖合併和負載平衡幾個獨立的WebSphere 6.1 Express服務器。我使用這裏提供的說明:從多個節點 http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/twsv_configsimplelb.html?lang=enWebSphere:發佈合併plugin-cfg.xml進行負載平衡

這裏

合併的plugin-cfg.xml文件:

配置簡單的負載在多個應用服務器平衡型材 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服務器的請求。我很確定我爲<VirtualHostGroup>元素做了什麼是不正確的,並且是這個問題的後面。我想,我需要把所有的<虛擬主機>元素合併爲一個<VirtualHostGroup>元素,也把所有的<服務器>元素融入到一個<的ServerCluster >元素,但我只是猜測。

的WebSphere server1的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="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服務器2 plugin-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:\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> 

合併的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> 
+0

只需澄清一下 - 您是否想從這2個服務器(提供相同的應用程序和負載平衡)或通過1個http服務器訪問的2個獨立服務器創建一個簡單的羣集?至於現在第二,沒有ccWEB,ccStandAlone和monitorServerWEB應用程序。 – Gas 2014-09-30 14:17:32

+0

我想創建一個具有負載平衡的簡單羣集。 server2最終會得到ccWEB和ccStandAlone,我將從server1中刪除monitorServerWEB。 – 2014-09-30 14:20:54

回答

3

你的文件有幾個問題。

首先你需要設置cloneId爲您的服務器作爲記錄在這裏configure a unique HTTP session clone ID

要使用管理 控制檯配置唯一的HTTP會話克隆標識,請完成以下步驟:

  • 點擊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 S的部分(我就交合並部分而不是整個文件)。所以你需要一個VirtualHostGroup,ServerCluster, UriGroupRoute。對於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:\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"/> 

我希望你能明白。你將不得不測試它。您可以移除您不想處理的這些Uris,例如monitorServerWEB。測試的簡單方法是,如果它可以路由到給定服務器,則爲其他服務器設置LoadBalanceWeight=0。我發現你已經在插件中啓用了跟蹤,所以它會給你更多的細節插件如何試圖匹配uri,虛擬主機和服務器。

+0

我有從前的HttpSessionCloneID。扔給我的是,IBM技術人員說要將元素複製到一個文件中,而不是合併它們。上面包含的內容完美無缺。謝謝! – 2014-10-01 15:25:16