feat(3c): 3센터 A-A-A 기동 스크립트 + 인프라 멱등화

- run-3centers.cmd: 공유 인프라 + DC1(3c,순번기) + DC2/DC3 일괄 기동 오케스트레이터
- run-dc2/dc3: CHANEL_URL(자기 센터 Chanel 8191/8291) + RTGS_CONTROL_ENABLED=false
- start-infra-native: Kafka 9092 LISTENING이면 재기동 skip(중복 창 방지, 멱등)
- run-dt.cmd: 단말(DT) dev 서버 기동
- 전제: PostgreSQL max_connections>=300(19서비스 커넥션)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
rtgs
2026-07-16 17:33:27 +09:00
parent 5b706bfc33
commit d180d516cd
5 changed files with 59 additions and 2 deletions

View File

@@ -38,8 +38,14 @@ if not exist "%KDATA%\kraft-logs\meta.properties" (
for /f "delims=" %%i in ('%KAFKA%\bin\windows\kafka-storage.bat random-uuid') do set "CID=%%i"
"%KAFKA%\bin\windows\kafka-storage.bat" format -t %CID% -c "%KDATA%\server.properties"
)
rem 멱등: 9092가 이미 LISTENING이면 재기동 안 함(중복 Kafka 창 방지 — run-3centers에서 두 번 호출돼도 안전).
netstat -ano | findstr ":9092" | findstr LISTENING >nul
if errorlevel 1 (
echo [infra] starting Kafka :9092 (new window; keep it open)...
start "RTGS Kafka :9092" cmd /k "%KAFKA%\bin\windows\kafka-server-start.bat %KDATA%\server.properties"
) else (
echo [infra] Kafka already running (:9092).
)
echo.
echo [infra] PostgreSQL :5433 (db rtgs), Kafka :9092 up. (MongoDB not used - docs in PostgreSQL)

35
run-3centers.cmd Normal file
View File

@@ -0,0 +1,35 @@
@echo off
rem ===================================================================
rem RTGS 3센터(DC1/DC2/DC3) A-A-A 일괄 기동 — 멀티센터 기능 점검용.
rem 공유 인프라(PostgreSQL:5433 / Kafka:9092) + 단일 전역 순번기(DC1 :8090)
rem DC1 8090~8099 / DC2 819x / DC3 829x. DB: rtgs_dc1 / rtgs_dc2 / rtgs_dc3.
rem ※ 클린 스타트가 필요하면(센터간 완전 동일 보장): stop 후 kraft-logs 재포맷 + rtgs_dc1/2/3 drop&create.
rem ※ 전제: PostgreSQL max_connections >= 300 (19서비스 x HikariCP). 부족 시 pgsql-data\postgresql.conf 수정 후 재시작.
rem ===================================================================
call C:\ai-dev\scripts\env.cmd
echo [3c] 1) 공유 인프라 기동(PostgreSQL/Kafka)...
call "%~dp0infra\start-infra-native.cmd"
echo [3c] Kafka 수용 대기...
timeout /t 12 /nobreak >nul
echo [3c] 2) 센터별 DB 생성(rtgs_dc1/2/3)...
call "%~dp0infra\init-3centers-db.cmd"
echo [3c] 3) DC1 기동(3센터 모드: 순번기 + 6서비스, db=rtgs_dc1, 정족수 2/3)...
set "CENTER_COUNT=3"
set "POSTGRES_DB=rtgs_dc1"
call "%~dp0run-dc1.cmd"
echo [3c] DC1 안정화 대기...
timeout /t 15 /nobreak >nul
echo [3c] 4) DC2 기동(819x, db=rtgs_dc2)...
call "%~dp0run-dc2.cmd"
echo [3c] 5) DC3 기동(829x, db=rtgs_dc3)...
call "%~dp0run-dc3.cmd"
echo.
echo [3c] 3센터 기동 완료.
echo 콘솔(모니터링): run-frontend.cmd -^> http://localhost:5174 (상단에서 DC1/DC2/DC3 전환)
echo 단말(DT): run-dt.cmd -^> http://localhost:5180 (접속 센터 선택)

View File

@@ -11,6 +11,9 @@ set "JAVA_HOME=%JDK21_HOME%"
set "CENTER_ID=DC2"
set "CENTER_COUNT=3"
set "POSTGRES_DB=rtgs_dc2"
rem DC2 Gucci는 자기 센터 Chanel(8191)로 프록시(기본 8091=DC1 방지). 서비스제어는 DC1 포트 기준이라 비활성.
set "CHANEL_URL=http://localhost:8191"
set "RTGS_CONTROL_ENABLED=false"
echo [run-dc2] starting DC2 ledger/edge services on JDK21 (db=%POSTGRES_DB%, ports 819x)...
rem LouisVuitton 먼저(Flyway가 rtgs_dc2 스키마 생성) → 원장/엣지

View File

@@ -11,6 +11,9 @@ set "JAVA_HOME=%JDK21_HOME%"
set "CENTER_ID=DC3"
set "CENTER_COUNT=3"
set "POSTGRES_DB=rtgs_dc3"
rem DC3 Gucci는 자기 센터 Chanel(8291)로 프록시(기본 8091=DC1 방지). 서비스제어는 DC1 포트 기준이라 비활성.
set "CHANEL_URL=http://localhost:8291"
set "RTGS_CONTROL_ENABLED=false"
echo [run-dc3] starting DC3 ledger/edge services on JDK21 (db=%POSTGRES_DB%, ports 829x)...
rem LouisVuitton 먼저(Flyway가 rtgs_dc3 스키마 생성) → 원장/엣지

10
run-dt.cmd Normal file
View File

@@ -0,0 +1,10 @@
@echo off
rem RTGS 단말(DT, :5180). 접속 센터(DC1/DC2/DC3)를 골라 각 센터 Gucci 관문으로 이체/조회.
call C:\ai-dev\scripts\env.cmd
cd /d "%~dp0frontend"
if not exist node_modules (
echo [run-dt] installing dependencies...
call npm install
)
echo [run-dt] npm run dev:dt (http://localhost:5180/dt.html)
call npm run dev:dt