Skip to main content

plantpulse-batch (Batch Processing)

Role

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)

Primary responsibilities

  • Hourly / daily / monthly aggregation (tag → asset)
  • OEE / RAM / EMS plugin calculation
  • Automated report generation
  • Data retention policy enforcement
  • 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.propertiesconfigure.sh generates env.sh values by substitution. Do not edit files within the web application (they are removed during deployment).

# 메타스토어 (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)

Operations 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",...}

From the console, use System > Batch Management to run, pause, or trigger individual jobs.

Common issues

SymptomCauseAction
Job does not runQuartz lock / cluster conflictCheck qrtz_locks table
Aggregation results missingTarget data time range errorVerify batch interval (batch.timer_schedule_delay) and target period settings
Out of memoryLarge window processingIncrease heap or split window