Skip to content

Add IoTDB Edge distribution: ConfigNode + DataNode merged in one JVM - #18538

Open
JackieTien97 wants to merge 2 commits into
masterfrom
edge-version
Open

Add IoTDB Edge distribution: ConfigNode + DataNode merged in one JVM#18538
JackieTien97 wants to merge 2 commits into
masterfrom
edge-version

Conversation

@JackieTien97

@JackieTien97 JackieTien97 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

IoTDB's default configuration and startup parameters assume the machine is exclusively dedicated to IoTDB (heap sized from machine memory: DataNode 50% uncapped, ConfigNode 30% capped at 8G). On edge machines that also run other processes this is far too aggressive. This PR adds an IoTDB Edge distributionapache-iotdb-edge-${version}-all-bin — whose defaults target a total process RSS of ~512 MB, validated on Raspberry Pi 4B class devices.

Changes

New entry point (one JVM, both nodes)

  • org.apache.iotdb.edge.EdgeNode (in iotdb-core/confignode, which already depends on iotdb-server): bootstraps the ConfigNode on a background thread, waits for its internal RPC port to accept connections, then starts the DataNode in the same JVM. This saves a whole JVM's fixed overhead (metaspace, code cache, GC structures, thread stacks) — ~140 MB measured. All logs go through i18n'd ConfigNodeMessages constants (en/zh in key parity).
  • Shared-singleton audit: ports / data dirs / JMX bean names don't collide; the internal MetricService singleton is safe because both node metric levels default to OFF in the edge config.

One pair of lifecycle scripts only

  • sbin/start-edge.sh / stop-edge.sh (+ Windows start-edge.bat / stop-edge.bat). No separate ConfigNode/DataNode scripts in this package. start-edge.sh sets CONFIGNODE_HOME explicitly so the ConfigNode resolves its directories against the installation dir rather than the process working directory (a real pitfall found during testing).
  • conf/edge-env.sh (+ .bat): fixed small JVM budget, overridable via environment variables — Xmx 224M / Xms 64M, direct 96M, metaspace 160m, SerialGC, Xss320k, ActiveProcessorCount=2.

Edge-tuned defaults (conf/iotdb-system.properties in the edge package only)

  • Small fixed thread pools (query 2, compaction 2/1/1, flush 2, MPP exchange 2/2, …) instead of CPU-core-based sizing.
  • 1M WAL buffer, 4M tsfile write buffer, 128M compaction target file size.
  • schema/data_region_group_extension_policy=CUSTOM with 1 region group per database, series_slot_num=1.
  • Compaction throughput capped at 8 MB/s to stay polite on shared disks; cn/dn_metric_level=OFF.

Packaging

  • distribution/src/assembly/edge.xml + conf-edge/ resources; the default mvn package -pl distribution -am build now also produces apache-iotdb-edge-${version}-all-bin (dir/zip + sha512), alongside the unchanged regular packages.
  • all.xml excludes the edge scripts from the regular all-bin distribution (same pattern as ainode), so regular packages are byte-identical in layout to before.

Validation

Full test report (machine specs incl. Raspberry Pi 4B): https://timechor.feishu.cn/docx/Hlf0dyQ4FoQsf4xEFnSc4TTknIg?from=from_copylink

  • Raspberry Pi 4B (4×Cortex-A72/8G/SD): ≥ 10,000 series across tree-aligned / tree-non-aligned / table models, 30-min soak per shape, zero failed points, zero OOM; idle RSS ~194 MB.
  • Edge package smoke on Pi: start-edge → CLI insert/select → stop-edge, clean shutdown verified.
  • mvn package -pl distribution -am -DskipTests passes; all 37 Java modules compile under -P with-zh-locale (i18n keys in en/zh parity).

Produce apache-iotdb-edge-${version}-all-bin from the default distribution
build, targeting resource-constrained edge machines that share the host
with other processes (about 512 MB total process RSS by default).

- EdgeNode (iotdb-core/confignode, org.apache.iotdb.edge): bootstraps the
  ConfigNode on a background thread, waits for its internal RPC port, then
  starts the DataNode in the same JVM, saving a whole JVM's fixed overhead
  (~140 MB validated on x86 and Raspberry Pi 4B).
- One pair of lifecycle scripts only: sbin/start-edge.sh / stop-edge.sh
  (plus Windows bats); no separate ConfigNode/DataNode scripts in this
  package. start-edge.sh sets CONFIGNODE_HOME explicitly so the ConfigNode
  resolves its directories against the installation dir.
- conf/edge-env.sh: fixed small JVM budget (Xmx 224M, direct 96M,
  metaspace 160m, SerialGC, Xss320k, ActiveProcessorCount=2).
- Edge-tuned iotdb-system.properties defaults: small thread pools, 1M WAL
  buffer, 4M tsfile write buffer, 128M compaction target, CUSTOM region
  policy with 1 region group per database, series_slot_num=1, metrics off.
- Validated at 1 Hz mixed read/write on x86 (>=20k series) and
  Raspberry Pi 4B (>=10k series, 30-min soak per shape, zero failed points).
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.23%. Comparing base (6aec4b8) to head (f2535c3).

Files with missing lines Patch % Lines
.../src/main/java/org/apache/iotdb/edge/EdgeNode.java 0.00% 36 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18538      +/-   ##
============================================
- Coverage     42.23%   42.23%   -0.01%     
  Complexity      413      413              
============================================
  Files          5409     5410       +1     
  Lines        389925   389961      +36     
  Branches      50970    50973       +3     
============================================
+ Hits         164685   164689       +4     
- Misses       225240   225272      +32     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant