简体   繁体   English

Azure spring 启动应用程序服务不断重启

[英]Azure spring boot app service keeps restarting

I have spring boot app deployed to IIS / embedded tomcat as an azure app service.我将 spring 启动应用程序部署到 IIS / 嵌入 tomcat 作为 azure 应用程序服务。 When the app service is started the app logs show a restart occurs (new pid) about every 10 minutes for the same instance.当应用程序服务启动时,应用程序日志显示同一实例大约每 10 分钟重新启动一次(新 pid)。 After 90 minutes it will eventually deploy successfully. 90 分钟后,它最终会部署成功。 There's nothing i can see from the embedded tomcat logs nor org.springframework logs suggesting any issue, however on occasion it can start in under 2 mins.从嵌入式 tomcat 日志和 org.springframework 日志中我看不到任何提示任何问题的信息,但有时它可以在 2 分钟内启动。

Where else can I look for startup errors and is there a way I can increase the app service startup time as I don't know what is causing it to restart?我还可以在哪里查找启动错误?有什么方法可以增加应用程序服务的启动时间,因为我不知道是什么导致它重新启动?

You can try to set the configuration to Tomcat from App service> configuration >General setting based on your required version as below:您可以尝试将配置设置为 Tomcat 根据您所需的版本,从 App service> configuration > General setting 如下:

在此处输入图像描述

Also Thanks to Sreyas Posting your suggestion as an answer to help other community members.也感谢Sreyas发布您的建议作为帮助其他社区成员的答案。

"Sometimes the jar will take more time to start with the default startup command. It could be because it scannes the file system for configuration files since it uses -cp command to start the jar . “有时 jar 使用默认启动命令启动会花费更多时间。这可能是因为它扫描文件系统以查找配置文件,因为它使用-cp命令启动jar

java -cp app.jar org.springframework.boot.loader.JarLauncher

I fixed this issue by providing a startup command in the AppService->Configuration->General Settings->Startup command我通过在 AppService->Configuration->General Settings->Startup 命令中提供启动命令解决了这个问题

java -jar <path_of_jar> 

Altenatevely you can check the container logs also Please refer the link below. Altenatevely 你也可以检查容器日志请参考下面的链接。 [https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs] [https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs]

If you are logging into a file, then you can SSH[Azure portal->AppService-> left side there is an SSH option ] to the container and tail the logs directly, but sometimes it is very hard to get into a container using ssh since it is not starting properly."如果您正在登录一个文件,那么您可以通过 SSH [Azure 门户->AppService-> 左侧有一个 SSH 选项] 到容器并直接tail日志,但有时很难使用 ssh 进入容器因为它没有正常启动。”

For more information please refer this on going discussion over MS Q&A for similar issue: Azure app service restart loop & Microsoft Documentation: HttpPlatformHandler Configuration Reference .有关更多信息,请参阅有关针对类似问题的 MS Q&A 的持续讨论: Azure 应用程序服务重启循环和 Microsoft 文档: HttpPlatformHandler 配置参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 应用程序服务为 Spring 引导返回 404 Java 8 based war - Azure app service returning 404 for Spring boot Java 8 based war Azure spring 开机 JPA - Azure spring boot JPA AWS secret manager Password Rotation Without Restarting Spring 引导应用程序 - AWS secret manager Password Rotation Without Restarting Spring boot application 控制 Azure Service Bus Message Listener 在 spring 开机启动或停止监听 Topic 或队列 - Control Azure Service Bus Message Listener to start or stop listening from the Topic or queue in spring boot 如何从 Spring 引导获取具有特定 label 的 Azure 应用程序配置功能标志的值? - How to get the value of Azure App Configuration Feature Flag with specific label from Spring boot? 如何在 Spring 启动时读取 Azure web 站点应用程序设置值 java class - How to read Azure web site app settings values in Spring boot java class 为什么它在 Azure AD 保护的 Spring 启动应用程序中被称为“APPROLE_Admin”而不是“Admin” - why it is called 'APPROLE_Admin' instead of 'Admin' in Spring boot App secured by Azure AD 部署Azure function到微软Azure中的应用服务 - Deploy Azure function to app service in Microsoft Azure 将带有wsHttpBinding的WCF服务迁移到Azure应用服务 - Migrating WCF service with wsHttpBinding to Azure App Service Spring 在 Google Cloud App Engine 上启动托管 - Spring Boot hosting on Google Cloud App Engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM