将请求重定向到群集中的另一台服务器

时间:2016-12-14 14:41:29

标签: websphere websphere-7

我在一台机器上设置了一个包含2个节点的垂直群集。我还为节点/服务器/集群成员配置了Apache Web Server。我还通过在网络服务器中设置Session Affinity来启用IgnoreAffinityRequests=false。例如,我使用集群成员1登录,然后如果该成员/服务器失败,我需要WebSphere Application Server Network Deployment使用会话将请求重定向到另一个可用服务器。我怎样才能做到这一点?

以下是我的webserver01的

            <?xml version="1.0" encoding="ISO-8859-1"?><!--HTTP server plugin config file for the webserver localhostCell01.localhostNode01.webserver01 generated on 2016.12.14 at 07:47:15 PM IST-->
            <Config ASDisableNagle="false" AcceptAllContent="false" AppServerPortPreference="WebserverPort" ChunkedResponse="false" FIPSEnable="false" IISDisableNagle="false" IISPluginPriority="High" IgnoreDNSFailures="false" RefreshInterval="60" ResponseChunkSize="64" VHostMatchingCompat="false">
               <Log LogLevel="Error" Name="c:\Program Files\IBM\WebSphere\Plugins\logs\webserver01\http_plugin.log"/>
               <Property Name="ESIEnable" Value="true"/>
               <Property Name="ESIMaxCacheSize" Value="1024"/>
               <Property Name="ESIInvalidationMonitor" Value="false"/>
               <Property Name="ESIEnableToPassCookies" Value="false"/>
               <Property Name="PluginInstallRoot" Value="c:\Program Files\IBM\WebSphere\Plugins\"/>
               <VirtualHostGroup Name="default_host">
                  <VirtualHost Name="*:9080"/>
                  <VirtualHost Name="*:80"/>
                  <VirtualHost Name="*:9443"/>
                  <VirtualHost Name="*:5060"/>
                  <VirtualHost Name="*:5061"/>
                  <VirtualHost Name="*:443"/>
                  <VirtualHost Name="*:9061"/>
                  <VirtualHost Name="*:9044"/>
                  <VirtualHost Name="*:9062"/>
                  <VirtualHost Name="*:9081"/>
                  <VirtualHost Name="*:9444"/>
                  <VirtualHost Name="*:9045"/>
               </VirtualHostGroup>
               <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="false" LoadBalance="Round Robin" Name="cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
                  <Server CloneID="1b3q78g4e" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode01_member1" ServerIOTimeout="60" WaitForContinue="false">
                     <Transport Hostname="localhost" Port="9080" Protocol="http"/>
                     <Transport Hostname="localhost" Port="9443" Protocol="https">
                        <Property Name="keyring" Value="c:\Program Files\IBM\WebSphere\Plugins\config\webserver01\plugin-key.kdb"/>
                        <Property Name="stashfile" Value="c:\Program Files\IBM\WebSphere\Plugins\config\webserver01\plugin-key.sth"/>
                     </Transport>
                  </Server>
                  <Server CloneID="1b3q78ihf" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode02_member2" ServerIOTimeout="60" WaitForContinue="false">
                     <Transport Hostname="localhost" Port="9081" Protocol="http"/>
                     <Transport Hostname="localhost" Port="9444" Protocol="https">
                        <Property Name="keyring" Value="c:\Program Files\IBM\WebSphere\Plugins\config\webserver01\plugin-key.kdb"/>
                        <Property Name="stashfile" Value="c:\Program Files\IBM\WebSphere\Plugins\config\webserver01\plugin-key.sth"/>
                     </Transport>
                  </Server>
                  <PrimaryServers>
                     <Server Name="localhostNode01_member1"/>
                     <Server Name="localhostNode02_member2"/>
                  </PrimaryServers>
               </ServerCluster>
               <UriGroup Name="default_host_cluster_URIs">
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppamanager/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppaadmin/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppaauthor/*"/>
               </UriGroup>
               <Route ServerCluster="cluster" UriGroup="default_host_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>

以下是dmgr配置文件的plugin-cfg.xml

            <?xml version="1.0" encoding="ISO-8859-1"?><!--HTTP server plugin config file for the cell localhostCell01 generated on 2016.12.14 at 06:53:13 PM IST-->
            <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="c:\Program Files\IBM\WebSphere\Plugins\logs\http_plugin.log"/>
               <Property Name="ESIEnable" Value="true"/>
               <Property Name="ESIMaxCacheSize" Value="1024"/>
               <Property Name="ESIInvalidationMonitor" Value="false"/>
               <Property Name="ESIEnableToPassCookies" Value="false"/>
               <Property Name="PluginInstallRoot" Value="c:\Program Files\IBM\WebSphere\Plugins\"/>
               <VirtualHostGroup Name="default_host">
                  <VirtualHost Name="*:9080"/>
                  <VirtualHost Name="*:80"/>
                  <VirtualHost Name="*:9443"/>
                  <VirtualHost Name="*:5060"/>
                  <VirtualHost Name="*:5061"/>
                  <VirtualHost Name="*:443"/>
                  <VirtualHost Name="*:9061"/>
                  <VirtualHost Name="*:9044"/>
                  <VirtualHost Name="*:9062"/>
                  <VirtualHost Name="*:9081"/>
                  <VirtualHost Name="*:9444"/>
                  <VirtualHost Name="*:9045"/>
               </VirtualHostGroup>
               <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="false" LoadBalance="Round Robin" Name="cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
                  <Server CloneID="1b3q78g4e" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode01_member1" ServerIOTimeout="60" WaitForContinue="false">
                     <Transport Hostname="localhost" Port="9080" Protocol="http"/>
                     <Transport Hostname="localhost" Port="9443" Protocol="https">
                        <Property Name="keyring" Value="c:\Program Files\IBM\WebSphere\Plugins\etc\plugin-key.kdb"/>
                        <Property Name="stashfile" Value="c:\Program Files\IBM\WebSphere\Plugins\etc\plugin-key.sth"/>
                     </Transport>
                  </Server>
                  <Server CloneID="1b3q78ihf" ConnectTimeout="5" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="localhostNode02_member2" ServerIOTimeout="60" WaitForContinue="false">
                     <Transport Hostname="localhost" Port="9081" Protocol="http"/>
                     <Transport Hostname="localhost" Port="9444" Protocol="https">
                        <Property Name="keyring" Value="c:\Program Files\IBM\WebSphere\Plugins\etc\plugin-key.kdb"/>
                        <Property Name="stashfile" Value="c:\Program Files\IBM\WebSphere\Plugins\etc\plugin-key.sth"/>
                     </Transport>
                  </Server>
                  <PrimaryServers>
                     <Server Name="localhostNode01_member1"/>
                  </PrimaryServers>
                  <BackupServers>
                     <Server Name="localhostNode02_member2"/>
                  </BackupServers>
               </ServerCluster>
               <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="false" LoadBalance="Round Robin" Name="dmgr_localhostCellManager01_Cluster" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
                  <Server ConnectTimeout="0" ExtendedHandshake="false" MaxConnections="-1" Name="localhostCellManager01_dmgr" ServerIOTimeout="0" WaitForContinue="false"/>
                  <PrimaryServers>
                     <Server Name="localhostCellManager01_dmgr"/>
                  </PrimaryServers>
                  <BackupServers/>
               </ServerCluster>
               <UriGroup Name="default_host_cluster_URIs">
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/*.jsp"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/*.jsv"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/*.jsw"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/j_security_check"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/IBM_WS_SYS_RESPONSESERVLET/ibm_security_logout"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppamanager/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppaadmin/*"/>
                  <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/manager/1ppaauthor/*"/>
               </UriGroup>
               <Route ServerCluster="cluster" UriGroup="default_host_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>

1 个答案:

答案 0 :(得分:2)

如果具有关联性的JVM在响应期间关闭或无法访问,或返回HTTP 503,则WAS WebServer插件会将后续请求发送到其他JVM。

如果配置负的ServerIOTimeout,并且响应超时,则关联也将被破坏。

'失败'的JVM无法将工作发送到其他JVM本身。