如何强制 WebSphere Liberty 按特定顺序启动 WAR [英] How to force WebSphere Liberty to start WARs in certain order

查看:29
本文介绍了如何强制 WebSphere Liberty 按特定顺序启动 WAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道如何强制 WebSphere Liberty 按给定顺序启动 WAR(单独部署或在单个 EAR 文件中).默认情况下,WLP 是并行启动的,没有关于如何调整它的信息.

Do you know how to force WebSphere Liberty to start WARs (deployed separetly or within single EAR file) in given order. By default WLP is starting it in parallel and there is no information how to tweak it up.

我知道在完整的 WebSphere Application Server 中存在/存在这样的选项来定义 deployment.xml 中的起始权重,但在 WLP 中似乎缺少它.

I know that in full WebSphere Application server there was/is such option to define starting weight in deployment.xml but in WLP it seems to be missing.

推荐答案

目前,在 Liberty 中没有开箱即用的方法来控制应用程序的启动顺序.

At the moment, there is no out-of-the-box way to control application start order in Liberty.

一些替代选项可能是:

拆分服务器,以便每个服务器只有 1 个应用程序,然后使用容器编排层在服务器级别强制排序.

Split apart the server so you only have 1 app per server, then use a container orchestration layer to mandate an ordering at the server level.

使用 ${server.config.dir}/dropins/ 文件夹并使用脚本以受控顺序将应用程序移动到该文件夹​​中.例如:

Use the ${server.config.dir}/dropins/ folder and move applications into that folder in a controlled order using scripting. For example:

mv firstApp.war /path/to/server/dropins/
# wait some amount of time as a heuristic
sleep 5
mv nextApp.war /path/to/server/dropins/

3) 使用 autoStart=false 并从 ApplicationMBean 开始

如果您在应用程序上设置 <application autoStart="false">,您可以通过 JMX 调用 ApplicationMBean.start() 来控制启动顺序.请参阅 ApplicationMBean 文档 以及 在 Liberty 上使用 JMX MBean.

3) Use autoStart=false and start with ApplicationMBean

If you set <application autoStart="false"> on your applications, you can control the start ordering by invoking ApplicationMBean.start() via JMX. See the ApplicationMBean doc as well as Working with JMX MBeans on Liberty.

这个请求已经出现了几次,所以我们打开了这个github问题讨论内置解决方案.

This request has come up a few times though, so we've opened this github issue to discuss a built-in solution.

这篇关于如何强制 WebSphere Liberty 按特定顺序启动 WAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆