Skip to content

Commit 2d246b4

Browse files
authored
docs: add AI agent installation guide (#1216)
* docs: add AI agent installation guide * docs: move AI agent install entry from Download to QuickStart Remove the guide.md link from the Download pages and add the copy-paste AI assistant prompt to chapter 1 of QuickStart_apache (latest and latest-Table, both English and Chinese). * ci: pin pnpm/action-setup to v6.0.10 commit SHA The organization action allowlist requires the exact commit SHA instead of a version tag.
1 parent 5a2e85e commit 2d246b4

6 files changed

Lines changed: 197 additions & 3 deletions

File tree

.github/workflows/site-build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424

2525
- name: Install pnpm
26-
uses: pnpm/action-setup@v4
26+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
2727

2828
- name: Use Node.js 22
2929
uses: actions/setup-node@v4
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/checkout@v4
6060

6161
- name: Install pnpm
62-
uses: pnpm/action-setup@v4
62+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
6363

6464
- name: Use Node.js 22
6565
uses: actions/setup-node@v4
@@ -84,7 +84,7 @@ jobs:
8484
fetch-depth: 0
8585

8686
- name: Install pnpm
87-
uses: pnpm/action-setup@v4
87+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
8888

8989
- name: Use Node.js 22
9090
uses: actions/setup-node@v4

src/.vuepress/public/guide.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# Apache IoTDB Installation Guide for AI Agents
21+
22+
Install the latest stable Apache IoTDB all-in-one binary as a local single-node
23+
instance (one ConfigNode and one DataNode).
24+
25+
## 1. Prepare
26+
27+
- Use Linux, macOS, or Windows with WSL2, using Bash.
28+
- Require **JDK 17 or later**. Set `JAVA_HOME` and put `$JAVA_HOME/bin` on `PATH`.
29+
- Require `curl`, `jq`, `unzip`, `awk`, and either `sha512sum` or `shasum`.
30+
- Allow at least 4 GiB RAM and 1 GiB free disk. Use a path without spaces or
31+
non-ASCII characters and the same OS user for every IoTDB command.
32+
- Keep the default single-node ports available: `6667`, `10710`, `10720`,
33+
`10730`, `10740`, `10750`, and `10760`.
34+
35+
## 2. Download and Verify
36+
37+
Run the following blocks in one Bash session. The release number is resolved
38+
from Apache's release inventory, excluding release candidates and snapshots.
39+
If discovery fails, select the latest All-in-one release on the official
40+
[download page](https://iotdb.apache.org/Download/) and set `VERSION` manually.
41+
42+
```bash
43+
set -euo pipefail
44+
for command in java javac curl jq unzip awk grep sed sleep; do
45+
command -v "$command" >/dev/null 2>&1 || {
46+
echo "Missing required command: $command" >&2
47+
exit 1
48+
}
49+
done
50+
if ! command -v sha512sum >/dev/null 2>&1 && ! command -v shasum >/dev/null 2>&1; then
51+
echo "Missing required command: sha512sum or shasum" >&2
52+
exit 1
53+
fi
54+
java -version
55+
javac -version
56+
JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2; exit}')
57+
JAVA_MAJOR=${JAVA_VERSION%%.*}
58+
if [ "$JAVA_MAJOR" = "1" ]; then
59+
JAVA_MAJOR=${JAVA_VERSION#1.}
60+
JAVA_MAJOR=${JAVA_MAJOR%%.*}
61+
fi
62+
case "$JAVA_MAJOR" in
63+
''|*[!0-9]*) echo "Cannot determine the JDK major version" >&2; exit 1 ;;
64+
esac
65+
if [ "$JAVA_MAJOR" -lt 17 ]; then
66+
echo "JDK 17 or later is required (found $JAVA_VERSION)" >&2
67+
exit 1
68+
fi
69+
mkdir -p "$HOME/iotdb"
70+
cd "$HOME/iotdb"
71+
if [ -z "${VERSION:-}" ]; then
72+
VERSION=$(curl -fsSL --retry 3 https://projects.apache.org/json/foundation/releases.json |
73+
jq -er '.iotdb | keys |
74+
map(select(test("^apache-iotdb-[0-9]+\\.[0-9]+\\.[0-9]+$")) |
75+
ltrimstr("apache-iotdb-")) |
76+
max_by(split(".") | map(tonumber)) // error("No stable IoTDB release found")') || {
77+
echo "Could not discover the latest release. Set VERSION manually and rerun this block." >&2
78+
exit 1
79+
}
80+
fi
81+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
82+
echo "VERSION must be in the form major.minor.patch" >&2
83+
exit 1
84+
fi
85+
PACKAGE="apache-iotdb-${VERSION}-all-bin.zip"
86+
curl -fL --retry 3 -o "$PACKAGE" \
87+
"https://www.apache.org/dyn/closer.lua/iotdb/${VERSION}/${PACKAGE}?action=download"
88+
curl -fsSL --retry 3 -o "$PACKAGE.sha512" \
89+
"https://downloads.apache.org/iotdb/${VERSION}/${PACKAGE}.sha512"
90+
91+
EXPECTED=$(awk '{print $1; exit}' "$PACKAGE.sha512")
92+
if command -v sha512sum >/dev/null 2>&1; then
93+
ACTUAL=$(sha512sum "$PACKAGE" | awk '{print $1}')
94+
else
95+
ACTUAL=$(shasum -a 512 "$PACKAGE" | awk '{print $1}')
96+
fi
97+
test "$ACTUAL" = "$EXPECTED" || { echo "SHA-512 mismatch" >&2; exit 1; }
98+
unzip -q -o "$PACKAGE"
99+
cd "apache-iotdb-${VERSION}-all-bin"
100+
export IOTDB_HOME="$PWD"
101+
```
102+
103+
## 3. Start
104+
105+
Set explicit memory budgets for this small local instance. Keep the default
106+
loopback addresses and use the same OS user to start and stop IoTDB.
107+
108+
```bash
109+
sed 's/^MEMORY_SIZE=.*/MEMORY_SIZE=512M/' conf/confignode-env.sh > conf/confignode-env.sh.tmp
110+
mv conf/confignode-env.sh.tmp conf/confignode-env.sh
111+
sed 's/^MEMORY_SIZE=.*/MEMORY_SIZE=1G/' conf/datanode-env.sh > conf/datanode-env.sh.tmp
112+
mv conf/datanode-env.sh.tmp conf/datanode-env.sh
113+
ulimit -n 65535 || true
114+
bash sbin/start-standalone.sh
115+
```
116+
117+
The start script launches both nodes in the background. Poll until one ConfigNode
118+
and one DataNode report `Running`; if startup fails, inspect the two node logs.
119+
120+
```bash
121+
attempt=1
122+
while [ "$attempt" -le 60 ]; do
123+
if cluster=$(bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root \
124+
-sql_dialect table -e "SHOW CLUSTER" 2>&1) &&
125+
grep -q 'ConfigNode.*Running' <<<"$cluster" &&
126+
grep -q 'DataNode.*Running' <<<"$cluster"; then
127+
printf '%s\n' "$cluster"
128+
break
129+
fi
130+
if [ "$attempt" -eq 60 ]; then
131+
printf '%s\n' "$cluster" >&2
132+
echo "IoTDB did not become ready within 120 seconds" >&2
133+
exit 1
134+
fi
135+
sleep 2
136+
attempt=$((attempt + 1))
137+
done
138+
```
139+
140+
## 4. Verify a Write and Query
141+
142+
```bash
143+
bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root \
144+
-sql_dialect table -e "CREATE DATABASE IF NOT EXISTS agent_install_check;
145+
USE agent_install_check;
146+
CREATE TABLE IF NOT EXISTS readings (device_id STRING TAG, value DOUBLE FIELD);
147+
INSERT INTO readings(time, device_id, value) VALUES (1, 'probe', 42.0);
148+
SELECT device_id, value FROM readings;"
149+
```
150+
151+
Success requires a returned row containing `probe` and `42.0`, with no SQL errors.
152+
The endpoint is `127.0.0.1:6667`; initial credentials are `root` / `root`.
153+
Change the password before enabling remote access.
154+
155+
To stop it later, run from the installation directory:
156+
157+
```bash
158+
bash sbin/stop-standalone.sh
159+
```
160+
161+
For production sizing and cluster deployment, see the
162+
[deployment guide](https://iotdb.apache.org/UserGuide/latest/Deployment-and-Maintenance/Cluster-Deployment_apache.html).

src/UserGuide/latest-Table/QuickStart/QuickStart_apache.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ This document will guide you through methods to get started quickly with IoTDB.
2727

2828
This guide will assist you in quickly installing and deploying IoTDB. You can quickly navigate to the content you need to review through the following document links:
2929

30+
Copy the prompt below to your AI assistant (Claude Code, Codex, DSH, Qoder, etc.), and it will automatically complete the installation for you.
31+
32+
Prompt:
33+
34+
```text
35+
Help me install Apache IoTDB: https://iotdb.apache.org/guide.md
36+
```
37+
3038
1. Prepare the necessary machine resources: The deployment and operation of IoTDB require consideration of various aspects of machine resource configuration. For specific resource configurations, please refer to [Database Resource](../Deployment-and-Maintenance/Database-Resources_apache.md)
3139

3240
2. Complete system configuration preparations: IoTDB's system configuration involves multiple aspects. For an introduction to key system configurations, please see [System Requirements](../Deployment-and-Maintenance/Environment-Requirements.md)

src/UserGuide/latest/QuickStart/QuickStart_apache.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ This document will guide you through methods to get started quickly with IoTDB.
2828

2929
This guide will assist you in quickly installing and deploying IoTDB. You can quickly navigate to the content you need to review through the following document links:
3030

31+
Copy the prompt below to your AI assistant (Claude Code, Codex, DSH, Qoder, etc.), and it will automatically complete the installation for you.
32+
33+
Prompt:
34+
35+
```text
36+
Help me install Apache IoTDB: https://iotdb.apache.org/guide.md
37+
```
38+
3139
1. Prepare the necessary machine resources: The deployment and operation of IoTDB require consideration of various aspects of machine resource configuration. For specific resource configurations, please refer to [Database Resource](../Deployment-and-Maintenance/Database-Resources.md)
3240

3341
2. Complete system configuration preparations: IoTDB's system configuration involves multiple aspects. For an introduction to key system configurations, please see [System Requirements](../Deployment-and-Maintenance/Environment-Requirements.md)

src/zh/UserGuide/latest-Table/QuickStart/QuickStart_apache.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727

2828
本篇文档将帮助您快速安装部署 IoTDB,您可以通过以下文档的链接快速定位到所需要查看的内容:
2929

30+
将下方提示词复制给你的 AI 助手(Claude Code、Codex、DSH、Qoder 等),它会自动完成安装。
31+
32+
提示词:
33+
34+
```text
35+
帮我安装 Apache IoTDB: https://iotdb.apache.org/guide.md
36+
```
37+
3038
1. 准备所需机器资源:IoTDB 的部署和运行需要考虑多个方面的机器资源配置。具体资源配置可查看 [资源规划](../Deployment-and-Maintenance/Database-Resources_apache.md)
3139

3240
2. 完成系统配置准备:IoTDB 的系统配置涉及多个方面,关键的系统配置介绍可查看 [系统配置](../Deployment-and-Maintenance/Environment-Requirements.md)

src/zh/UserGuide/latest/QuickStart/QuickStart_apache.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727

2828
本篇文档将帮助您快速安装部署 IoTDB,您可以通过以下文档的链接快速定位到所需要查看的内容:
2929

30+
将下方提示词复制给你的 AI 助手(Claude Code、Codex、DSH、Qoder 等),它会自动完成安装。
31+
32+
提示词:
33+
34+
```text
35+
帮我安装 Apache IoTDB: https://iotdb.apache.org/guide.md
36+
```
37+
3038
1. 准备所需机器资源:IoTDB 的部署和运行需要考虑多个方面的机器资源配置。具体资源配置可查看 [资源规划](../Deployment-and-Maintenance/Database-Resources_apache.md)
3139

3240
2. 完成系统配置准备:IoTDB 的系统配置涉及多个方面,关键的系统配置介绍可查看 [系统配置](../Deployment-and-Maintenance/Environment-Requirements.md)

0 commit comments

Comments
 (0)