关于wildfly:wildfly-21中应用程序的部署
简介除了配置文件的批改之外,最重要的就是应用程序的部署了。本文将会解说如何在wildfly 21中,在Managed Domain和standalone两种模式中如何部署应用程序。 Managed Domain中的部署在managed domain模式下,服务是放在很多个server中启动的,而server是和server-group相关联的。同一个server-group下的server部署是统一的。 在managed domain模式下,须要先将要部署的应用程序上传到domain controller中,而后通过domain controller将其部署到一个或者多个server-group中。 当然咱们在domain controller中的cli环境中只须要一个deploy命令就能够做到下面的两步了。 比如说,咱们创立了一个应用程序叫做test-application.war,看下怎么进行部署: [domain@localhost:9990 /] deploy ~/Desktop/test-application.warEither --all-server-groups or --server-groups must be specified. [domain@localhost:9990 /] deploy ~/Desktop/test-application.war --all-server-groups'test-application.war' deployed successfully.在执行deploy命令的时候,须要指定部署到的server-groups名字,能够部署到所有的server-groups中,也能够指定特定的某些server-groups: [domain@localhost:9990 /] deploy ~/Desktop/test-application.war --server-groups=main-server-group,another-group'test-application.war' deployed successfully.部署实现之后,咱们能够通过cli来查看一下部署的状态: [domain@localhost:9990 /] /server-group=main-server-group/deployment=test-application.war:read-resource(include-runtime){ "outcome" => "success", "result" => { "enabled" => true, "name" => "test-application.war", "managed" => true, "runtime-name" => "test-application.war" }}deploy能够增加--force参数,用来降级或者替换现有的程序版本: [domain@localhost:9990 /] deploy ~/Desktop/test-application.war --all-server-groups --force'test-application.war' deployed successfully.如果想勾销部署,则能够应用undeploy: ...