简体   繁体   English

Web应用程序自动安装

[英]web application auto install

I need to have an autoinstall/update a web application running on JBoss 6. 我需要自动安装/更新在JBoss 6上运行的Web应用程序。

I need at least to: * stop the server * copy the war in the deployment directory * apply DB update scripts * start the server 我至少需要:*停止服务器*复制部署目录中的war *应用数据库更新脚本*启动服务器

Do you know an tool or open source project for that? 你知道一个工具或开源项目吗?

Thx Christophe Christ Christop

Most Servlet containers have the ability to deploy without stopping the server. 大多数Servlet容器都能够在不停止服务器的情况下进行部署。 Some do it by dropping the WAR file in a specific directory which is polled by the webserver (if configured properly) while others expose "upload" web APIs. 有些人通过将WAR文件放在由Web服务器轮询的特定目录中(如果配置正确)而其他人公开“上传”Web API。

JBoss typically uses Tomcat as its servlet container. JBoss通常使用Tomcat作为其servlet容器。 While I don't know which version your version of JBoss is using, Tomcat has supported deploying on a running server for a very long time. 虽然我不知道您的JBoss版本使用的是哪个版本,但Tomcat已经支持在正在运行的服务器上部署很长时间。 Perhaps the documentation for Tomcat 5.5 is enough for you to determine what changes (if any) you need to make. 也许Tomcat 5.5的文档足以让您确定需要进行哪些更改(如果有)。

In the event that you really need to stop the server Tomcat has the ability to stop the server from an external program (it only requires the right kind of message to be sent); 如果您确实需要停止服务器,Tomcat可以从外部程序停止服务器(它只需要发送正确类型的消息); however, once stopped, Tomcat can't receive a "startup" message, it will have to be started manually. 但是,一旦停止,Tomcat就无法收到“启动”消息,它必须手动启动。

A better solution would be to detect when the application started by looking at servlet lifecycle events, and then to "check" the database upon a "first started up" event. 更好的解决方案是通过查看servlet生命周期事件来检测应用程序何时启动,然后在“首次启动”事件时“检查”数据库。 In the off chance that your database detection shows the database doesn't match the expected version, apply the changes. 如果数据库检测显示数据库与预期版本不匹配,请应用更改。 After the database detection shows the database is up-to-date, then start normal request processing. 数据库检测显示数据库是最新的后,然后开始正常的请求处理。 This isolates the code within your web application in such a manner that allows for easy deployment and upgrades, although it does mean more work in tailoring the application to encapsulate it's own database maintenance duties. 这使得Web应用程序中的代码以允许轻松部署和升级的方式隔离,尽管它确实意味着在定制应用程序以封装其自己的数据库维护职责方面有更多工作。

In the event that such a technique isn't an option, you will have to rely on an external tool to get the job done. 如果这种技术不是一种选择,您将不得不依靠外部工具来完成工作。 Typically such a tool requires heavy integration of resources (sometimes across multiple machines). 通常,这样的工具需要大量集成资源(有时跨多台机器)。 In such a case, an Enterprise Job Scheduler, or a workflow engine (with your own written adapters) is generally applied to solve the issues at hand. 在这种情况下,企业作业调度程序或工作流引擎(使用您自己编写的适配器)通常用于解决手头的问题。

For information, we finally implemented our own solution. 有关信息,我们最终实施了自己的解决方案。 Basically 基本上

  1. One job downloads from a FTP a ZIP file containing an installer application written in Java 一个作业从FTP下载包含用Java编写的安装程序应用程序的ZIP文件
  2. One unzipped, the installer is run. 一个解压缩,安装程序运行。 This one executes SQL update scripts, then deploy the WAR file using the JBoss JMX API. 这个执行SQL更新脚本,然后使用JBoss JMX API部署WAR文件。 However for JBoss cluster support, we had to write our own MBean in order to copy the WAR file on each node. 但是,对于JBoss集群支持,我们必须编写自己的MBean才能在每个节点上复制WAR文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从命令行“ MVN安装”时,如何配置Maven Web应用程序以在Glassfish上自动部署? - How do I configure a maven web application to auto-deploy on glassfish when I “mvn install” from command line? 在Spring Web应用程序中登录后自动提交 - Auto submitting after login in Spring web application 整个Web应用程序的自动完成功能 - Auto complete feature on whole web application 自动部署Java(守护程序或Web)应用程序工具 - Auto deployment java (daemon or web) application tool 如何安装第一个Ninja Web Framework应用程序? - How to install the first Ninja Web Framework application? 从应用程序安装Java Web Start - Install Java Web Start from an Application 使Web应用程序自动确定并了解其版本 - Make the web application auto-determine and know its version 在非 Web Spring 引导应用程序中自动配置 ClientRegistrationRepository - auto-configure ClientRegistrationRepository in a non-web Spring Boot application Tomcat 9.0:安装后部署 Web 应用程序时出错 - Tomcat 9.0: Error deploying web application after install 通过install4j安装程序在JBoss上部署Web应用程序的步骤 - Steps to deploy web application on JBoss via install4j installer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM