1
AWS EC2インスタンスでjarを実行すると、私のスプリングブートアプリケーションがエラーをスローしています。ローカルシステムで実行するとうまく動作します。AWSのmysqlに接続できません
マイapplication.properties
ファイルが
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/gbi? useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=fa lse&serverTimezone=UTC&autoReconnect=true&failOverReadOnly=false&maxReconne cts=10
spring.jpa.database-platform =org.hibernate.dialect.MySQLDialect
spring.datasource.username=******
spring.datasource.password=******@
spring.datasource.pool.size=20
spring.jpa.hibernate.ddl-auto=update
server.port=8090
私はAWSサーバにjarファイルを実行すると、私は続い
Unable to create initial connections of pool.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 10
times. Giving up.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
続く、
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago.
The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
、
次のエラーを取得していますCaused by: java.net.ConnectException: Connection refused (Connection
refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
atjava.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
は
2017-Oct-09 15:24:49.735 WARN [main] o.s.b.a.o.j.DatabaseLookup -
Unable to determine jdbc url from datasource
org.springframework.jdbc.support.MetaDataAccessException: Could not get
Connection for extracting meta data; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
JDBC Connection; nested exception is
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 10
times. Giving up.
は、どのようにこの問題を解決するために、続きますか?
「私のコンピュータのIP」とはどういう意味ですか?私はどこからjarファイルを置くべきでしょうか? –
私はあなたのローカルのアプリケーションだと思ったので、私はあなたのローカルマシンのIPアドレスを置くと言いました。そうでない場合は、セキュリティグループを作成してインバウンドルールに追加します –