如何强制WebSphere Liberty以特定顺序启动WAR

问题描述 投票:2回答:1

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

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

java-ee war websphere-liberty ear
1个回答
2
投票

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

一些备选方案可能是:

1)每台服务器使用1个应用程序

拆分服务器,使每个服务器只有1个应用程序,然后使用容器编排层来强制在服务器级别进行排序。

2)使用dropins + shell脚本

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

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 doc以及Working with JMX MBeans on Liberty


这个请求已经出现了几次,所以我们打开了this github issue来讨论内置的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.