16.5.6. Migrate Traffic between Clusters
After creating a new cluster using JBoss EAP 6, you may want to migrate traffic from a previous cluster to the new one as part of an upgrade process. In this task, you will see the strategy that can be used to migrate this traffic with minimal outage or downtime.
- A new cluster setup: Section 16.5.2, “Configure the
mod_clusterSubsystem” (We will call this cluster: Cluster NEW).
- An old cluster setup that is being made redundant (We will call this cluster: Cluster OLD).
Procedure 16.8. Upgrade Process for Clusters
- Setup your new cluster using the steps described in the prerequisites.
- In both Cluster NEW and Cluster OLD, make sure that the configuration option
sticky-sessionis set to
trueby default). Enabling this option means that all new requests made to a cluster node in either cluster will continue to go to that node.
- Add the nodes in Cluster NEW to the mod_cluster configuration individually using the process described here: Section 16.5.5, “Configure a mod_cluster Worker Node”
- Configure the load balancer (mod_cluster) to stop the individual contexts in Cluster OLD. Stopping contexts (as opposed to disabling them) in Cluster OLD will allow the individual contexts to shutdown gracefully (and eventually shutdown the whole node). Existing sessions will still be served, but no new sessions will be directed to those nodes. The stopped contexts may take several minutes to several hours to stop.You can use the following CLI command to stop a context. Replace the parameter values with values that are relevant in your environment.
[standalone@localhost:9999 subsystem=modcluster] :stop-context(context=/myapp, virtualhost=default-host, waittime=50)
You have successfully upgraded a JBoss EAP 6 Cluster.