【发布时间】:2020-07-09 08:36:12
【问题描述】:
我在使用 CloudFoundry 方面并没有真正的经验。我知道如何使用它来将服务连接到应用程序,以及推送战争、日志文件等。所以标准的东西。 但是当谈到 CloudFoundry 的配置和行为时,我的知识就结束了。
我的问题是,在我的应用程序启动并且 New Relic 完成后,它正在记录它用作收集器的内容等。CloudFoundry Cell 正在停止实例。 我使用 spring 集成,因为关闭 jvm 的信号而关闭了所有东西。 我还为某些作业禁用了数据库中的几个布尔值。 到目前为止,一切正常,一切正常。
一旦关闭所有内容,CloudFoundry 就会开始销毁当前实例的容器。之后日志条目说销毁成功。 但应用程序仍在运行以及实例。 我的应用程序仍然在这里不时记录一些东西(不是关闭的作业),并且该实例似乎仍然存在并且没有被“更新”。
有人知道为什么会这样吗?我是否必须在 spring 中实现一些阻止实例被破坏的东西?或者这是我需要进行的 CloudFoundry 配置?
一个奇怪的事情是,它只发生一次同行周。每个星期三晚上到星期四早上。几乎在同一时间。
编辑: 这是我删除所有敏感信息的日志
Some logs which indicate that the app is still running as expected.
// I think this is the part where i gets interesting.
2020-07-09T00:44:09.87+0200 [CELL/0] OUT Cell XXX requesting replacement for instance XXX
2020-07-09T00:44:10.37+0200 [CELL/0] OUT Cell XXX creating container for instance XXX
2020-07-09T00:44:12.17+0200 [CELL/0] OUT Cell XXX successfully created container for instance XXX
Downloading droplet, starting the application and notice that it was shutted down unexpectedly. The indication for that is a flag in the database that hasn't been set to true which would happen during a proper shutdown.
2020-07-09T00:45:14.70+0200 [CELL/0] OUT Container became healthy
Some New Relic information which are not important for this question.
2020-07-09T00:45:19.94+0200 [CELL/0] OUT Cell XXX stopping instance XXX
This is the part where the application shuts down it's listeners and jobs.
2020-07-09T00:45:25.70+0200 [APP/PROC/WEB/0] OUT Exit status 143
2020-07-09T00:45:25.70+0200 [CELL/0] OUT Cell XXX destroying container for instance XXX
2020-07-09T00:45:25.88+0200 [PROXY/0] OUT Exit status 137
2020-07-09T00:45:26.07+0200 [CELL/0] OUT Cell XXX successfully destroyed container for instance XXX
2020-07-09T00:49:36.17+0200 [APP/PROC/WEB/0] OUT 2020-07-09T00:49:36,178+0200 Some log entry which indicates that the app is still alive
完成后,应用程序仍在运行(中间没有重新启动),可以通过将标志设置为 true 再次启动所有作业,该标志在关闭挂钩的代码中设置为 false,因此没有新作业将在应用关闭时启动。
【问题讨论】:
-
您能显示您的
cf logs、清单和cf app输出吗?您使用的是蓝绿部署吗? -
@jAC 我编辑了问题并添加了我怀疑的日志,但没有回答如何解决它,如果我的怀疑是真的。
标签: java spring cloud spring-integration cloud-foundry