Skip to main content

(legacy) Full H/W Installation — native tools/setup.sh

This page is a legacy procedure kept as a reference for maintaining native deployment boxes older than 2026.05. For new H/W, production shipments, and new field installations, use Quick Install (install.sh).

Do not use this for new installations

tools/setup.sh assumes a native plantpulse.service and a direct-on-host execution structure. The 2026.05+ container standard has a single plantpulse-edge.service managing the runtime. Mixing the two modes on the same box causes port and data path conflicts.

When this document still applies

Use it only when you must reinstall or recover an older box already running in native mode, or when you need to cross-check legacy field handover documents. For a new box, go back to Installation — At a Glance.


1. Prerequisites (legacy native)

ItemValue
OSFedora 38 (the validation baseline at the time — other RHEL-family distributions may work, but require separate validation)
Privilegesroot (sudo -i or direct root login)
NetworkInternet connection (dnf packages + legacy native bundle download)
Disk~3GB on /opt, 100GB+ for data on /data1 (separate partition recommended)
Memory8GB minimum (Cassandra 4GB heap + Tomcat 4GB)
NIC count2 (NIC 1 = WAN/external, NIC 2 = PLC/internal) — industrial appliance standard
TimeInternet NTP reachable (chrony installed)
ClassCPURAMSSDNICPrice class
Small (≤ 1k tags)4 cores / 2.0GHz+8GB256GB2x 1GbpsIndustrial mini PC
Medium (1k–10k tags)8 cores / 2.5GHz+16GB512GB SSD + 1TB HDD2x 1GbpsIndustrial appliance
Large (10k+ tags)16 cores / 3.0GHz+32GB+1TB NVMe2x 10Gbps1U server

2. Location

/opt/kopens/tools/setup.sh ← 메인 setup 스크립트
/opt/kopens/tools/net/ ← 네트워크 set-1.sh / set-2.sh / status.sh / ping.sh
/opt/kopens/tools/firewall/open.sh ← firewalld 포트 오픈
/opt/kopens/tools/file/run.sh ← TCP / file limit / sysctl 튜닝
/opt/kopens/tools/file/sysctl.conf ← 커널 튜닝
/opt/kopens/tools/file/limits.conf ← 프로세스 리소스 한도
/opt/kopens/tools/file/chrony.conf ← NTP
/opt/kopens/tools/docker/setup.sh ← Docker CE 설치
/opt/kopens/tools/java/setup.sh ← Amazon Corretto 17
/opt/kopens/tools/python/setup.sh ← Python 3 + pip
/opt/kopens/tools/nodejs/setup.sh ← Node.js + npm
/opt/kopens/tools/ssl/gen.sh ← 자체 서명 인증서 발급 (CA + 서버)
/opt/kopens/tools/vpn/setup.sh ← VPN 클라이언트
/opt/kopens/tools/service/plantpulse.service ← systemd unit
/opt/kopens/tools/service/service-start.sh ← systemd ExecStart → bin/start.sh
/opt/kopens/tools/service/service-stop.sh ← systemd ExecStop → bin/stop.sh

3. Execution — legacy native one-liner

# 1) root 권한
sudo -i

# 2) 작업 디렉토리
cd /opt/kopens/tools

# 3) 실행 (대화형 — 호스트명 + 네트워크 설정을 묻습니다)
./setup.sh

Total time: 15–30 minutes (depending on internet speed + dnf package downloads + tuned boot). When it finishes, the box reboots automatically after 10 seconds — the legacy plantpulse.service starts automatically after reboot.


4. Step-by-Step Input Guide (interactive prompts)

The following inputs are requested in order during installation.

4.1 Hostname

[?] INPUT THIS EDGE GATEAY HOSTNAME :
=> EDGE_00303

Used to identify the gateway. Enter EDGE_<4-digits> or follow your site convention. Example: EDGE_00303.

4.2 NIC 1 (WAN / external network) — enp1s0

[?] ETHERNET [enp1s0] MODE [DHCP|STATIC] :
ModeInputThen
DHCPIP obtained automaticallyNo further input
STATICUse static IPAdditional input for IP/mask, gateway, DNS

Additional prompts when STATIC:

[?] ETHERNET [enp1s0] IP/SUBNETMASK : 192.168.0.50/24
[?] ETHERNET [enp1s0] GATEWAY : 192.168.0.1
[?] ETHERNET [enp1s0] DNS : 8.8.8.8

This NIC is used to reach the default gateway (external internet / cloud / Platform API). DNS is either your corporate DNS or a public DNS.

4.3 NIC 2 (PLC / internal network) — enp2s0

The same sequence once more. Since this is dedicated to the PLC network, STATIC is normally used for clean separation:

[?] ETHERNET [enp2s0] MODE [DHCP|STATIC] : STATIC
[?] ETHERNET [enp2s0] IP/SUBNETMASK : 192.168.100.10/24
[?] ETHERNET [enp2s0] GATEWAY : 192.168.100.1
[?] ETHERNET [enp2s0] DNS : 192.168.100.1

This NIC is not used as the default gateway (ipv4.never-default yes) — it is dedicated to private-network communication with the PLCs, separated from WAN routing.

4.4 Network Verification + Time Synchronization

setup.sh automatically runs nmcli con up, then verifies external reachability with ping and synchronizes NTP with chronyc makestep. The output is normal if you see OK or an IP / RTT.


5. All 22 setup.sh Steps — In Detail

#StepActionExpected output
1Register KOPENS_HOME environment variablesAppended to /etc/bashrc(silent)
2Set hostnamehostnamectl set-hostname(silent)
3Create ${PE_HOME}/conf/env.shPE_HOME / PE_DATA_DIR / JAVA_HOME / CLEAN_ON_STARTUPenv.sh output
4Create ${PE_DATA_DIR} (/data1) directoriesmkdir -p/data1
5Network configurationnet/set-1.sh (NIC 1, WAN), net/set-2.sh (NIC 2, PLC), NetworkManager restartnmcli output
6Verify net/status.sh + net/ping.shInterface status + external pingRTT output
7Locale / timezoneko_KR.utf8 + Asia/Seouldate
8OS updatednf -y updatednf progress display
9Install required packagestar / htop / fping / pv / firefox / java-17-openjdk-devel / jna / jemalloc / zstd / curl-devel / chrony / tuned / net-tools / numactl / nodejs / npm / python3 / fail2ban / gcc / glibc-devel / NetworkManager-tuidnf progress
10Tuningtuned-adm profile throughput-performance + disable GNOME power savingActive profile: throughput-performance
11Firewalltools/firewall/open.sh (see table 5.1 below)firewall-cmd --list-all
12NTP (chrony)Apply chrony.conf + enable service + sync via hwclock -wchronyc ntpdata
13TCP / file limit / sysctltools/file/run.sh (see table 5.2 below)(silent)
14CPU governorAll CPUs to performance mode(silent)
15NUMA + Hugepagesvm.zone_reclaim_mode=0 + disable transparent hugepages + reserve 9216 hugepagesnumactl --show
16Dockertools/docker/setup.sh (Docker CE)docker version
17Java 17Amazon Correttojava -version
18Python 3 / NodeJSdnf installpython3 --version
19Issue SSL certificatetools/ssl/gen.sh — self-signed CA + server cert (/var/security/plantpulse/)openssl output
20VPNtools/vpn/setup.shVPN client installed
21dnf clean allCache cleanup(silent)
22Register systemdCopy /etc/systemd/system/plantpulse.service + systemctl enable plantpulseservice registered
23Automatic rebootAfter a 10-second countdown*** NOW REBOOT AFTER 10 SEC! ***

set -e is enabled, so the script aborts immediately if any step fails.

5.1 Firewall — Ports Opened Automatically

tools/firewall/open.sh permanently adds the following TCP ports to the public zone:

PortPurpose
22 (TCP/UDP)SSH
80, 443 (TCP)Web UI (/ui/main)
123 (TCP/UDP)NTP
1880 (TCP)Node-RED (backend of /ui/flow)
3000 (TCP)Grafana (time series dashboards)
4000 (TCP)APM / monitoring
7000, 7001, 9042 (TCP)Cassandra (gossip / SSL gossip / client)
7799 (TCP)JMX (Tomcat monitor)
7800, 7801 (TCP)timeseries-engine
9090 (TCP)Cockpit (server management)
12000, 12443 (TCP)OPC-UA (TCP / TLS)
19999 (TCP)NetData

In addition, --add-masquerade is enabled so Docker containers are NATed onto the host network.

5.2 sysctl Tuning (part of /etc/sysctl.conf)

net.ipv4.tcp_keepalive_time = 60 # PLC TCP keepalive 빠르게
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 10
net.core.rmem_max = 16777216 # 16MB 수신 버퍼
net.core.wmem_max = 16777216 # 16MB 송신 버퍼
net.core.somaxconn = 1024
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
vm.max_map_count = 1048575 # Cassandra mmap
vm.overcommit_memory = 1 # Cassandra hint
vm.swappiness = 1 # 최소 스왑

6. After Reboot — Verify Native Operation (1 minute)

# 1) systemd 서비스 살아있는지
systemctl status plantpulse
# 예: active (running) since ...

# 2) 모든 컴포넌트 프로세스
/opt/kopens/plantpulse-edge/bin/ps.sh

# 3) 시스템 헬스 (200 OK 면 게이트웨이 정상)
curl -s http://127.0.0.1/api/v1/system/health | jq

# 4) OPC-UA 트리 (등록된 OPC 가 0 이어도 OK — 빈 배열)
curl -s http://127.0.0.1/ui/opcua/tree | jq '.data.tree | length'

# 5) 웹 UI
# 브라우저 → https://<gateway>/ui/main
# 좌상단 로고 + 30개 카드가 보이면 정상

7. Integrated systemd Operation (legacy native)

After installation, systemd manages the gateway automatically:

sudo systemctl start plantpulse # 시작 (start.sh 호출)
sudo systemctl stop plantpulse # 정지 (stop.sh 호출)
sudo systemctl status plantpulse # 상태
sudo systemctl restart plantpulse # 풀스택 재시작 (60초+ 다운타임)
sudo journalctl -u plantpulse -n 100 # systemd 로그 마지막 100줄

Restarting Tomcat only (to apply code / app.properties changes) is bin/restart.sh (~6 seconds). systemd restart is a full-stack restart (stop.shstart.sh).

Internal wiring:

  • plantpulse.serviceExecStart=service-start.shbin/start.sh
  • plantpulse.serviceExecStop=service-stop.shbin/stop.sh

8. Common Pitfalls

StepSymptomCause / Resolution
5 (network)SSH drops after set-1.shNetwork interface / gateway misconfigured. Access via console (KVM/IPMI) and recover nmcli con modify enp1s0 ipv4.address ... manually
5 (network)NIC name is not enp1s0 (e.g. eth0, eno1)Check the NIC names on the OS (nmcli dev). Edit the IF=enp1s0 lines in tools/net/set-1.sh to the actual names, then rerun setup.sh
8 (dnf)dnf update hangsCheck the line / corporate dnf mirror. On a corporate network, add the internal mirror to /etc/yum.repos.d/
9 (packages)Some packages missing (e.g. firefox not available)Minimal installation ISO. The gateway itself works fine without those packages — ignore and continue
10 (tuned)tuned-adm not founddnf install tuned missing. Install it manually, then resume setup.sh from step 11
11 (firewall)firewall-cmd --reload failsfirewalld not running. Run systemctl start firewalld manually. Also check whether SELinux is enforcing
15 (hugepages)Hugepages are released after bootAdd vm.nr_hugepages = 9216 permanently to /etc/sysctl.d/99-plantpulse.conf
22 (systemd)Gateway does not come up after rebootCheck the unit failure cause with journalctl -u plantpulse --no-pager. Run bin/start.sh directly to find where it stalls
set -eAborts midwayCheck the preceding step named in the message body. Run only that step manually, then resume setup.sh from the next step
GeneralScript execution permissionchmod +x /opt/kopens/tools/setup.sh (rarely needed)

  1. Log in to the web UI and change the password/ui/main → user menu at top right → change password
  2. Verify site / edge IDsite.id, edge.id in System Configuration
  3. Set up Sparkplug B integrationSparkplug B (if needed)
  4. Add the first PLC connectionAdding a New PLC Connection
  5. Register a scheduled backup cronBackup (backup.sh)

10. Learn More