Azure WebApp - Tomcat 关闭

Azure WebApp - Tomcat shutdown

我有一些 Azure Java WebApp。 "Newest Tomcat 8" 是我们使用的应用程序容器。 选项 "Always On" 已为我们的网络应用程序启用。

每天tomcat正常关机:

17-Dec-2015 07:07:32.867 INFO [Thread-114] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-127.0.0.1-1170"]
17-Dec-2015 07:07:32.976 INFO [Thread-114] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina

当我们在我们的应用程序中进行首次访问时tomcat自动启动

17-Dec-2015 09:45:47.802 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 498942 ms

这种事每天都在发生。

还有其他人遇到过这个问题吗? 我怎样才能防止 tomcat 关机?

提前致谢!

据我所知,这似乎不是 Azure 的问题。如果您为您的 webapp 启用选项 Always On,则 Azure 不会在 webapp 闲置一段时间后卸载 webapp。

这是 Azure 官方文档 https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/ 中对选项 Always On 的描述。

Always On. By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. In Basic or Standard mode, you can enable Always On to keep the app loaded all the time. If your app runs continuous web jobs, you should enable Always On, or the web jobs may not run reliably.

但是,问题可能是由某些情况引起的,例如错误处理异常。

作为参考,有一个已回答的线程 (Tomcat randomly shuts down with an AbstractProtocol pause after mild usage) 解释了这个问题。您可以尝试查看它并检查您的问题。

如有任何疑问,请随时告诉我。

我们解决了这个问题。 我们的应用程序配置为将所有流量重定向到 https。

问题是 alwaysOn 服务没有遵循重定向到 https 并在没有 ping 应用程序层的情况下停止在 Web 服务器层工作。

我们将重写 URL 更改为不将 https 重定向到 tomcat 默认根应用程序,这将导致 Worker/Java 进程由于 AlwaysON 而一直运行平