实用程序模块
支持平台运营的辅助模块集合。采用按需运行的方式,而非持续运行。
容器镜像中包含的模块是固定的,下表中相当多的模块不包含在当前镜像中。在容器内查找相应路径时会找不到。
| 模块 | 用途 | 当前发布版本 |
|---|---|---|
| backup | 集成备份(PG / Cassandra / 文件) | ✅ 包含在数据湖容器中 |
| mirror-maker | 数据复制(HA / DR) | ✅ 独立容器 — mirror 配置文件中默认关闭 |
| api | REST API 客户端库 | ✅ 外部 Java 项目使用的库(与容器无关) |
| setup | 初始模型批量导入(CSV) | ❌ 镜像不包含 |
| recovery | 数据恢复 | ❌ 镜像不包含 |
| exporter | 时序数据 CSV 导出 | ❌ 镜像不包含 |
| migrator | Cassandra 数据迁移 | ❌ 2026-08-30 已移除 |
| lab | Jupyter / Metabase 分析环境 | ❌ 2026-08-30 已移除 |
migrator 和 lab 因为«编排器不调用、没有 unit 文件、实际上没有运行的进程»这个原因被明确从镜像中去除了(lab 原本占用镜像 792MB)。
如果需要上述功能,请联系 webmaster@kopens.com。
包含在数据湖容器中的模块在容器内运行。
cd /opt/kopens/plantpulse-platform-docker/bin
./shell.sh
plantpulse-setup
以下内容仅供单独拥有此模块的环境参考。
基于 CSV 文件的站点 / 资产 / OPC / 标签模型批量导入。
cd /opt/kopens/plantpulse-platform/plantpulse-setup/bin
./setup.sh \
--host ${PP_HOST_IP} --port 7003 \
--user api --password 'api123!' \
--dir /opt/kopens/plantpulse-platform/plantpulse-setup/model/_example
CSV 文件顺序:
1_SITE_LIST.csv— 站点列表2_ASSET_TREE.csv— 资产层级3_OPC_LIST.csv— OPC 服务器连接4_TAG_LIST.csv— 标签定义
plantpulse-backup
PostgreSQL(pgBackRest)、Cassandra(Medusa)、文件(Restic)集成备份。
cd /opt/kopens/plantpulse-platform/plantpulse-backup/bin
./backup.sh --install # 초기 설정
./backup.sh --postgres # PG Differential (기본)
./backup.sh --postgres full # PG Full
./backup.sh --postgres incr # PG Incremental
./backup.sh --cassandra # Cassandra Differential
./backup.sh --cassandra full # Cassandra Full
./backup.sh --purge # 보관 정책 정리
./backup.sh --cron-install # 크론 자동 등록
./backup.sh --cron-remove
# 파일 백업
/opt/kopens/plantpulse-platform/plantpulse-backup/etc/run_restic.sh
详见 备份与恢复。
plantpulse-recovery
按时间段重新处理特定资产的时序数据。
cd /opt/kopens/plantpulse-platform/plantpulse-recovery/bin
./recovery.sh ASSET_01032 20260101 20260530
plantpulse-exporter
时序数据 CSV 导出 + 大容量 dsbulk。
cd /opt/kopens/plantpulse-platform/plantpulse-exporter/bin
# 에셋 단위 CSV 추출
./export.sh ASSET_01032 20260101 20260530 /tmp
# 테이블 전체 벌크 언로드 (dsbulk)
./bulk-unload.sh pp tm_tag_point
# → /data1/pp-backup/cassandra/bulk/tm_tag_point.gz
# 벌크 로드 (복원)
./bulk-load.sh pp tm_tag_point
plantpulse-migrator
基于 Spark 的 Cassandra 服务器间迁移(服务器更换 / 集群迁移)。
cd /opt/kopens/plantpulse-platform/plantpulse-migrator/bin
./run.sh 192.168.0.41 192.168.0.237 pp.tm_tag_point
plantpulse-mirror-maker
数据复制(HA / DR)。在独立容器中运行,与 mirror 配置文件绑定,默认不启动。
cd /opt/kopens/plantpulse-platform-docker
# 켜기
docker compose -f compose/docker-compose.yml --profile mirror up -d plantpulse-mirror-maker
# 상태 · 로그
docker compose -f compose/docker-compose.yml --profile mirror ps
bin/logs.sh plantpulse-mirror-maker
配置方式与其他容器相同,通过 compose 的环境变量传入。
plantpulse-simulator
用于测试 / 演示的时序数据模拟器。基于 RANDOM 或 CSV,最大 10,000 MPS。
cd /opt/kopens/plantpulse-platform/plantpulse-simulator/bin
vi run.sh # TYPE, MPS, CSV 설정
./run-daemon.sh
./log-viewer.sh
./stop.sh
配置示例:
TYPE="RANDOM" # RANDOM | CSV
MPS="10000" # 초당 메시지 수
PROTOCOL="KAFKA"
# CSV 모드
CSV="/home/simul/data/20260530.csv"
SPEED="1.0" # 1.0 실시간, 2.0 2배속
plantpulse-api
PlantPulse REST API 客户端 Java 库。
plantpulse-api/
├── lib/ # 의존 jar
└── target/
├── plantpulse-api.jar
├── plantpulse-buffer.jar
├── plantpulse-cassandra-3.0.jar
├── plantpulse-cassandra.jar
└── plantpulse-cep-api.jar
在外部 Java 项目的 pom.xml / build.gradle 中添加依赖后使用。详见 API 使用手册。
plantpulse-lab
Jupyter · Metabase 不由编排器启动,且没有实际运行的进程,原本占用镜像 792MB 已移除。
Web 控制台中可能仍会显示 Jupyter 卡片,但该卡片在此更改前后都不能正常工作。如需分析环境,建议在外部单独部署,通过 Kyuubi(10000) · PostgreSQL(5432) 连接。
为数据科学家 / 开发人员提供的分析环境。
plantpulse-lab/
├── jupyter/ # Jupyter Notebook
│ ├── bin/
│ ├── logs/
│ └── notebook/ # 노트북 저장소
└── metabase/ # Metabase (BI 도구)
├── bin/
└── metabase.jar
Jupyter
cd /opt/kopens/plantpulse-platform/plantpulse-lab/jupyter/bin
./start.sh
# 기본 포트 8888
预装 PySpark / cassandra-driver / psycopg2,可直接进行分析。
Metabase
cd /opt/kopens/plantpulse-platform/plantpulse-lab/metabase/bin
./start.sh
# 기본 포트 3001
为非开发人员提供的可视化 BI 仪表板。直接连接 PostgreSQL / Kyuubi。