我使用 .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
提交
取消