部署应用程序时无需取消部署前一个应用程序并且无需停机?
我在 Web 应用程序中使用 Glassfish Java 和 JSP over MySQL。许多在线用户使用此网络应用程序,该网站不应关闭。
当我想要部署一个新的 war 文件时,我应该在服务器上为我的应用程序取消部署并部署新的战争文件。
我的问题是;
是否有任何技术不需要取消部署我的应用程序,只需更改适当的类,这样就不需要再次重新部署它?
I use Glassfish Java, and JSP over MySQL for my web applications. Many online people uses this web application and that web-site should not be down.
When I want to deploy a new war file, I should undeploy and deploy the new one for my application at server.
My question is that;
Is there any technology that doesn't need to undeploy my application and just change the appropriate classes so no need to redoploy it again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一些 Java 技术可以让您动态替换类(例如 JRebel)。但由于您已经在使用 Glassfish,因此您应该开始使用 glassfish 中内置的集群。您需要 2.1 或 3.1,因为 3.0 不支持集群。对于 Glassfish 集群,您可以使用负载平衡器(Apache、Sun Web Server、硬件(Big IP、Coyote)等)在集群节点之间分配负载。当您想要升级应用程序时,从技术上讲,您可以一次在一个节点上进行升级。设置集群并不是世界上最简单的事情,但它是可行的,并且会给您带来一些巨大的好处。您将能够通过添加新硬件甚至使用亚马逊(或其他任何人)云服务来扩展负载。即使其中一个节点上的硬件发生故障,您也能够保持站点运行。
就我个人而言,我正在从 Glassfish 2.1 转换到 3.1。到目前为止,我更喜欢 Glassfish 3.1 集群的管理,但我个人无法保证它将如何在生产中运行,尽管我对此抱有很高的期望。
http://download.oracle.com/docs /cd/E18930_01/html/821-2432/gktqx.html#gktob
There are java technologies that would allow you to replace classes on the fly (like JRebel). But since you're using Glassfish already, you should just start using clustering which is built into glassfish. You'll need either 2.1 or 3.1, as 3.0 does not support clustering. With a Glassfish cluster, you have a load balancer (Apache, Sun Web Server, hardware (Big IP, Coyote), etc) distribute the load among your cluster nodes. When you want to upgrade the app, you can technically do it one node at a time. Setting up the cluster is not the easiest thing in the world, but it is doable and it would get you some great benefits. You'll be able to scale the load by adding new hardware and even using Amazon (or whoever) cloud services. You'll be able to keep your site running even if the hardware fails on one of the nodes.
Personally I'm in the middle of converting from Glassfish 2.1 to 3.1. So far I like the management of the Glassfish 3.1 cluster much better, but I can't personally vouch for how it will run in production, though I have high expectations.
http://download.oracle.com/docs/cd/E18930_01/html/821-2432/gktqx.html#gktob
Jim 是对的,目前最好的解决方案是使用集群并执行手动滚动升级。
但实际上正在开展工作来满足您的需求。我们正在在单个独立实例中开发滚动升级功能。简而言之(因为规范尚未发布),它将允许您从一个应用程序版本切换到另一个应用程序版本(请参阅应用程序版本控制和启用命令),而无需停机。敬请关注。
Jim is right, the best solution is currently to use a cluster and perform a manual rolling-upgrade.
But there is actually work ongoing to address your needs. We are working on a rolling-upgrade feature in a single standalone instance. To sum up in a nutshell (as the specifications have not been published yet), it will let you switch from an application version to another (see application versioning and the enable command) with no downtime. Stay tuned.