amazon-web-services - 为 nginx SSL 添加 .ebextensions 后,SpringBoot 部署失败 - [执行命令 [app-deploy] 时发生错误]

标签 amazon-web-services spring-boot amazon-ec2 amazon-elastic-beanstalk

我有一个 SpringBoot 应用程序,它可以很好地部署到 AWS Beanstalk,并且默认的 nginx 代理工作,允许我通过端口 80 进行连接。

按照此处的说明操作:https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance.html ,并与我的另一个与此确切配置一起使用的项目进行验证,Beanstalk 无法部署应用程序并出现错误:
2020/05/29 01:27:56.418780 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForJavaApplication]. Stop running the command. Error: there is no Procfile and no .jar file at root level of your source bundle
我的 war 文件的内容是这样的:

app.war
    -.ebextensions
        -nginx/conf.d/https.conf
        -https-instance-single.config
        -https-instance.config
    -web-inf/

我的配置文件作为有效的 yaml 文件传递​​。 (这些文件与 AWS 文档中的文件以及在我的其他项目中使用的文件相同。)

我使用的是单个实例,端口 443 设置为打开。

这些是在各种日志文件中报告的错误:
----------------------------------------
/var/log/eb-engine.log
----------------------------------------
2020/05/29 01:37:53.054366 [ERROR] /usr/bin/id: healthd: no such user
...
2020/05/29 01:37:53.254965 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/healthd.service to /etc/systemd/system/healthd.service.
...
2020/05/29 01:37:53.732794 [ERROR] Created symlink from /etc/systemd/system/multi-user.target.wants/cfn-hup.service to /etc/systemd/system/cfn-hup.service.


----------------------------------------
/var/log/cfn-hup.log
----------------------------------------
ReadTimeout: HTTPSConnectionPool(host='sqs.us-east-1.amazonaws.com', port=443): Read timed out. (read timeout=23)

最佳答案

Java 和 Linux 版本的问题
enter image description here
如果您使用的是 Java 8 和 Linux 2.10.9,代码将起作用并覆盖 ngingx 配置,但如果您选择 Corretto 11 和 Linux 2.2.3,则会出现以下错误。

Error: there is no Procfile and no .jar file at root level of your source bundle


使用 Java 8 创建新环境并再次部署应用程序将解决问题。

关于amazon-web-services - 为 nginx SSL 添加 .ebextensions 后,SpringBoot 部署失败 - [执行命令 [app-deploy] 时发生错误],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62077616/

相关文章:

java - cxf-spring-boot-starter-jaxws 中的 XmlBeansDataBinding

java - Play 不断写入光盘?在 Amazon ec2 上导致更高的账单

django - AWS : CodeDeploy for a Docker Compose project?

java - AWS lambda : How to access S3 bucket from Lambda function using java

amazon-web-services - 如何在 AWS Cognito 用户池中将 Okta 设置为 SAML IDP?

amazon-web-services - 如何通过 CloudFormation 创建 S3 存储桶并默认启用传输加速?

spring - Swagger2 UI 资源映射和 API 文档缺失

amazon-web-services - 如何使用 terraform 获取默认的 vpc id

java - spring boot 在提取 jar 时运行 JarLauncher

php - 安装 Libsodium (Amazon EC2) 时库失败