Operations Scenarios (Runbook)
A runbook that lets you follow entire operational procedures as they occur frequently. You can copy/execute one section from top to bottom as is.
systemctl is-active plantpulse-edge.service is active — that means container mode —
Please see Container Mode Operations instead of this page.
Failure response, OTA, and command cheat sheets are there.
Manuals are not installed inside the box. What installation places in /opt/kopens/install/ is
upgrade.sh, kopens-host-action.sh, and the bin/ operational scripts only.
This site is the authoritative source for documentation.
This page is for native box scenarios.
1. Deploying a New Version — The Safest Procedure
# 0. 작업 공지 (관제 / Slack)
echo "[$(date +%F\ %T)] 게이트웨이 업그레이드 시작 — 약 15분 소요"
# 1. 사전 백업 (자동 backup 도 있지만 수동으로 한 번 더)
$PE_HOME/bin/backup.sh
# 2. 외부 NAS / S3 로 즉시 미러
LATEST=$(ls -t /data1/pp-backup | head -1)
rsync -av /data1/pp-backup/$LATEST nas:/backup/edge/
# 3. 업그레이드 (자동으로 backup → install → start)
$PE_HOME/bin/upgrade.sh
# 4. 검증
$PE_HOME/bin/ps.sh
curl -s http://127.0.0.1/api/v1/edge | jq # 버전 확인
curl -s http://127.0.0.1/ui/opcua/tree | jq '.data.tree | length' # 사이트/태그 정상
$PE_HOME/bin/log-viewer.sh # 30초 정도 봐서 SEVERE 없는지
# (Ctrl+C)
# 5. 외부 SCADA / Sparkplug 수신측 정상 도착 여부 확인
echo "[$(date +%F\ %T)] 업그레이드 완료"
Details: Upgrade (upgrade.sh), Backup (backup.sh)
2. Quick Restart When Things Feel Stuck
$PE_HOME/bin/restart-app.sh
# 30~90초 후
curl -s http://127.0.0.1/api/v1/edge | jq
Since only the app (Tomcat) is brought back up, Cassandra · HiveMQ · Node-RED keep running.
Configuration changes are also applied. If you need to bring up the entire stack again, it's restart.sh.
Details: Restart (restart.sh)
3. Fault Diagnosis — Step by Step
# 1. 누가 죽었나?
$PE_HOME/bin/ps.sh
# 2. 어디가 시끄러운가?
$PE_HOME/bin/log-viewer.sh
# (실시간 — Ctrl+C 로 빠져나옴)
# 3. Cassandra 의심
$PE_HOME/bin/node-info.sh
# 4. Disk 의심
df -h /data1
du -sh $PE_HOME/*/log/* /data1/* 2>/dev/null | sort -h | tail -20
# 5. 다 안 맞으면 — 안전하게 단계적 재시작
$PE_HOME/bin/restart-app.sh # 1차: 앱(Tomcat)만 — 30~90초
# 그래도 이상 시
$PE_HOME/bin/restart.sh # 2차: 전체 스택 (stop + start 를 한 프로세스로)
# 그래도 이상 시
sudo $PE_HOME/bin/reboot.sh # 3차: OS 재부팅 (최후의 수단)
Details: Diagnosis and Inspection
4. Responding to Disk Full Conditions
# 1. 무엇이 차지 중?
df -h
du -sh $PE_HOME/*/log/* /data1/* 2>/dev/null | sort -h | tail -20
# 2. 로그 / 임시 파일 정리
$PE_HOME/bin/clean.sh
# 3. Cassandra 디스크 회수
$PE_HOME/bin/node-cleanup.sh
# 4. 오래된 백업 정리 (30 일 이상)
find /data1/pp-backup -maxdepth 1 -type d -mtime +30 -exec rm -rf {} +
# 5. 결과 확인
df -h
Details: Cleanup and Cleaning
5. Automating Regular Backups (cron Example)
# /etc/cron.d/plantpulse-backup
# 매일 새벽 1시에 백업, 30일 이상은 자동 삭제
0 1 * * * root /opt/kopens/plantpulse-edge/bin/backup.sh >>/var/log/pp-backup.log 2>&1
30 1 * * * root find /data1/pp-backup -maxdepth 1 -type d -mtime +30 -exec rm -rf {} +
After applying cron, check that a new /data1/pp-backup/<date>/ appears at 1:00 AM the next day.
Details: Backup (backup.sh)
6. OS Security Patches (Quarterly)
# 1. 사전 백업
$PE_HOME/bin/backup.sh
# 2. 게이트웨이 정지 (커널 업데이트 가능성 대비)
$PE_HOME/bin/stop.sh
# 3. OS 업데이트
$PE_HOME/bin/firmware.sh
# 4. 커널 업데이트 시 재부팅 필요
needs-restarting -r
# 결과가 "Reboot is required" 이면
$PE_HOME/bin/reboot.sh
# 부팅 후 ssh 다시 들어가서
$PE_HOME/bin/start.sh
# 5. 검증
$PE_HOME/bin/ps.sh
Details: Upgrade (upgrade.sh / firmware.sh)
7. After Power Outage / OS Reboot
It may auto-start via systemd registration, but manual inspection:
$PE_HOME/bin/ps.sh
# 출력이 비어있거나 일부만 살아있다면
$PE_HOME/bin/start.sh
# 또는 백그라운드로
$PE_HOME/bin/start-daemon.sh
Details: Start (start.sh)
8. Restore from Backup (Disaster Recovery)
The following is the big picture of full restoration. Do not copy and run it as-is in a production environment; carry it out with the operations team.
Detailed procedure: Backup (backup.sh) — Restoring from a Backup
9. Learn More
- For details on each script, see the left menu: Start / Stop / Restart / Backup / Upgrade / Diagnose / Cleanup
- See all scripts at a glance: Operations Overview