From 4d69f7be4b045f224a61802518b139ff8787bd91 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 20 May 2024 11:29:06 +0800 Subject: [PATCH] update readme add connection config notes --- applications/hertzbeat/README.md | 38 +++++++++++++++++++++++++++++ applications/hertzbeat/README_CN.md | 38 +++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/applications/hertzbeat/README.md b/applications/hertzbeat/README.md index be51bcf..fe9a91e 100644 --- a/applications/hertzbeat/README.md +++ b/applications/hertzbeat/README.md @@ -48,3 +48,41 @@ yarn start ``` 6. Access `http://localhost:4200` to start, account `admin/hertzbeat` + +## Custom Database Configuration + +### Custom Local or Prod Env Configuration + +Modify the `application.yml` file in the `manager` module `manager/src/main/resources` + +```yaml +spring: + config: + activate: + on-profile: prod + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: + url: jdbc:mysql://localhost:2881/hertzbeat?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false + hikari: + max-lifetime: 120000 +``` + +### Custom Test Env Configuration + +This if for the test environment, `mvn clean test` + +Modify the `application-test.yml` file in the `manager` module `manager/src/main/resources` + +```yaml +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: + url: jdbc:mysql://localhost:2881/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false + hikari: + max-lifetime: 120000 +``` diff --git a/applications/hertzbeat/README_CN.md b/applications/hertzbeat/README_CN.md index b76325c..4c37778 100644 --- a/applications/hertzbeat/README_CN.md +++ b/applications/hertzbeat/README_CN.md @@ -47,3 +47,41 @@ yarn start ``` 6. Access `http://localhost:4200` to start, account `admin/hertzbeat` + +## Custom Database Configuration + +### Custom Local or Prod Env Configuration + +Modify the `application.yml` file in the `manager` module `manager/src/main/resources` + +```yaml +spring: + config: + activate: + on-profile: prod + + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: + url: jdbc:mysql://localhost:2881/hertzbeat?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false + hikari: + max-lifetime: 120000 +``` + +### Custom Test Env Configuration + +This if for the test environment, `mvn clean test` + +Modify the `application-test.yml` file in the `manager` module `manager/src/main/resources` + +```yaml +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: + url: jdbc:mysql://localhost:2881/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&useSSL=false + hikari: + max-lifetime: 120000 +```