Show Table of Contents
19.5.7. 在群集间移植流量
概述
在用 JBoss EAP 6 创建新的群集后,作为升级过程的一部分,您可能希望从之前的群集移植流量到新的群集里。在本节里,您会看到用于移植流量且只造成最短时间中断或停机的策略。
预备条件
- 设置的新群集 第 19.5.2 节 “配置
mod_cluster子系统”(我们将这个群集称为 Cluster NEW)。 - 设置过剩的旧群集(我们将这个群集称为 Cluster OLD)。
过程 19.10. 群集的升级过程
- 用预备条件里描述的步骤设置新的群集。
- 在 Cluster NEW 和 Cluster OLD 里,请确保配置选项
sticky-session设置为true(默认为true)。启用这个选项意味着对群集的所有新的请求都将继续发送到该节点。/profile=full-ha/subsystem=modcluster/mod-cluster-config=configuration/:write-attribute(name=sticky-session,value=true)
- 通过这里描述的过程添加 Cluster NEW 里的节点到 mod_cluster 配置里:第 19.5.6 节 “配置 mod_cluster 工作节点”。
- 配置负载平衡器(mod_cluster)来停止群集 Cluster OLD 里的单个上下文。停止上下文(对比禁用它)将允许单个上下文优雅地关闭(最终关闭整个节点)。现有的会话将仍被服务,但不会有新的会话被指引到这些节点。被停止的上下文可能需要几分钟才能完成停止动作。您可以用下列 CLI 命令来停止某个上下文。用和您环境相关的值替换这些参数。
[standalone@localhost:9999 subsystem=modcluster] :stop-context(context=/myapp, virtualhost=default-host, waittime=50)
结果
您已经成功升级了 JBoss EAP 6 群集。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.