fix(config): Correct three-node HA orchestration and Nacos config loading

This commit is contained in:
2026-04-18 21:01:43 +08:00
parent 9ac4c40d1d
commit 9275fa238d
8 changed files with 106 additions and 28 deletions
+16 -7
View File
@@ -145,7 +145,7 @@ spring:
scg:
fallback:
mode: response
response-body: ''{"code":500,"message":"服务不可用,请稍后再试"}''
response-body: '{"code":500,"message":"服务不可用,请稍后再试"}'
gateway:
ignore:
@@ -185,7 +185,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_auth?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 0
@@ -215,7 +215,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_user?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 1
@@ -257,7 +257,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_content?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 2
@@ -320,7 +320,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_comment?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 3
@@ -366,7 +366,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_recommend?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 4
@@ -428,7 +428,7 @@ spring:
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/video_admin?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: ${MYSQL_ROOT_PASSWORD}
password: ${MYSQL_PASSWORD:${MYSQL_ROOT_PASSWORD}}
data:
redis:
database: 5
@@ -469,3 +469,12 @@ operation-log:
app:
init:
admin-password: ${ADMIN_INIT_PASSWORD}', '', '', 'nacos', '');
-- ============================================
-- 修正 Nacos 2.x 读取所需的元数据
-- ============================================
UPDATE config_info
SET md5 = MD5(content),
type = 'yaml'
WHERE data_id LIKE '%.yaml'
AND (md5 IS NULL OR md5 = '' OR type IS NULL OR type = '');