JBoss部署无需重启服务器
我有一个关于软件部署的问题。我们使用的是 JBoss 4.2.3。
请让我解释一下我现在正在执行的典型手动部署过程:
- 将 EAR、WAR 和 JAR 复制到服务器。
- 停止服务器。
- 将 EAR、WAR 和 JAR 复制到部署文件夹。
- 运行数据库更新脚本。
- 启动服务器。
我正在寻找一种避免服务器重新启动的方法。因为它造成了很多问题和很多不便。例如,我必须向一个大列表发送电子邮件才能安排服务器停机时间。
另一个问题是,我们有两台服务器通过 SOAP 相互远程通信,如果其中一台服务器出现故障,可能会导致一些数据同步问题。
热部署对我来说并没有真正起作用。有时我会遇到类加载器异常,有时会出现缓存问题。
我正在考虑集群,但不太确定它是否有效。
有人有类似的经历吗?有什么解决方案或建议吗?
非常感谢。
ps 我应该将其发布在 serverfault 而不是 stackoverflow 上吗? (我更喜欢这里,因为我是开发人员:)
I have a problem regarding to the software deployment. We're using JBoss 4.2.3.
Please let me explain a typical manual deployment process I'm doing now:
- Copy EARs, WARs and JARs to server.
- Stop server.
- Copy EARs, WARs and JARs to deploy folder.
- Run database update script.
- Start server.
I was looking for a way to avoid the server restart. Because it caused a lot of problem and a lot of inconvenience. For example, I had to send emails to a big list in order to schedule a server down time.
The other problem is, we have 2 servers which communicate with each other remotely via SOAP, if one server goes down, it will likely cause some data synchronization problems.
The hot deployment didn't really work for me. Sometimes I got class loaders exceptions, and sometimes cache issues.
I was considering clustering but not quite sure if it would work or not.
Does anyone have any similar experience? Any solutions or suggestions?
Many thanks in advance.
p.s. should I post this on serverfault instead of stackoverflow? (I prefer here because I'm a developer :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果热部署不适合您,并且重新启动也不是一种选择,那么我可以建议的唯一另一件事是使用故障转移进行集群 - 运行两台服务器而不是一台,并且您的 SOAP 请求在它们之间实现负载平衡。当您需要执行升级时,您可以关闭一台服务器,升级,启动它,关闭第二台服务器,升级它,然后启动它。
如果你做对了(这很棘手,但可行),那么你就没有停机时间。您必须确保服务器在滚动升级期间可以共存,并确保您的数据库升级向后兼容,但这都是可以实现的。
If hot-deployment isn't working for you, and restarts are not an option, then the only other thing I can suggest is clustering with failover - run two servers rather than one, with your SOAP requests load-balanced across them both . When you need to perform an upgrade, you shut down one server, upgrade, start it up, shutdown the 2nd server, upgrade that, and start it back up.
If you do it right (it's tricky, but do-able), then you have no down-time. You have to make sure the servers can co-exist during the rolling upgrades, and make sure your database upgrades are backwards compatible, but that can all be achieved.