From 0204f748e66de13a1095cf59e3e72a8edd4e6277 Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 1 Feb 2026 23:01:45 -0800 Subject: [PATCH] =?UTF-8?q?fix(debezium):=20outbox=20connector=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=94=AF=E6=8C=81=20standalone=20=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=20(postgres-2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - database.hostname 从硬编码 "postgres" 改为 ${DEBEZIUM_DB_HOST:-postgres} - database.user/password 改为环境变量替换 ${POSTGRES_USER}/${POSTGRES_PASSWORD} - standalone 模式设置 DEBEZIUM_DB_HOST=postgres-2 - shared 模式不设置,默认值 postgres 保持不变 Co-Authored-By: Claude Opus 4.5 --- backend/services/deploy-mining.sh | 2 ++ .../services/scripts/debezium/auth-outbox-connector.json | 6 +++--- .../scripts/debezium/contribution-outbox-connector.json | 6 +++--- .../services/scripts/debezium/mining-outbox-connector.json | 6 +++--- .../scripts/debezium/mining-wallet-outbox-connector.json | 6 +++--- .../services/scripts/debezium/trading-outbox-connector.json | 6 +++--- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/backend/services/deploy-mining.sh b/backend/services/deploy-mining.sh index b1f34862..084024d9 100755 --- a/backend/services/deploy-mining.sh +++ b/backend/services/deploy-mining.sh @@ -271,6 +271,8 @@ load_env() { export KAFKA_BROKERS="${KAFKA_BROKERS:-192.168.1.111:9093}" export REDIS_HOST="${REDIS_HOST:-redis-2}" export RWA_NETWORK_NAME="rwa-2-network" + # Debezium outbox connector 连接的数据库主机名 (standalone 用 postgres-2) + export DEBEZIUM_DB_HOST="postgres-2" # MPC system 在 1.0 服务器上 export MPC_ACCOUNT_SERVICE_URL="${MPC_ACCOUNT_SERVICE_URL:-http://192.168.1.111:4000}" diff --git a/backend/services/scripts/debezium/auth-outbox-connector.json b/backend/services/scripts/debezium/auth-outbox-connector.json index 5cfa7888..0fa95a94 100644 --- a/backend/services/scripts/debezium/auth-outbox-connector.json +++ b/backend/services/scripts/debezium/auth-outbox-connector.json @@ -4,10 +4,10 @@ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "tasks.max": "1", - "database.hostname": "postgres", + "database.hostname": "${DEBEZIUM_DB_HOST:-postgres}", "database.port": "5432", - "database.user": "rwa_user", - "database.password": "your_secure_password_here", + "database.user": "${POSTGRES_USER:-rwa_user}", + "database.password": "${POSTGRES_PASSWORD:-your_secure_password_here}", "database.dbname": "rwa_auth", "topic.prefix": "cdc.auth", diff --git a/backend/services/scripts/debezium/contribution-outbox-connector.json b/backend/services/scripts/debezium/contribution-outbox-connector.json index f3ba6b77..c154d66f 100644 --- a/backend/services/scripts/debezium/contribution-outbox-connector.json +++ b/backend/services/scripts/debezium/contribution-outbox-connector.json @@ -4,10 +4,10 @@ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "tasks.max": "1", - "database.hostname": "postgres", + "database.hostname": "${DEBEZIUM_DB_HOST:-postgres}", "database.port": "5432", - "database.user": "rwa_user", - "database.password": "your_secure_password_here", + "database.user": "${POSTGRES_USER:-rwa_user}", + "database.password": "${POSTGRES_PASSWORD:-your_secure_password_here}", "database.dbname": "rwa_contribution", "topic.prefix": "cdc.contribution", diff --git a/backend/services/scripts/debezium/mining-outbox-connector.json b/backend/services/scripts/debezium/mining-outbox-connector.json index d8f521e0..20b5e502 100644 --- a/backend/services/scripts/debezium/mining-outbox-connector.json +++ b/backend/services/scripts/debezium/mining-outbox-connector.json @@ -4,10 +4,10 @@ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "tasks.max": "1", - "database.hostname": "postgres", + "database.hostname": "${DEBEZIUM_DB_HOST:-postgres}", "database.port": "5432", - "database.user": "rwa_user", - "database.password": "your_secure_password_here", + "database.user": "${POSTGRES_USER:-rwa_user}", + "database.password": "${POSTGRES_PASSWORD:-your_secure_password_here}", "database.dbname": "rwa_mining", "topic.prefix": "cdc.mining", diff --git a/backend/services/scripts/debezium/mining-wallet-outbox-connector.json b/backend/services/scripts/debezium/mining-wallet-outbox-connector.json index 52b04f92..406885d8 100644 --- a/backend/services/scripts/debezium/mining-wallet-outbox-connector.json +++ b/backend/services/scripts/debezium/mining-wallet-outbox-connector.json @@ -4,10 +4,10 @@ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "tasks.max": "1", - "database.hostname": "postgres", + "database.hostname": "${DEBEZIUM_DB_HOST:-postgres}", "database.port": "5432", - "database.user": "rwa_user", - "database.password": "your_secure_password_here", + "database.user": "${POSTGRES_USER:-rwa_user}", + "database.password": "${POSTGRES_PASSWORD:-your_secure_password_here}", "database.dbname": "rwa_mining_wallet", "topic.prefix": "cdc.mining-wallet", diff --git a/backend/services/scripts/debezium/trading-outbox-connector.json b/backend/services/scripts/debezium/trading-outbox-connector.json index 47f4a5ee..316ee8d7 100644 --- a/backend/services/scripts/debezium/trading-outbox-connector.json +++ b/backend/services/scripts/debezium/trading-outbox-connector.json @@ -4,10 +4,10 @@ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "tasks.max": "1", - "database.hostname": "postgres", + "database.hostname": "${DEBEZIUM_DB_HOST:-postgres}", "database.port": "5432", - "database.user": "rwa_user", - "database.password": "your_secure_password_here", + "database.user": "${POSTGRES_USER:-rwa_user}", + "database.password": "${POSTGRES_PASSWORD:-your_secure_password_here}", "database.dbname": "rwa_trading", "topic.prefix": "cdc.trading",