502网关坏了

mw3dktmi  于 2021-07-06  发布在  Java
关注(0)|答案(1)|浏览(339)

我是aws新手,我将把我的stringboot应用程序部署到aws elastic beanstalk。我已经创建了rds,我可以使用mysql工作台成功地连接到它(没有构建模式)。但是当我将它部署到ElasticBeanstalk并运行它时,得到错误502 bad gateway nginx/1.18.0。
另一个问题是我无法使用本地springboot连接到rds。所以当我把它打包到jar文件时,我让maven跳过了测试部分。我的yml(文件)如下所示。在日志里我看到了

Aug 18 22:45:10 ip-172-31-15-192 web: 2020-08-18 22:45:10.618  WARN 8134 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to query metadata : Unknown database 'database-myblog'

这是不是意味着这个数据库出了问题,还是我必须在运行它之前创建一个模式?
一些yml文件如下所示;
应用程序.yml

spring:
  thymeleaf:
    mode: HTML
  profiles:
    active: prod

2应用-生产yml

server:
  port: 5000

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://endpoint:3306/database-myblog
    username: admin
    password: password

  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true

logging:
  level:
    root: warn
    com.lzl: info
  file:
    name: log/myblog-pro.log

3.日志如下所示

/var/log/web.stdout.log
----------------------------------------
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1214)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1245)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
Aug 18 22:45:10 ip-172-31-15-192 web: at com.lzl.MyblogApplication.main(MyblogApplication.java:10)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Aug 18 22:45:10 ip-172-31-15-192 web: 2020-08-18 22:45:10.618  WARN 8134 --- [           main] o.h.e.j.e.i.JdbcEnvironmentInitiator     : HHH000342: Could not obtain connection to query metadata : Unknown database 'database-myblog'
Aug 18 22:45:10 ip-172-31-15-192 web: 2020-08-18 22:45:10.625  WARN 8134 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Aug 18 22:45:10 ip-172-31-15-192 web: 2020-08-18 22:45:10.695 ERROR 8134 --- [           main] o.s.boot.SpringApplication               : Application run failed
Aug 18 22:45:10 ip-172-31-15-192 web: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
Aug 18 22:45:10 ip-172-31-15-192 web: at com.lzl.MyblogApplication.main(MyblogApplication.java:10)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Aug 18 22:45:10 ip-172-31-15-192 web: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Aug 18 22:45:10 ip-172-31-15-192 web: Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1214)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1245)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
Aug 18 22:45:10 ip-172-31-15-192 web: ... 24 common frames omitted
Aug 18 22:45:10 ip-172-31-15-192 web: Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
Aug 18 22:45:10 ip-172-31-15-192 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
Aug 18 22:45:10 ip-172-31-15-192 web: ... 41 common frames omitted
Aug 18 22:45:14 ip-172-31-15-192 web: .   ____          _            __ _ _
Aug 18 22:45:14 ip-172-31-15-192 web: /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
Aug 18 22:45:14 ip-172-31-15-192 web: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
Aug 18 22:45:14 ip-172-31-15-192 web: \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
Aug 18 22:45:14 ip-172-31-15-192 web: '  |____| .__|_| |_|_| |_\__, | / / / /
Aug 18 22:45:14 ip-172-31-15-192 web: =========|_|==============|___/=/_/_/_/
Aug 18 22:45:14 ip-172-31-15-192 web: :: Spring Boot ::        (v2.2.7.RELEASE)
Aug 18 22:45:15 ip-172-31-15-192 web: 2020-08-18 22:45:15.213  INFO 8167 --- [           main] com.lzl.MyblogApplication                : Starting MyblogApplication v0.0.1-SNAPSHOT on ip-172-31-15-192.us-east-2.compute.internal with PID 8167 (/var/app/current/application.jar started by webapp in /var/app/current)
Aug 18 22:45:15 ip-172-31-15-192 web: 2020-08-18 22:45:15.236  INFO 8167 --- [           main] com.lzl.MyblogApplication                : The following profiles are active: prod

----------------------------------------
/var/log/nginx/access.log
----------------------------------------
83.97.20.130 - - [18/Aug/2020:19:18:39 +0000] "GET / HTTP/1.1" 200 2197 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0" "-"
71.88.108.155 - - [18/Aug/2020:19:27:54 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:19:27:54 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
209.17.97.82 - - [18/Aug/2020:20:39:36 +0000] "GET / HTTP/1.0" 502 157 "-" "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)" "-"
71.88.108.155 - - [18/Aug/2020:21:28:16 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:21:28:16 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:21:31:39 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:21:31:39 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:21:55:47 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:21:55:47 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:22:02:46 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
71.88.108.155 - - [18/Aug/2020:22:02:46 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-"
209.17.97.2 - - [18/Aug/2020:22:03:52 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com)" "-"
102.165.30.57 - - [18/Aug/2020:22:17:34 +0000] "GET / HTTP/1.0" 502 157 "-" "NetSystemsResearch studies the availability of various services across the internet. Our website is netsystemsresearch.com" "-"

----------------------------------------
/var/log/nginx/error.log
----------------------------------------
2020/08/18 19:27:54 [error] 4712#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com"
2020/08/18 19:27:54 [error] 4712#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com", referrer: "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/"
2020/08/18 20:39:36 [error] 4712#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 209.17.97.82, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:5000/"
2020/08/18 21:28:16 [error] 4712#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com"
2020/08/18 21:28:16 [error] 4712#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com", referrer: "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/"
2020/08/18 21:31:39 [error] 6434#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com"
2020/08/18 21:31:39 [error] 6434#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com", referrer: "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/"
2020/08/18 21:55:47 [error] 6434#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com"
2020/08/18 21:55:47 [error] 6434#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com", referrer: "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/"
2020/08/18 22:02:46 [error] 6434#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com"
2020/08/18 22:02:46 [error] 6434#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 71.88.108.155, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com", referrer: "http://myblogsylas-env.eba-t2rnydtb.us-east-2.elasticbeanstalk.com/"
2020/08/18 22:03:52 [error] 6434#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 209.17.97.2, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "3.131.11.237:80"
2020/08/18 22:17:34 [error] 6434#0: *15 connect() failed (111: Connection refused) while connecting to upstream, client: 102.165.30.57, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:5000/"
zsohkypk

zsohkypk1#

您需要将elastic beanstalk的安全组添加到rds的入站规则中。您也可以添加您的ip地址,以允许从您的本地连接。https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/rds-external-defaultvpc.html

相关问题