Search

SpringBoot x EC2 x RDS

SpringBoot x EC2 x RDS

1.
사전 μž‘μ—… - AWS EC2 X RDS 연동
2.
SpringBoot μƒ˜ν”Œ ν”„λ‘œμ νŠΈ 생성
3.
데이터 μ†ŒμŠ€ μ„€μ •
a.
RDS μ—”λ“œν¬μΈνŠΈλ‘œ μ„€μ •
4.
ν”„λ‘œμ νŠΈ 둜컬 ν…ŒμŠ€νŠΈ
5.
ν”„λ‘œμ νŠΈ 배포
6.
μ„œλ²„ ν…ŒμŠ€νŠΈ

사전 μž‘μ—…

EC2 X RDS 연동 μž‘μ—… λ¨Όμ € ν•˜κ³  μ˜€μ„Έμš”!

SpringBoot μƒ˜ν”Œ ν”„λ‘œμ νŠΈ 생성

데이터 μ†ŒμŠ€ μ„€μ •

β€’
λ°μ΄ν„°λ² μ΄μŠ€ : MySQL
β€’
URL : RDS μ—”λ“œν¬μΈνŠΈ (aloha-aws-db.xxxxxxxx.com:3306)
β€’
username : admin
β€’
password : xxxxxx

RDS μ—”λ“œν¬μΈνŠΈλ‘œ μ„€μ •

# πŸ’» server spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://aloha-aws-db.xxxxxxxx.com:3306/aloha?serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&useSSL=false&autoReconnection=true&autoReconnection=true spring.datasource.username=admin spring.datasource.password=xxxxxx
Java
볡사

application.properties

spring.application.name=check spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # πŸ‘©β€πŸ’» local spring.datasource.url=jdbc:mysql://127.0.0.1:3306/aloha?serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&useSSL=false&autoReconnection=true&autoReconnection=true spring.datasource.username=aloha spring.datasource.password=123456 # πŸ’» server # spring.datasource.url=jdbc:mysql://aloha-qr-db.ctm4c4acm90g.ap-northeast-2.rds.amazonaws.com:3306/aloha?serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&useSSL=false&autoReconnection=true&autoReconnection=true # spring.datasource.username=admin # spring.datasource.password=xxxxxx mybatis.configuration.map-underscore-to-camel-case=true mybatis.type-aliases-package=com.aloha.check.dto mybatis.mapper-locations=classpath:mybatis/mapper/**/**.xml
Java
볡사

RDS μ—”λ“œν¬μΈνŠΈ

ν”„λ‘œμ νŠΈ 둜컬 ν…ŒμŠ€νŠΈ

http://localhost:8080/checks
HTML
볡사

ν”„λ‘œμ νŠΈ 배포

μ„œλ²„ ν…ŒμŠ€νŠΈ

http://ec2-XXX-XXX-XXX-XXX.ap-northeast-2.compute.amazonaws.com:8080/checks
HTML
볡사