【问题标题】:ERROR: Running application failed - Spring boot + Boxfuse/AWS错误:运行应用程序失败 - Spring boot + Boxfuse/AWS
【发布时间】:2016-01-27 13:43:19
【问题描述】:

我正在尝试使用 boxfuse 在 AWS 上运行我的 Spring Boot 应用程序。 我也遵循了 Spring 的 following 教程(第 54.4 节)和 Boxfuse 的 Get Started

当我运行以下命令时

boxfuse run target\digigram-0.1.0.jar -env=prod

我得到以下几行

Waiting for AWS to boot Instance i-74fe7fc8 and Payload to start at http://52.28.94.159:8080/ ...
WARNING: Healthcheck (http://52.28.94.159:8080/) returned 404 instead of 200. Retrying for the next 120 seconds ...
Terminating instance i-74fe7fc8 ...

它以

结尾
Destroying Security Group sg-0ed6f667 ...
ERROR: Deployment of pantera160/digigram:0.0.0.1453900589995 failed in prod:Payload of Instance i-74fe7fc8 came up at http://52.28.94.159:8080/
with HTTP 404 (expected 200) => ensure your application responds with an HTTP 200 at http://52.28.94.159:8080/ or adjust the healthcheck configuration (healthcheck.path, healthcheck.timeout, ...) to fit your application
ERROR: Running pantera160/digigram:0.0.0.1453900589995 failed!

我不明白问题出在哪里。我是否必须更改 AWS 或我的应用程序中的某些内容或...

任何帮助将不胜感激。

注意:
我正在使用 AWS 的免费计划,这可能是问题所在吗?

【问题讨论】:

    标签: java amazon-web-services spring-boot cloudcaptain


    【解决方案1】:

    Boxfuse 可确保您的应用程序的正确版本保持正常运行,并且不会被错误版本所取代。只有当新版本通过 Boxfuse 的健康检查时,Boxfuse 才会重新为其分配应用程序的弹性 IP。一旦完成,Boxfuse 就会终止旧版本的实例。

    为了验证您的应用程序的新版本是否正确出现,Boxfuse 期望新版本实例的运行状况检查路径返回 HTTP 200。

    没有执行器的常规 Spring Boot 应用程序的默认健康检查路径是 /。您的应用目前回答 404 而不是 200。

    您有多种选择来解决此问题:

    • 向您的应用添加一个映射到/ 的控制器,当您的应用正常启动时返回 HTTP 200。
    • 将 Boxfuse 的 healthcheck.path 更改为其他路径,当您的应用正确启动时,该路径确实会响应 HTTP 200。
    • 通过将 healthcheck 设置为 false 来禁用 Boxfuse 的运行状况检查(不推荐,因为这会有效地阻止 Boxfuse 检查您的应用程序是否正确启动)

    选择其中一个选项,您的应用就会如您所愿正确启动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-26
      • 2018-11-23
      • 1970-01-01
      • 2018-03-30
      • 2020-05-14
      • 2021-11-11
      • 2018-12-31
      相关资源
      最近更新 更多