From c624cdf95a42bb1cf3768d991210983a63610feb Mon Sep 17 00:00:00 2001 From: shenb15 Date: Mon, 23 Oct 2023 21:35:10 +0800 Subject: [PATCH] Add default db.pool.config.* options from main nacos repository. Expose db.pool.config.connectionTimeout as environment variable: DB_POOL_CONNECTION_TIMEOUT --- README.md | 1 + README_ZH.md | 1 + build/conf/application.properties | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 5ac0efe..cd9d44d 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ Run the following command: | NACOS_AUTH_IDENTITY_KEY | nacos.core.auth.server.identity.key | `Note: It is removed from Nacos 2.2.1` | | NACOS_AUTH_IDENTITY_VALUE | nacos.core.auth.server.identity.value | `Note: It is removed from Nacos 2.2.1` | | NACOS_SECURITY_IGNORE_URLS | nacos.security.ignore.urls | default : `/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**` | +| DB_POOL_CONNECTION_TIMEOUT | Database connection pool timeout in milliseconds | default : **30000** | ## Advanced configuration diff --git a/README_ZH.md b/README_ZH.md index 2048e9d..f5ebb10 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -170,6 +170,7 @@ | NACOS_AUTH_IDENTITY_KEY | nacos.core.auth.server.identity.key | `注意:该环境变量在Nacos 2.2.1版本中已移除` | | NACOS_AUTH_IDENTITY_VALUE | nacos.core.auth.server.identity.value | `注意:该环境变量在Nacos 2.2.1版本中已移除` | | NACOS_SECURITY_IGNORE_URLS | nacos.security.ignore.urls | default : `/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**` | +| DB_POOL_CONNECTION_TIMEOUT | 数据库连接池超时时间,单位为毫秒 | 默认 : **30000** | ## 高级配置 diff --git a/build/conf/application.properties b/build/conf/application.properties index 51252ca..212a8d6 100644 --- a/build/conf/application.properties +++ b/build/conf/application.properties @@ -20,6 +20,11 @@ db.num=${MYSQL_DATABASE_NUM:1} db.url.0=jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT:3306}/${MYSQL_SERVICE_DB_NAME}?${MYSQL_SERVICE_DB_PARAM:characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false} db.user.0=${MYSQL_SERVICE_USER} db.password.0=${MYSQL_SERVICE_PASSWORD} +## DB connection pool settings +db.pool.config.connectionTimeout=${DB_POOL_CONNECTION_TIMEOUT:30000} +db.pool.config.validationTimeout=10000 +db.pool.config.maximumPoolSize=20 +db.pool.config.minimumIdle=2 ### The auth system to use, currently only 'nacos' and 'ldap' is supported: nacos.core.auth.system.type=${NACOS_AUTH_SYSTEM_TYPE:nacos} ### worked when nacos.core.auth.system.type=nacos