From 1777cce7e26e5a2ac48ee294b3bf9410302fec84 Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Fri, 15 Sep 2023 14:43:36 +0900 Subject: [PATCH 1/8] =?UTF-8?q?build:=20docker=20compose=20volumes=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 88312a05..50c299c9 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -14,6 +14,7 @@ services: command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_general_ci" ] volumes: - db-data:/var/lib/mysql + - ./my.cnf:/etc/my.cnf volumes: db-data: From b13e3bc51b87aeaa6dc6f2e0ad944ab8c7690430 Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Fri, 15 Sep 2023 14:44:48 +0900 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20dataSource=20=EC=88=98=EB=8F=99=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20Config=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/datasource/DataSourceConfig.java | 59 +++++++++++++++++++ .../config/datasource/RoutingDataSource.java | 19 ++++++ 2 files changed, 78 insertions(+) create mode 100644 server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java create mode 100644 server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java new file mode 100644 index 00000000..e47bd99a --- /dev/null +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java @@ -0,0 +1,59 @@ +package com.project.yozmcafe.config.datasource; + +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy; + +import javax.sql.DataSource; +import java.util.Map; + +@Configuration +public class DataSourceConfig { + + public static final String MASTER_DATA_SOURCE = "master"; + public static final String SLAVE_DATA_SOURCE = "slave"; + private static final String ROUTING_DATA_SOURCE = "routingDataSource"; + private static final String MASTER_DATA_SOURCE_LOCATION = "spring.datasource.master"; + private static final String SLAVE_DATA_SOURCE_LOCATION = "spring.datasource.slave"; + + @Bean + @Qualifier(MASTER_DATA_SOURCE) + @ConfigurationProperties(prefix = MASTER_DATA_SOURCE_LOCATION) + public DataSource masterDataSource() { + return DataSourceBuilder.create() + .build(); + } + + @Bean + @Qualifier(SLAVE_DATA_SOURCE) + @ConfigurationProperties(prefix = SLAVE_DATA_SOURCE_LOCATION) + public DataSource slaveDataSource() { + return DataSourceBuilder.create() + .build(); + } + + @Bean + @Qualifier(ROUTING_DATA_SOURCE) + public DataSource routingDataSource(@Qualifier(MASTER_DATA_SOURCE) DataSource sourceDataSource, + @Qualifier(SLAVE_DATA_SOURCE) DataSource replicaDataSource) { + final RoutingDataSource routingDataSource = new RoutingDataSource(); + final Map dataSources = Map.of(MASTER_DATA_SOURCE, sourceDataSource, + SLAVE_DATA_SOURCE, replicaDataSource); + + routingDataSource.setDefaultTargetDataSource(dataSources.get(MASTER_DATA_SOURCE)); + routingDataSource.setTargetDataSources(dataSources); + + return routingDataSource; + } + + @Bean + @Primary + public DataSource dataSource( + @Qualifier(ROUTING_DATA_SOURCE) DataSource routingDataSource) { + return new LazyConnectionDataSourceProxy(routingDataSource); + } +} diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java new file mode 100644 index 00000000..0b5e653e --- /dev/null +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java @@ -0,0 +1,19 @@ +package com.project.yozmcafe.config.datasource; + +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; +import org.springframework.transaction.support.TransactionSynchronizationManager; + +public class RoutingDataSource extends AbstractRoutingDataSource { + + public static final String MASTER_DATA_SOURCE = "master"; + public static final String SLAVE_DATA_SOURCE = "slave"; + + @Override + protected Object determineCurrentLookupKey() { + boolean isReadOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly(); + if (isReadOnly) { + return SLAVE_DATA_SOURCE; + } + return MASTER_DATA_SOURCE; + } +} From 55a5e16291b6c6527a781da2b78cd25e4e2fc94a Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Fri, 15 Sep 2023 14:45:28 +0900 Subject: [PATCH 3/8] =?UTF-8?q?feat:=20DataSourceConfig=20@Profile=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/yozmcafe/config/datasource/DataSourceConfig.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java index e47bd99a..30870485 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java @@ -6,12 +6,14 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; +import org.springframework.context.annotation.Profile; import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy; import javax.sql.DataSource; import java.util.Map; @Configuration +@Profile({"prod","dev"}) public class DataSourceConfig { public static final String MASTER_DATA_SOURCE = "master"; From 75a4ba89a06ee4c3070e4593c7923f0e74c2f33a Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Sat, 16 Sep 2023 13:20:24 +0900 Subject: [PATCH 4/8] =?UTF-8?q?refactor:=20dataSource=20Routing=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yozmcafe/config/datasource/DataSourceConfig.java | 3 +-- .../yozmcafe/config/datasource/RoutingDataSource.java | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java index 30870485..cb144583 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java @@ -54,8 +54,7 @@ public DataSource routingDataSource(@Qualifier(MASTER_DATA_SOURCE) DataSource so @Bean @Primary - public DataSource dataSource( - @Qualifier(ROUTING_DATA_SOURCE) DataSource routingDataSource) { + public DataSource dataSource(@Qualifier(ROUTING_DATA_SOURCE) DataSource routingDataSource) { return new LazyConnectionDataSourceProxy(routingDataSource); } } diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java index 0b5e653e..a2bda296 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java @@ -11,9 +11,7 @@ public class RoutingDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { boolean isReadOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly(); - if (isReadOnly) { - return SLAVE_DATA_SOURCE; - } - return MASTER_DATA_SOURCE; + + return isReadOnly ? SLAVE_DATA_SOURCE : MASTER_DATA_SOURCE; } } From c74ddb3d79f0ce93ceb14e50cb246ef578e1b569 Mon Sep 17 00:00:00 2001 From: nuyh Date: Wed, 20 Sep 2023 13:21:31 +0900 Subject: [PATCH 5/8] =?UTF-8?q?refactor:=20=EC=84=A4=EC=A0=95=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20yaml=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/application-test.properties | 25 -------- .../src/main/resources/application-test.yaml | 40 +++++++++++++ .../src/main/resources/application.properties | 32 ---------- server/src/main/resources/application.yaml | 60 +++++++++++++++++++ 4 files changed, 100 insertions(+), 57 deletions(-) delete mode 100644 server/src/main/resources/application-test.properties create mode 100644 server/src/main/resources/application-test.yaml delete mode 100644 server/src/main/resources/application.properties create mode 100644 server/src/main/resources/application.yaml diff --git a/server/src/main/resources/application-test.properties b/server/src/main/resources/application-test.properties deleted file mode 100644 index ea37a068..00000000 --- a/server/src/main/resources/application-test.properties +++ /dev/null @@ -1,25 +0,0 @@ -spring.auth.key=testtesttesttesttesttesttesttesttesttesttesttesttesttesttest -spring.auth.accessTokenExpired=360000 -spring.auth.refreshTokenExpired=36000000 -spring.auth.google.tokenUri=testtesttesttesttesttest -spring.auth.google.authUri=testtesttesttesttesttest -spring.auth.google.clientId=testtesttesttesttesttest -spring.auth.google.clientSecret=testtesttesttesttesttest -spring.auth.google.redirectUri=testtesttesttesttesttest -spring.auth.google.scope=testtesttesttesttesttest -spring.auth.kakao.tokenUri=testtesttesttesttesttest -spring.auth.kakao.authUri=testtesttesttesttesttest -spring.auth.kakao.clientId=testtesttesttesttesttest -spring.auth.kakao.clientSecret=testtesttesttesttesttest -spring.auth.kakao.redirectUri=testtesttesttesttesttest -spring.auth.kakao.scope=testtesttesttesttesttest -s3.bucket=2023-team-project/2023-yozm-cafe/test -spring.servlet.multipart.max-file-size=11MB -spring.servlet.multipart.max-request-size=110MB -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true -spring.flyway.enabled=true -spring.flyway.baseline-version=20230901153300 -spring.flyway.baseline-on-migrate=true -spring.flyway.out-of-order=true -spring.jpa.properties.hibernate.default_batch_fetch_size=1000 diff --git a/server/src/main/resources/application-test.yaml b/server/src/main/resources/application-test.yaml new file mode 100644 index 00000000..0bfd905e --- /dev/null +++ b/server/src/main/resources/application-test.yaml @@ -0,0 +1,40 @@ +spring: + auth: + key: testtesttesttesttesttesttesttesttesttesttesttesttesttesttest + accessTokenExpired: 360000 + refreshTokenExpired: 36000000 + google: + tokenUri: testtesttesttesttesttest + authUri: testtesttesttesttesttest + clientId: testtesttesttesttesttest + clientSecret: testtesttesttesttesttest + redirectUri: testtesttesttesttesttest + scope: testtesttesttesttesttest + kakao: + tokenUri: testtesttesttesttesttest + authUri: testtesttesttesttesttest + clientId: testtesttesttesttesttest + clientSecret: testtesttesttesttesttest + redirectUri: testtesttesttesttesttest + scope: testtesttesttesttesttest + + servlet: + multipart: + max-file-size: 11MB + max-request-size: 110MB + + flyway: + enabled: true + baseline-version: 20230901153300 + baseline-on-migrate: true + out-of-order: true + + jpa: + properties: + hibernate: + default_batch_fetch_size: 1000 + format_sql: true + show-sql: true + +s3: + bucket: 2023-team-project/2023-yozm-cafe/test/images diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties deleted file mode 100644 index 745746e3..00000000 --- a/server/src/main/resources/application.properties +++ /dev/null @@ -1,32 +0,0 @@ -spring.datasource.url=jdbc:mysql://localhost:20000/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.jpa.hibernate.ddl-auto=validate -spring.auth.key=testtesttesttesttesttesttesttesttesttesttesttesttesttesttest -spring.auth.accessTokenExpired=360000 -spring.auth.refreshTokenExpired=36000000 -spring.auth.google.tokenUri=testtesttesttesttesttest -spring.auth.google.authUri=testtesttesttesttesttest -spring.auth.google.clientId=testtesttesttesttesttest -spring.auth.google.clientSecret=testtesttesttesttesttest -spring.auth.google.redirectUri=testtesttesttesttesttest -spring.auth.google.scope=testtesttesttesttesttest -spring.auth.kakao.tokenUri=testtesttesttesttesttest -spring.auth.kakao.authUri=testtesttesttesttesttest -spring.auth.kakao.clientId=testtesttesttesttesttest -spring.auth.kakao.clientSecret=testtesttesttesttesttest -spring.auth.kakao.redirectUri=testtesttesttesttesttest -spring.auth.kakao.scope=testtesttesttesttesttest -s3.bucket=2023-team-project/2023-yozm-cafe/dev -spring.servlet.multipart.max-file-size=11MB -spring.servlet.multipart.max-request-size=110MB -management.endpoints.web.exposure.include=prometheus, logfile -management.endpoint.logfile.external-file=./logs/spring-boot-logger.log -spring.flyway.enabled=true -spring.flyway.baseline-version=20230901153300 -spring.flyway.baseline-on-migrate=true -spring.flyway.out-of-order=true -spring.jpa.properties.hibernate.default_batch_fetch_size=1000 -spring.jpa.open-in-view=false - diff --git a/server/src/main/resources/application.yaml b/server/src/main/resources/application.yaml new file mode 100644 index 00000000..7f52a781 --- /dev/null +++ b/server/src/main/resources/application.yaml @@ -0,0 +1,60 @@ +spring: + datasource: + master: + jdbc-url: jdbc:mysql://localhost:20000/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC + username: root + password: root + driver-class-name: com.mysql.cj.jdbc.Driver + slave: + jdbc-url: jdbc:mysql://localhost:20001/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC + username: root + password: root + driver-class-name: com.mysql.cj.jdbc.Driver + + auth: + key: testtesttesttesttesttesttesttesttesttesttesttesttesttesttest + accessTokenExpired: 360000 + refreshTokenExpired: 36000000 + google: + tokenUri: testtesttesttesttesttest + authUri: testtesttesttesttesttest + clientId: testtesttesttesttesttest + clientSecret: testtesttesttesttesttest + redirectUri: testtesttesttesttesttest + scope: testtesttesttesttesttest + kakao: + tokenUri: testtesttesttesttesttest + authUri: testtesttesttesttesttest + clientId: testtesttesttesttesttest + clientSecret: testtesttesttesttesttest + redirectUri: testtesttesttesttesttest + scope: testtesttesttesttesttest + + servlet: + multipart: + max-file-size: 11MB + max-request-size: 110MB + + flyway: + enabled: true + baseline-version: 20230901153300 + baseline-on-migrate: true + out-of-order: true + + jpa: + properties: + hibernate: + default_batch_fetch_size: 1000 + +s3: + bucket: 2023-team-project/2023-yozm-cafe/dev/images + +management: + endpoints: + web: + exposure: + include: prometheus, logfile + + endpoint: + logfile: + external-file: ./logs/spring-boot-logger.log From 4146040426caebc67af2d720099915374a40054c Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Wed, 20 Sep 2023 13:41:03 +0900 Subject: [PATCH 6/8] =?UTF-8?q?refactor:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=86=A0=EB=A7=81=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/datasource/DataSourceConfig.java | 6 +++--- .../config/datasource/RoutingDataSource.java | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java index cb144583..a840dab0 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java @@ -13,14 +13,14 @@ import java.util.Map; @Configuration -@Profile({"prod","dev"}) +@Profile({"!test"}) public class DataSourceConfig { public static final String MASTER_DATA_SOURCE = "master"; - public static final String SLAVE_DATA_SOURCE = "slave"; - private static final String ROUTING_DATA_SOURCE = "routingDataSource"; private static final String MASTER_DATA_SOURCE_LOCATION = "spring.datasource.master"; + public static final String SLAVE_DATA_SOURCE = "slave"; private static final String SLAVE_DATA_SOURCE_LOCATION = "spring.datasource.slave"; + private static final String ROUTING_DATA_SOURCE = "routingDataSource"; @Bean @Qualifier(MASTER_DATA_SOURCE) diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java index a2bda296..b5979b16 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/RoutingDataSource.java @@ -3,15 +3,16 @@ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; import org.springframework.transaction.support.TransactionSynchronizationManager; -public class RoutingDataSource extends AbstractRoutingDataSource { - - public static final String MASTER_DATA_SOURCE = "master"; - public static final String SLAVE_DATA_SOURCE = "slave"; +import static com.project.yozmcafe.config.datasource.DataSourceConfig.MASTER_DATA_SOURCE; +import static com.project.yozmcafe.config.datasource.DataSourceConfig.SLAVE_DATA_SOURCE; +public class RoutingDataSource extends AbstractRoutingDataSource { @Override protected Object determineCurrentLookupKey() { - boolean isReadOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly(); - - return isReadOnly ? SLAVE_DATA_SOURCE : MASTER_DATA_SOURCE; + final boolean isReadOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly(); + if(isReadOnly){ + return SLAVE_DATA_SOURCE; + } + return MASTER_DATA_SOURCE; } } From 5dc247870bdca17f7a3360873c04c011ce21e99a Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Wed, 20 Sep 2023 13:41:08 +0900 Subject: [PATCH 7/8] =?UTF-8?q?build:=20=EB=8F=84=EC=BB=A4=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EC=A6=88=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/docker-compose.yml b/server/docker-compose.yml index 50c299c9..453ab1e5 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -14,6 +14,10 @@ services: command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_general_ci" ] volumes: - db-data:/var/lib/mysql + # my.cnf의 server_id 값은 복제에 참여한 MySQL 서버들이 고유하게 가지고 있는 식별 값이다. + # 이 값은 바이너리 로그에 이벤트별로 이벤트가 최초로 발생한 MySQL을 식별하기 위해 사용되며, 기본값이 모두 1이다. + # 이 때문에 Master 서버와 Slave 서버를 구별할 수 있도록 Slave 서버의 server_id를 바꾸어 주기 위해 volume 매핑을 진행해야한다. + # my.cnf 파일이 존재해야한다. - ./my.cnf:/etc/my.cnf volumes: From 347e3e3aba6d60aea4c219be6933659891151e54 Mon Sep 17 00:00:00 2001 From: donghae-kim Date: Wed, 20 Sep 2023 13:50:55 +0900 Subject: [PATCH 8/8] =?UTF-8?q?refactor:=20replication=20Profile=20prod=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/datasource/DataSourceConfig.java | 2 +- server/src/main/resources/application.yaml | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java index a840dab0..5795c558 100644 --- a/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java +++ b/server/src/main/java/com/project/yozmcafe/config/datasource/DataSourceConfig.java @@ -13,7 +13,7 @@ import java.util.Map; @Configuration -@Profile({"!test"}) +@Profile({"prod"}) public class DataSourceConfig { public static final String MASTER_DATA_SOURCE = "master"; diff --git a/server/src/main/resources/application.yaml b/server/src/main/resources/application.yaml index 7f52a781..a726a4d9 100644 --- a/server/src/main/resources/application.yaml +++ b/server/src/main/resources/application.yaml @@ -1,15 +1,9 @@ spring: datasource: - master: - jdbc-url: jdbc:mysql://localhost:20000/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC - username: root - password: root - driver-class-name: com.mysql.cj.jdbc.Driver - slave: - jdbc-url: jdbc:mysql://localhost:20001/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC - username: root - password: root - driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:20000/yozm-cafe?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=UTC + username: root + password: root + driver-class-name: com.mysql.cj.jdbc.Driver auth: key: testtesttesttesttesttesttesttesttesttesttesttesttesttesttest