Add IoTDB Edge distribution: ConfigNode + DataNode merged in one JVM - #18538
Open
JackieTien97 wants to merge 2 commits into
Open
Add IoTDB Edge distribution: ConfigNode + DataNode merged in one JVM#18538JackieTien97 wants to merge 2 commits into
JackieTien97 wants to merge 2 commits into
Conversation
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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 distribution —
apache-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(iniotdb-core/confignode, which already depends oniotdb-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'dConfigNodeMessagesconstants (en/zh in key parity).MetricServicesingleton is safe because both node metric levels default toOFFin the edge config.One pair of lifecycle scripts only
sbin/start-edge.sh/stop-edge.sh(+ Windowsstart-edge.bat/stop-edge.bat). No separate ConfigNode/DataNode scripts in this package.start-edge.shsetsCONFIGNODE_HOMEexplicitly 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.propertiesin the edge package only)schema/data_region_group_extension_policy=CUSTOMwith 1 region group per database,series_slot_num=1.cn/dn_metric_level=OFF.Packaging
distribution/src/assembly/edge.xml+conf-edge/resources; the defaultmvn package -pl distribution -ambuild now also producesapache-iotdb-edge-${version}-all-bin(dir/zip + sha512), alongside the unchanged regular packages.all.xmlexcludes 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
mvn package -pl distribution -am -DskipTestspasses; all 37 Java modules compile under-P with-zh-locale(i18n keys in en/zh parity).