Switching progressively the HTTP traffic to the new cluster, with session affinity
You must modify the HTTP plug-in file to route the HTTP traffic to the new installation of IBM MobileFirst Platform Foundation
The following procedure requires modifications of the HTTP plug-in file, plugin-cfg.xml. Before you perform this procedure in production, you must test it in a test environment.
Important: If errors occur during these steps, it would result in incorrect traffic routing and might impact all applications in the cell of the WebSphere Application Server.
The procedure to route the traffic is based on the following properties of the web plug-in:
- The plug-in routes traffic to a server cluster based on the definition of the cluster members in its <ServerCluster> listing. The HTTP plug-in has no other information about the target servers other than what is defined in the plug-in configuration file. Even if a collection of servers is defined in a WebSphere cell as being in two separate clusters, they can be defined in one cluster from the point of view of the plug-in. With this property, we can use the plug-in to route traffic between the clusters cluster_WL61 and cluster_WL61FP1.
- The LoadBalanceWeight attribute of the Server element is used to statically assign a weighting factor that is associated with the round-robin distribution of new requests among the servers that are in a cluster. When this attribute is set to zero, this is a signal to the plug-in to stop sending new requests to that application server. Requests that are associated with existing sessions on that server continue to flow to it, but as those sessions get terminated, the server stops having any active sessions.
- The plugin-cfg.xml file is re-read periodically by the plug-in to the HTTP server, with a default refresh interval of 1 minute.
For more information about updating the plugin-cfg.xml file, see Set up IBM MobileFirst Platform Foundation in WebSphere Application Server cluster environment.
- Progressively, set the weight of a server in the cluster_WL61 to 0.
- Move a server of the cluster cluster_WL61FP1 to the definition of cluster_WL61, with a weight of 2.
- Wait for the server in cluster cluster_WL61 to drain so that most of the session terminates and that it stops using CPU resources.
- Repeat the procedure for the next server.
Example
Before you start the procedure:
<ServerCluster LoadBalance="Round Robin" Name="cluster_WL61"> <Server CloneID="a8er1kj2" LoadBalanceWeight="2" Name="ServerWL61_1"> <Transport Hostname="test1.ibm.com" Port="9081" Protocol="http"/> </Server> <Server CloneID="a8er2kd3" LoadBalanceWeight="2" Name="ServerWL61_2"> <Transport Hostname="test2.ibm.com" Port="9082" Protocol="http"/> </Server> <Server CloneID="a8es3as1" LoadBalanceWeight="2" Name="ServerWL61_3"> <Transport Hostname="test3.ibm.com" Port="9083" Protocol="http"/> </Server> <PrimaryServers> <Server Name="ServerWL61_1"/> <Server Name="ServerWL61_2"/> <Server Name="ServerWL61_3"/> </PrimaryServers> </ServerCluster> [...] <ServerCluster LoadBalance="Round Robin" Name="cluster_WL61FP1"> <Server CloneID="a8sd1kj2" LoadBalanceWeight="0" Name="ServerWL61FP1_1"> <Transport Hostname="test1.ibm.com" Port="9084" Protocol="http"/> </Server> <Server CloneID="a8as2kd3" LoadBalanceWeight="0" Name="ServerWL61FP1_2"> <Transport Hostname="test2.ibm.com" Port="9085" Protocol="http"/> </Server> <Server CloneID="a8qa3as1" LoadBalanceWeight="0" Name="ServerWL61FP1_3"> <Transport Hostname="test3.ibm.com" Port="9086" Protocol="http"/> </Server> <PrimaryServers> <Server Name="ServerWL61FP1_1"/> <Server Name="ServerWL61FP1_2"/> <Server Name="ServerWL61FP1_3"/> </PrimaryServers> </ServerCluster> [...] <!-- Example of the UriGroups and Routes. They are not changed while you switch the traffic --> <UriGroup Name="prod_vhost_cluster_WL61_URIs"> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklightconsole/*"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklightadmin/*"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklight/*"/> </UriGroup> <Route ServerCluster="ClusterX" UriGroup="prod_vhost_cluster_WL61_URIs" VirtualHostGroup="default_host"/> <UriGroup Name="test_vhost_cluster_WL61FP1_URIs"> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklightconsole/*"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklightadmin/*"/> <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/worklight/*"/> </UriGroup> <Route ServerCluster="ClusterY" UriGroup="test_vhost_cluster_WL61FP1_URIs" VirtualHostGroup="test_host"/>Move a server:
<ServerCluster LoadBalance="Round Robin" Name="cluster_WL61"> <!-- Server ServerWL61_1 has a weight of 0 --> <Server CloneID="a8er1kj2" LoadBalanceWeight="0" Name="ServerWL61_1"> <Transport Hostname="test1.ibm.com" Port="9081" Protocol="http"/> </Server> <Server CloneID="a8er2kd3" LoadBalanceWeight="2" Name="ServerWL61_2"> <Transport Hostname="test2.ibm.com" Port="9082" Protocol="http"/> </Server> <Server CloneID="a8es3as1" LoadBalanceWeight="2" Name="ServerWL61_3"> <Transport Hostname="test3.ibm.com" Port="9083" Protocol="http"/> <!-- Server ServerWL61F1_1 added to the cluster_WL61 in the plugin-cfg file --> <Server CloneID="a8sd1kj2" LoadBalanceWeight="2" Name="ServerWL61FP1_1"> <Transport Hostname="test1.ibm.com" Port="9084" Protocol="http"/> </Server> <PrimaryServers> <Server Name="ServerWL61_1"/> <Server Name="ServerWL61_2"/> <Server Name="ServerWL61_3"/> <Server Name="ServerWL61FP1_1"/> </PrimaryServers> </ServerCluster> [...] <ServerCluster LoadBalance="Round Robin" Name="cluster_WL61FP1"> <Server CloneID="a8as2kd3" LoadBalanceWeight="0" Name="ServerWL61FP1_2"> <Transport Hostname="test2.ibm.com" Port="9085" Protocol="http"/> </Server> </Server> <Server CloneID="a8qa3as1" LoadBalanceWeight="0" Name="ServerWL61FP1_3"> <Transport Hostname="test3.ibm.com" Port="9086" Protocol="http"/> </Server> <PrimaryServers> <Server Name="ServerWL61FP1_2"/> <Server Name="ServerWL61FP1_3"/> </PrimaryServers> </ServerCluster>End of the transition:
<ServerCluster LoadBalance="Round Robin" Name="cluster_WL61"> <!-- Server ServerWL61_X have a weight of 0 --> <Server CloneID="a8er1kj2" LoadBalanceWeight="0" Name="ServerWL61_1"> <Transport Hostname="test1.ibm.com" Port="9081" Protocol="http"/> </Server> <Server CloneID="a8er2kd3" LoadBalanceWeight="0" Name="ServerWL61_2"> <Transport Hostname="test2.ibm.com" Port="9082" Protocol="http"/> </Server> <Server CloneID="a8es3as1" LoadBalanceWeight="0" Name="ServerWL61_3"> <Transport Hostname="test3.ibm.com" Port="9083" Protocol="http"/> <!-- Server ServerWL61F1_X added to the cluster_WL61 in the plugin-cfg file --> <Server CloneID="a8sd1kj2" LoadBalanceWeight="2" Name="ServerWL61FP1_1"> <Transport Hostname="test1.ibm.com" Port="9084" Protocol="http"/> </Server> <Server CloneID="a8as2kd3" LoadBalanceWeight="2" Name="ServerWL61FP1_2"> <Transport Hostname="test2.ibm.com" Port="9085" Protocol="http"/> </Server> </Server> <Server CloneID="a8qa3as1" LoadBalanceWeight="2" Name="ServerWL61FP1_3"> <Transport Hostname="test3.ibm.com" Port="9086" Protocol="http"/> </Server> <PrimaryServers> <Server Name="ServerWL61_1"/> <Server Name="ServerWL61_2"/> <Server Name="ServerWL61_3"/> <Server Name="ServerWL61FP1_1"/> <Server Name="ServerWL61FP1_2"/> <Server Name="ServerWL61FP1_3"/> </PrimaryServers> </ServerCluster> [...] <ServerCluster LoadBalance="Round Robin" Name="cluster_WL61FP1"> <PrimaryServers> </PrimaryServers> </ServerCluster>
Parent topic: Performing a rolling upgrade to install a fix pack