我使用 .jar(不是 war)文件将 Spring Boot 应用程序部署到 Elastic Beanstalk。我正在使用 Java 1.8。我将 application.properties 更改为 server.port = 5000。我还在 0.0.0.0/32 上打开了我的 ec2 实例用于端口 5000 的安全组。当我的弹性 beantalk 环境加载时,状态变为降级。这是来自 EB 的日志文件。-------------------------------------/var/log/nginx/error.log-------------------------------------2019/03/05 21:47:12 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "3.209.22.246"2019/03/05 21:47:12 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "3.209.22.246", referrer: "http://3.209.22.246/"2019/03/05 21:47:40 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "3.209.22.246"2019/03/05 21:47:40 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "3.209.22.246", referrer: "http://3.209.22.246/"2019/03/05 21:47:41 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "3.209.22.246"2019/03/05 21:47:41 [error] 3256#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 198.72.235.68, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "3.209.22.246", referrer: "http://3.209.22.246/"
1 回答
牛魔王的故事
TA贡献1830条经验 获得超3个赞
最可能的情况是应用程序服务器(嵌入 Spring Boot)没有正确启动。应用程序服务器的日志存储到/var/log/web-1.log
ElasticBeanstalk 中的“日志”选项卡,也可以通过该选项卡获得。
以我的经验,这通常与无法访问的支持服务(数据库集群)有关。可能从您的 ElasticBeanstalk、EC2 环境到 RDS 数据库的安全组设置不正确。
添加回答
举报
0/150
提交
取消