我有个问题。我检查了数据库连接,并在本地主机上使用了这个应用程序,一切正常。但是当我部署这个web应用程序时,我总是面临502错误。我曾尝试修改安全组等,但始终没有成功。我收到了来自弹性豆茎日志的最后100行日志消息,所以如果你能解决这个问题,请帮帮我。谢谢。
这是日志。
enter code here ----------------------------------------
/var/log/nginx/error.log
----------------------------------------
2021/01/06 07:23:24 [error] 3544#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 222.108.35.81, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com"
2021/01/06 07:23:24 [error] 3544#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 222.108.35.81, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com", referrer: "http://couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com/"
2021/01/06 07:24:50 [error] 3544#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 222.108.35.81, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5000/", host: "couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com"
2021/01/06 07:24:50 [error] 3544#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 222.108.35.81, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com", referrer: "http://couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com/"
2021/01/06 07:25:11 [error] 3544#0: *9 connect() failed (111: Connection refused) while connecting to upstream, client: 222.108.35.81, server: , request: "POST /couponapi/coupons HTTP/1.1", upstream: "http://127.0.0.1:5000/couponapi/coupons", host: "couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com"
----------------------------------------
/var/log/eb-engine.log
----------------------------------------
2021/01/06 07:21:09.211870 [INFO] Running command /bin/sh -c systemctl show -p PartOf healthd.service
2021/01/06 07:21:09.216802 [INFO] Running command /bin/sh -c systemctl is-active healthd.service
2021/01/06 07:21:09.220123 [INFO] Running command /bin/sh -c systemctl start healthd.service
2021/01/06 07:21:09.259532 [INFO] Copying file /opt/elasticbeanstalk/config/private/healthd/healthd_logformat.conf to /var/proxy/staging/nginx/conf.d/healthd_logformat.conf
2021/01/06 07:21:09.260732 [INFO] Copying file /opt/elasticbeanstalk/config/private/healthd/healthd_nginx.conf to /var/proxy/staging/nginx/conf.d/elasticbeanstalk/healthd.conf
2021/01/06 07:21:09.262012 [INFO] Executing instruction: configure log streaming
2021/01/06 07:21:09.262023 [INFO] log streaming is not enabled
2021/01/06 07:21:09.262027 [INFO] disable log stream
2021/01/06 07:21:09.262046 [INFO] Running command /bin/sh -c systemctl show -p PartOf amazon-cloudwatch-agent.service
2021/01/06 07:21:09.270643 [INFO] Running command /bin/sh -c systemctl stop amazon-cloudwatch-agent.service
2021/01/06 07:21:09.281164 [INFO] Executing instruction: GetToggleForceRotate
2021/01/06 07:21:09.281181 [INFO] Checking if logs need forced rotation
2021/01/06 07:21:09.281203 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:ap-northeast-2:908803455527:stack/awseb-e-parj2s23pb-stack/810a0e30-4fef-11eb-ab7d-02ea5112e8c2 -r AWSEBAutoScalingGroup --region ap-northeast-2
2021/01/06 07:21:09.852882 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:ap-northeast-2:908803455527:stack/awseb-e-parj2s23pb-stack/810a0e30-4fef-11eb-ab7d-02ea5112e8c2 -r AWSEBBeanstalkMetadata --region ap-northeast-2
2021/01/06 07:21:10.418675 [INFO] Generating rsyslog config from Procfile
2021/01/06 07:21:10.420226 [INFO] Running command /bin/sh -c systemctl restart rsyslog.service
2021/01/06 07:21:10.437082 [INFO] Executing instruction: PostBuildEbExtension
2021/01/06 07:21:10.437101 [INFO] Starting executing the config set Infra-EmbeddedPostBuild.
2021/01/06 07:21:10.437120 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:ap-northeast-2:908803455527:stack/awseb-e-parj2s23pb-stack/810a0e30-4fef-11eb-ab7d-02ea5112e8c2 -r AWSEBAutoScalingGroup --region ap-northeast-2 --configsets Infra-EmbeddedPostBuild
2021/01/06 07:21:10.805240 [INFO] Finished executing the config set Infra-EmbeddedPostBuild.
2021/01/06 07:21:10.805258 [INFO] Executing instruction: CleanEbExtensions
2021/01/06 07:21:10.805287 [INFO] Cleaned ebextensions subdirectories from app staging directory.
2021/01/06 07:21:10.805292 [INFO] Executing instruction: RunAppDeployPreDeployHooks
2021/01/06 07:21:10.805300 [INFO] The dir .platform/hooks/predeploy/ does not exist in the application. Skipping this step...
2021/01/06 07:21:10.805316 [INFO] Executing instruction: stop X-Ray
2021/01/06 07:21:10.805320 [INFO] stop X-Ray ...
2021/01/06 07:21:10.805343 [INFO] Running command /bin/sh -c systemctl show -p PartOf xray.service
2021/01/06 07:21:10.811931 [WARN] stopProcess Warning: process xray is not registered
2021/01/06 07:21:10.811961 [INFO] Running command /bin/sh -c systemctl stop xray.service
2021/01/06 07:21:10.819094 [INFO] Executing instruction: stop proxy
2021/01/06 07:21:10.819116 [INFO] Running command /bin/sh -c systemctl show -p PartOf httpd.service
2021/01/06 07:21:10.823306 [WARN] deregisterProcess Warning: process httpd is not registered, skipping...
2021/01/06 07:21:10.823337 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2021/01/06 07:21:10.829206 [WARN] deregisterProcess Warning: process nginx is not registered, skipping...
2021/01/06 07:21:10.829230 [INFO] Executing instruction: FlipApplication
2021/01/06 07:21:10.829235 [INFO] Fetching environment variables...
2021/01/06 07:21:10.829325 [INFO] Purge old process...
2021/01/06 07:21:10.829370 [INFO] Register application processes...
2021/01/06 07:21:10.829376 [INFO] Registering the proc: web
2021/01/06 07:21:10.829389 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2021/01/06 07:21:10.835429 [INFO] Running command /bin/sh -c systemctl daemon-reload
2021/01/06 07:21:10.908738 [INFO] Running command /bin/sh -c systemctl reset-failed
2021/01/06 07:21:10.912741 [INFO] Running command /bin/sh -c systemctl is-enabled eb-app.target
2021/01/06 07:21:10.916222 [INFO] Copying file /opt/elasticbeanstalk/config/private/aws-eb.target to /etc/systemd/system/eb-app.target
2021/01/06 07:21:10.917734 [INFO] Running command /bin/sh -c systemctl enable eb-app.target
2021/01/06 07:21:11.000983 [INFO] Running command /bin/sh -c systemctl start eb-app.target
2021/01/06 07:21:11.006200 [INFO] Running command /bin/sh -c systemctl enable web.service
2021/01/06 07:21:11.093044 [INFO] Running command /bin/sh -c systemctl show -p PartOf web.service
2021/01/06 07:21:11.097989 [INFO] Running command /bin/sh -c systemctl is-active web.service
2021/01/06 07:21:11.101314 [INFO] Running command /bin/sh -c systemctl start web.service
2021/01/06 07:21:11.115896 [INFO] Executing instruction: start X-Ray
2021/01/06 07:21:11.115910 [INFO] X-Ray is not enabled.
2021/01/06 07:21:11.115915 [INFO] Executing instruction: start proxy with new configuration
2021/01/06 07:21:11.115939 [INFO] Running command /bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf
2021/01/06 07:21:11.136081 [INFO] Running command /bin/sh -c cp -rp /var/proxy/staging/nginx/* /etc/nginx
2021/01/06 07:21:11.139384 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2021/01/06 07:21:11.147234 [INFO] Running command /bin/sh -c systemctl daemon-reload
2021/01/06 07:21:11.235279 [INFO] Running command /bin/sh -c systemctl reset-failed
2021/01/06 07:21:11.244986 [INFO] Running command /bin/sh -c systemctl show -p PartOf nginx.service
2021/01/06 07:21:11.254903 [INFO] Running command /bin/sh -c systemctl is-active nginx.service
2021/01/06 07:21:11.262544 [INFO] Running command /bin/sh -c systemctl start nginx.service
2021/01/06 07:21:11.344371 [INFO] Executing instruction: configureSqsd
2021/01/06 07:21:11.344388 [INFO] This is a web server environment instance, skip configure sqsd daemon ...
2021/01/06 07:21:11.344393 [INFO] Executing instruction: startSqsd
2021/01/06 07:21:11.344397 [INFO] This is a web server environment instance, skip start sqsd daemon ...
2021/01/06 07:21:11.344401 [INFO] Executing instruction: Track pids in healthd
2021/01/06 07:21:11.344405 [INFO] This is an enhanced health env...
2021/01/06 07:21:11.344424 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf aws-eb.target | cut -d= -f2
2021/01/06 07:21:11.359446 [INFO] cfn-hup.service healthd.service nginx.service
2021/01/06 07:21:11.359494 [INFO] Running command /bin/sh -c systemctl show -p ConsistsOf eb-app.target | cut -d= -f2
2021/01/06 07:21:11.378785 [INFO] web.service
2021/01/06 07:21:11.378913 [INFO] Executing instruction: RunAppDeployPostDeployHooks
2021/01/06 07:21:11.378925 [INFO] The dir .platform/hooks/postdeploy/ does not exist in the application. Skipping this step...
2021/01/06 07:21:11.378930 [INFO] Executing cleanup logic
2021/01/06 07:21:11.379030 [INFO] CommandService Response: {"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"Engine execution has succeeded.","returncode":0,"events":[{"msg":"Instance deployment successfully detected a JAR file in your source bundle.","timestamp":1609917668,"severity":"INFO"},{"msg":"Instance deployment successfully generated a 'Procfile'.","timestamp":1609917668,"severity":"INFO"},{"msg":"Instance deployment completed successfully.","timestamp":1609917671,"severity":"INFO"}]}]}
2021/01/06 07:21:11.379165 [INFO] Platform Engine finished execution on command: app-deploy
2021/01/06 07:25:23.304531 [INFO] Starting...
2021/01/06 07:25:23.304584 [INFO] Starting EBPlatform-PlatformEngine
2021/01/06 07:25:23.304608 [INFO] reading event message file
2021/01/06 07:25:23.304721 [INFO] no eb envtier info file found, skip loading env tier info.
2021/01/06 07:25:23.304787 [INFO] Engine received EB command cfn-hup-exec
2021/01/06 07:25:23.422026 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:ap-northeast-2:908803455527:stack/awseb-e-parj2s23pb-stack/810a0e30-4fef-11eb-ab7d-02ea5112e8c2 -r AWSEBAutoScalingGroup --region ap-northeast-2
2021/01/06 07:25:24.160493 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:ap-northeast-2:908803455527:stack/awseb-e-parj2s23pb-stack/810a0e30-4fef-11eb-ab7d-02ea5112e8c2 -r AWSEBBeanstalkMetadata --region ap-northeast-2
2021/01/06 07:25:24.503333 [INFO] checking whether command tail-log is applicable to this instance...
2021/01/06 07:25:24.503346 [INFO] this command is applicable to the instance, thus instance should execute command
2021/01/06 07:25:24.503350 [INFO] Engine command: (tail-log)
2021/01/06 07:25:24.503401 [INFO] Executing instruction: GetTailLogs
2021/01/06 07:25:24.503406 [INFO] Tail Logs...
2021/01/06 07:25:24.503660 [INFO] Running command /bin/sh -c tail -n 100 /var/log/nginx/error.log
2021/01/06 07:25:24.505286 [INFO] Running command /bin/sh -c tail -n 100 /var/log/eb-engine.log
----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.NativeSession.connect(NativeSession.java:144) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: ... 57 common frames omitted
Jan 6 07:25:16 ip-172-31-11-100 web: Caused by: java.net.ConnectException: Connection refused (Connection refused)
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.net.Socket.connect(Socket.java:609) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65) ~[mysql-connector-java-8.0.19.jar!/:8.0.19]
Jan 6 07:25:16 ip-172-31-11-100 web: ... 60 common frames omitted
Jan 6 07:25:16 ip-172-31-11-100 web: 2021-01-06 07:25:16.273 WARN 4145 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata : Communications link failure
Jan 6 07:25:16 ip-172-31-11-100 web: The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Jan 6 07:25:16 ip-172-31-11-100 web: 2021-01-06 07:25:16.278 WARN 4145 --- [ 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]
Jan 6 07:25:16 ip-172-31-11-100 web: 2021-01-06 07:25:16.284 INFO 4145 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
Jan 6 07:25:16 ip-172-31-11-100 web: 2021-01-06 07:25:16.319 INFO 4145 --- [ main] ConditionEvaluationReportLoggingListener :
Jan 6 07:25:16 ip-172-31-11-100 web: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
Jan 6 07:25:16 ip-172-31-11-100 web: 2021-01-06 07:25:16.330 ERROR 4145 --- [ main] o.s.boot.SpringApplication : Application run failed
Jan 6 07:25:16 ip-172-31-11-100 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]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) ~[spring-context-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.6.RELEASE.jar!/:2.2.6.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at com.bharath.springcloud.CouponserviceApplication.main(CouponserviceApplication.java:10) ~[classes!/:0.0.1-SNAPSHOT]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[application.jar:0.0.1-SNAPSHOT]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[application.jar:0.0.1-SNAPSHOT]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) ~[application.jar:0.0.1-SNAPSHOT]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) ~[application.jar:0.0.1-SNAPSHOT]
Jan 6 07:25:16 ip-172-31-11-100 web: Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1202) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1233) ~[hibernate-core-5.4.12.Final.jar!/:5.4.12.Final]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) ~[spring-orm-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) ~[spring-orm-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:16 ip-172-31-11-100 web: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.5.RELEASE.jar!/:5.2.5.RELEASE]
Jan 6 07:25:18 ip-172-31-11-100 web: . ____ _ __ _ _
Jan 6 07:25:18 ip-172-31-11-100 web: /\ / ___'_ __ _ _(_)_ __ __ _
Jan 6 07:25:18 ip-172-31-11-100 web: ( ( )___ | '_ | '_| | '_ / _` |
Jan 6 07:25:18 ip-172-31-11-100 web: \/ ___)| |_)| | | | | || (_| | ) ) ) )
Jan 6 07:25:18 ip-172-31-11-100 web: ' |____| .__|_| |_|_| |___, | / / / /
Jan 6 07:25:18 ip-172-31-11-100 web: =========|_|==============|___/=/_/_/_/
Jan 6 07:25:18 ip-172-31-11-100 web: :: Spring Boot :: (v2.2.6.RELEASE)
Jan 6 07:25:18 ip-172-31-11-100 web: 2021-01-06 07:25:18.835 INFO 4172 --- [ main] c.b.s.CouponserviceApplication : Starting CouponserviceApplication v0.0.1-SNAPSHOT on ip-172-31-11-100.ap-northeast-2.compute.internal with PID 4172 (/var/app/current/application.jar started by webapp in /var/app/current)
Jan 6 07:25:18 ip-172-31-11-100 web: 2021-01-06 07:25:18.842 INFO 4172 --- [ main] c.b.s.CouponserviceApplication : No active profile set, falling back to default profiles: default
Jan 6 07:25:20 ip-172-31-11-100 web: 2021-01-06 07:25:20.430 INFO 4172 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
Jan 6 07:25:20 ip-172-31-11-100 web: 2021-01-06 07:25:20.561 INFO 4172 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 111ms. Found 1 JPA repository interfaces.
Jan 6 07:25:22 ip-172-31-11-100 web: 2021-01-06 07:25:22.185 INFO 4172 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9091 (http)
Jan 6 07:25:22 ip-172-31-11-100 web: 2021-01-06 07:25:22.212 INFO 4172 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
Jan 6 07:25:22 ip-172-31-11-100 web: 2021-01-06 07:25:22.218 INFO 4172 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.33]
Jan 6 07:25:22 ip-172-31-11-100 web: 2021-01-06 07:25:22.399 INFO 4172 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
Jan 6 07:25:22 ip-172-31-11-100 web: 2021-01-06 07:25:22.400 INFO 4172 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3432 ms
Jan 6 07:25:23 ip-172-31-11-100 web: 2021-01-06 07:25:23.440 INFO 4172 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
----------------------------------------
/var/log/nginx/access.log
----------------------------------------
222.108.35.81 - - [06/Jan/2021:07:23:24 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36" "-"
222.108.35.81 - - [06/Jan/2021:07:23:24 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://couponservice-env.eba-7apfigmx.ap-northeast-2.elasticbeanstalk.com/" "Mozilla/5.0 (Windows NT
这看起来像是入站规则问题。在使用使用AWS RDS的web应用程序的AWS教程中,提到了入站规则。您需要确保指定了Elastic Beanstalk实例的IP地址。如果不执行此操作,则连接不起作用。
以下是讨论此主题的AWS RDS教程:
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/usecases/Creating_rds_item_tracker