Skip to main content

plantpulse-batch (Batch Processing)

Role​

A schedule-based batch job executor. Performs daily/hourly/monthly statistical aggregation, data cleanup, report generation, and OEE/RAM/EMS plugin calculations.

ItemValue
Module Nameplantpulse-batch
Installation Path/opt/kopens/plantpulse-platform/plantpulse-batch/
Port9500
SchedulerQuartz (PostgreSQL JDBC store)

Key Responsibilities​

  • Hourly / Daily / Monthly aggregation (tag → asset)
  • OEE / RAM / EMS plugin calculations
  • Automated report generation
  • Application of data retention policies
  • Data integrity validation

Architecture​

Directory Structure​

plantpulse-batch/
├── config/
│ └── plantpulse-batch.properties # 배치 설정 (외부화 — 배포해도 유지)
├── bin/start.sh stop.sh log-viewer.sh
├── logs/system.log
└── server/ # 내장 Tomcat (webapps/ROOT.war)
└── conf/server.xml

Key Configuration​

plantpulse-batch/config/plantpulse-batch.properties — Generated by rendering a template at startup. If you edit this file directly, it will disappear on the next startup, so the place to modify is the template in /etc/kopens/conf/ → How to change settings.

# 메타스토어 (PostgreSQL)
metastore.url=jdbc:postgresql://${PP_POSTGRES_HOST}:${PP_POSTGRES_PORT}/${PP_DB_NAME}
metastore.user=${PP_PG_USER}
metastore.password=${PP_PG_PASSWORD}

# 시계열 저장소 (Cassandra) / TSE
storage.db.host=${PP_CASSANDRA_HOST}
storage.db.keyspace=${PP_KEYSPACE}
tse.host=${PP_TSE_HOST}

# 배치 동작
batch.timer_schedule_delay=5000 # 배치 타이머 주기 (ms)
batch.thread_pool_batch_thread_size=4 # 배치 워커 스레드 수
batch.buffer_drain_limit_size=10000 # 1회 드레인 최대 건수
batch.sync.tse.enabled=true # TSE 동기화
batch.sync.external.db.enabled=false # 외부 DB 동기화 (TimescaleDB/InfluxDB/QuestDB)

Operational Commands​

cd /opt/kopens/plantpulse-platform/plantpulse-datalake-cli/bin

./restart-batch.sh
./pd status # 9500 RUNNING 확인

# 표준 헬스체크 (익명, readiness — 배치 파이프라인 가동·Redis 연결 시에만 UP)
curl -fsS http://127.0.0.1:9500/api/health
# 준비 완료: 200 {"status":"UP","service":"plantpulse-batch-web","ts":...,"checks":{"timer":true,"redis":true}}
# 기동 전: 503 {"status":"STARTING",...} / 기동 후 의존성 다운: 503 {"status":"DEGRADED",...}

Individual jobs can be executed, paused, or triggered from the console's System > Batch Management menu.

Commonly Occurring Issues​

SymptomCauseAction
Job not runningQuartz lock / cluster conflictCheck the qrtz_locks table
Missing aggregation resultsData time range discrepancy for target dataCheck batch cycle (batch.timer_schedule_delay) and target period settings
Out of memoryLarge window processingIncrease heap or split windows