plantpulse-warehouse (Data Warehouse / Lakehouse)
Role
A lakehouse module that archives time series data from Cassandra to MinIO in Apache Iceberg format. Used for long-term retention, analytical query performance, and integration with other BI tools.
| Item | Value |
|---|---|
| Module name | plantpulse-warehouse |
| Installation path | /opt/kopens/plantpulse-platform/plantpulse-warehouse/ |
| Port | 9600 |
| Format | Apache Iceberg V2 |
| Storage | MinIO (S3) |
Architecture
Directory Structure
plantpulse-warehouse/
├── app/ # 웨어하우스 서비스
├── bin/start.sh stop.sh log-viewer.sh
├── config/
├── etc/ # PID 관리
├── lib/ # Spark JAR
├── logs/system.log
└── s3/
├── archive.sh # 아카이빙
└── optimize.sh # 테이블 최적화
Archiving (archive.sh)
# 전일 데이터 아카이빙 (기본)
/opt/kopens/plantpulse-platform/plantpulse-warehouse/s3/archive.sh
# 특정 날짜
/opt/kopens/plantpulse-platform/plantpulse-warehouse/s3/archive.sh 2026-05-29
- Approximately 60 seconds for 1,000,000 records
- Source: Cassandra
tm_tag_point→ MinIOplantpulse-iceberg/warehouse/tag_point/ - Partitioning:
dt=YYYY-MM-DD/hh=HH/
Iceberg Table Optimization (optimize.sh)
Merges small files, removes expired snapshots, and cleans up metadata.
/opt/kopens/plantpulse-platform/plantpulse-warehouse/s3/optimize.sh
Recommended schedule: weekly, overnight. Can be automated with Kestra workflows.
Operations Commands
cd /opt/kopens/plantpulse-platform/plantpulse-datalake-cli/bin
./restart-warehouse.sh
./pd status # 9600 RUNNING 확인
# 표준 헬스체크 (익명, 순수 liveness — 공통 3개 필드 + 시스템/JVM 메트릭 포함)
curl -fsS http://127.0.0.1:9600/api/health
# → {"status":"UP","service":"plantpulse-warehouse-s3","ts":..., ...}
Common Issues
| Symptom | Cause | Action |
|---|---|---|
| Archive job failure | Spark / Hive not ready | pd restart analytics then retry |
| Small file explosion | optimize.sh not running | Run weekly on schedule |
| MinIO disk full | retention not configured | Iceberg expire snapshots + lifecycle policy |
| Kyuubi query OOM | Large table / missing partitions | Specify WHERE dt = '...' |
SQL Query Examples
USE iceberg;
-- 메타데이터
DESCRIBE TABLE EXTENDED tag_point;
-- 5월 집계
SELECT tag_id, count(*) AS rows, min(time), max(time)
FROM tag_point
WHERE dt BETWEEN '2026-05-01' AND '2026-05-31'
GROUP BY tag_id
ORDER BY rows DESC
LIMIT 100;
-- 스냅샷 이력
SELECT * FROM tag_point.snapshots;
SELECT * FROM tag_point.history;