Jboss作为7.1部署,零停机时间

时间:2014-08-25 10:12:42

标签: java deployment jboss cluster-computing

我有一个带有2个节点的JBoss AS7集群。我希望零停机时间“更新”我的应用程序。 [此应用程序尚未部署在生产中,处于开发阶段]

就我而言,在某些情况下,我需要进行计划外部署。这种情况可能发生在一些基本逻辑变化中[这可能在一两年内发生一次,在所有这些情况下都不会有会话结构更新,没有数据库结构更改等。]

以下是我的计划中的配置/步骤。

配置:

1.Session Replication is enabled.
2.Load balancing is done with Apache mod_jk.
3.JBoss AS 7.1 in standalone mode.

步骤:

1. Take out node1 from the cluster.
2. Deploy new war file in node1.
3. Attach node1 in cluster.
4. Take out node2 from the cluster.
5. Deploy new war file in node2
6. Attach node2 in cluster.

步骤3和步骤4之间的时间间隔可能会导致不一致,因为两个版本的应用程序将同时启动并运行。

实现零停机时间的其他选择是什么?

[这是一个基于Spring的Web应用程序]

谢谢。

2 个答案:

答案 0 :(得分:5)

有两种典型的零停机时间部署方法。

1。 Blue-Green Deployments

我们的想法是拥有两个版本的生产环境。然后,您可以将路由器切换到新的环境。或者您可以将DNS更改为指向新的IP / CNAME(AWS Beanstalk uses this way)或IP交换(Azure cloud service uses this way)。

enter image description here

2。 CanaryRelease

此方法首先将新版本推广到生产服务器的子网,并在您乐意这样做时路由到所有用户。

enter image description here

至于你的情况,它更像CanaryRelease,你有两个版本在同一时间。如果应用程序版本的一致性对您很重要,则可以选择Blue-Green Deployments。您可以同时取出node2并附加node1,以便实际切换版本。

答案 1 :(得分:0)

easy-deploy完全按照一个命令执行。

检查this answer

相关问题