【问题标题】:111: Connection refused on elastic beanstalk111:弹性豆茎上的连接被拒绝
【发布时间】:2020-12-14 22:16:19
【问题描述】:

我在我的电脑上用 JAVA Springboot 构建了一个 jar 文件并将其上传到 AWS elastic-beanstalk。 我可以在我的电脑上运行它,但是当我打开 beanstalk 的链接时它显示错误:

2020/08/26 06:40:20 [error] 3143#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 125.121.75.33, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "xxxxxx-env.eba-4gp64tmr.us-east-1.elasticbeanstalk.com", referrer: "http://xxxxx-env.eba-4gp64tmr.us-east-1.elasticbeanstalk.com/"

但是,网络日志看起来不错:

-------------------------------------
/var/log/web-1.log
-------------------------------------
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::  (v2.3.4.BUILD-SNAPSHOT)

2020-08-26 06:39:42.667  INFO 3167 --- [           main] c.b.restservice.RestServiceApplication   : Starting RestServiceApplication v0.0.1-SNAPSHOT on ip-171-21-39-87 with PID 3167 (/var/app/current/application.jar started by webapp in /var/app/current)
2020-08-26 06:39:42.678  INFO 3167 --- [           main] c.b.restservice.RestServiceApplication   : No active profile set, falling back to default profiles: default
2020-08-26 06:39:46.929  INFO 3167 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2020-08-26 06:39:46.966  INFO 3167 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-08-26 06:39:46.967  INFO 3167 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.37]
2020-08-26 06:39:47.199  INFO 3167 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-08-26 06:39:47.204  INFO 3167 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4295 ms
2020-08-26 06:39:49.410  INFO 3167 --- [           main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2020-08-26 06:39:49.636  INFO 3167 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-08-26 06:39:50.201  INFO 3167 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2020-08-26 06:39:50.203  INFO 3167 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2020-08-26 06:39:50.252  INFO 3167 --- [           main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2020-08-26 06:39:50.349  INFO 3167 --- [           main] s.d.s.w.s.ApiListingReferenceScanner     : Scanning for api listing references
2020-08-26 06:39:50.401  INFO 3167 --- [           main] c.b.restservice.RestServiceApplication   : Started RestServiceApplication in 9.6 seconds (JVM running for 12.522)

我在环境属性中将 SERVER_PORT 设置为 8080。

我应该如何处理这个错误?如果您需要任何其他信息,请告诉我。

【问题讨论】:

  • 有东西试图在端口 5000 上连接:127.0.0.1:5000。什么在使用这个端口?
  • 我不使用这个端口。这种情况应该怎么处理?

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


【解决方案1】:

感谢@Marcin 的提醒! 我将 SERVER_PORT 设置为 5000 这个问题已经解决了! 因为 Elastic Beanstalk 默认会监听 5000。

【讨论】:

    猜你喜欢
    • 2019-03-25
    • 1970-01-01
    • 2016-08-10
    • 2016-08-06
    • 2016-01-13
    • 2015-04-02
    • 2013-05-25
    • 2019-12-13
    • 2020-11-22
    相关资源
    最近更新 更多