Skip to content

Commit 8a0aec7

Browse files
authored
update ainode deployment (#832)
1 parent fbe78e3 commit 8a0aec7

File tree

16 files changed

+1062
-1090
lines changed

16 files changed

+1062
-1090
lines changed

src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md

Lines changed: 45 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
### 1.1 Capability Introduction
2626

27-
AINode is the third type of endogenous node provided by IoTDB after the Configurable Node and DataNode. This node extends its ability to perform machine learning analysis on time series by interacting with the DataNode and Configurable Node of the IoTDB cluster. It supports the introduction of existing machine learning models from external sources for registration and the use of registered models to complete time series analysis tasks on specified time series data through simple SQL statements. The creation, management, and inference of models are integrated into the database engine. Currently, machine learning algorithms or self-developed models are available for common time series analysis scenarios, such as prediction and anomaly detection.
27+
AINode is the third type of endogenous node provided by IoTDB after the Configurable Node and DataNode. This node extends its ability to perform machine learning analysis on time series by interacting with the DataNode and Configurable Node of the IoTDB cluster. It supports the introduction of existing machine learning models from external sources for registration and the use of registered models to complete time series analysis tasks on specified time series data through simple SQL statements. The creation, management, and inference of models are integrated into the database engine. Currently, machine learning algorithms or self-developed models are available for common time series analysis scenarios, such as prediction and anomaly detection.
2828

2929
### 1.2 Delivery Method
30-
It is an additional package outside the IoTDB cluster, with independent installation.
30+
AINode is an additional package outside the IoTDB cluster, with independent installation.
3131

3232
### 1.3 Deployment mode
3333
<div >
@@ -39,62 +39,47 @@
3939

4040
### 2.1 Get installation package
4141

42-
Unzip and install the package
43-
`(apache-iotdb-<version>-ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows:
44-
| **Catalogue** | **Type** | **Explain** |
45-
| ------------ | -------- | ------------------------------------------------ |
46-
| lib | folder | AINode compiled binary executable files and related code dependencies |
47-
| sbin | folder | The running script of AINode can start, remove, and stop AINode |
48-
| conf | folder | Contains configuration items for AINode, specifically including the following configuration items |
49-
| LICENSE | file | Certificate |
50-
| NOTICE | file | Tips |
51-
| README_ZH.md | file | Explanation of the Chinese version of the markdown format |
52-
| `README.md` | file | Instructions |
42+
Unzip and install the package
43+
`(apache-iotdb-<version>-ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows:
44+
45+
| **Catalogue** | **Type** | **Explain** |
46+
| ------------ | -------- |-----------------------------------------------------------------------|
47+
| lib | folder | Python package files for AINode |
48+
| sbin | folder | The running script of AINode can start, remove, and stop AINode |
49+
| conf | folder | Configuration files for AINode, and runtime environment setup scripts |
50+
| LICENSE | file | Certificate |
51+
| NOTICE | file | Tips |
52+
| README_ZH.md | file | Explanation of the Chinese version of the markdown format |
53+
| README.md | file | Instructions |
5354

5455
### 2.2 Environmental Preparation
5556

56-
1. Recommended operating systems: Ubuntu, CentOS, MacOS
57+
1. Recommended operating systems: Ubuntu, MacOS
5758
2. IoTDB version: >= V 2.0.5.1
5859
3. Runtime environment
59-
- Python version between 3.9 and 3.12, with pip and venv tools installed;
60+
- Python version between 3.9 and 3.12, with pip and venv tools installed;
6061

6162
## 3. Installation steps
6263

6364
### 3.1 Install AINode
6465

6566

66-
1. Ensure Python version is between 3.9 and 3.12:
67+
1. Ensure Python version is between 3.9 and 3.12:
6768
```shell
68-
python --version
69+
python --version
6970
# or
7071
python3 --version
7172
```
7273

73-
2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package:
74+
2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package:
7475
```shell
75-
unzip timechodb-2.0.5.1-ainode-bin.zip
76-
```
77-
3. Create a virtual environment (execute in the ainode directory):
78-
79-
```shell
80-
python3 -m venv venv
81-
```
82-
83-
4. Activate the virtual environment:
84-
85-
```shell
86-
source venv/bin/activate
87-
```
88-
5. Update pip and install AINode dependencies:
89-
```shell
90-
python -m pip install --upgrade pip
91-
poetry lock
92-
poetry install
93-
```
76+
unzip apache-iotdb-<version>-ainode-bin.zip
77+
```
9478

9579
### 3.2 Configuration item modification
9680

9781
AINode supports modifying some necessary parameters. You can find the following parameters in the `conf/iotdb-ainode.properties` file and make persistent modifications to them:
82+
9883
| **Name** | **Description** | **Type** | **Default Value** |
9984
| ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ |
10085
| cluster_name | Identifier of the cluster AINode joins | string | defaultCluster |
@@ -110,13 +95,19 @@ AINode supports modifying some necessary parameters. You can find the following
11095
| ain_models_dir | Path to store model files for AINode (relative path starts from OS-dependent directory; absolute path is recommended) | String | data/AINode/models |
11196
| ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 |
11297

113-
### 3.3 Start AINode
98+
### 3.3 Importing Weight Files
99+
100+
> Offline environment only (Online environments can skip this step)
101+
>
102+
Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory.
103+
104+
### 3.4 Start AINode
114105

115-
After completing the deployment of Seed Config Node, the registration and inference functions of the model can be supported by adding AINode nodes. After specifying the information of the IoTDB cluster in the configuration file, the corresponding instruction can be executed to start AINode and join the IoTDB cluster。
106+
After completing the deployment of Seed Config Node, the registration and inference functions of the model can be supported by adding AINode nodes. After specifying the information of the IoTDB cluster in the configuration file, the corresponding instruction can be executed to start AINode and join the IoTDB cluster。
116107

117-
#### Networking environment startup
108+
- Networking environment startup
118109

119-
##### Start command
110+
Start command
120111

121112
```shell
122113
# Start command
@@ -134,25 +125,7 @@ AINode supports modifying some necessary parameters. You can find the following
134125
nohup bash sbin\start-ainode.bat > myout.file 2>& 1 &
135126
```
136127

137-
138-
#### Example
139-
140-
```shell
141-
# Start command
142-
# Linux and MacOS systems
143-
bash sbin/start-ainode.sh
144-
# Windows systems
145-
sbin\start-ainode.bat
146-
147-
148-
# Backend startup command (recommended for long-term running)
149-
# Linux and MacOS systems
150-
nohup bash sbin/start-ainode.sh > myout.file 2>& 1 &
151-
# Windows systems
152-
nohup bash sbin\start-ainode.bat > myout.file 2>& 1 &
153-
```
154-
155-
### 3.4 Detecting the status of AINode nodes
128+
### 3.5 Detecting the status of AINode nodes
156129

157130
During the startup process of AINode, the new AINode will be automatically added to the IoTDB cluster. After starting AINode, you can enter SQL in the command line to query. If you see an AINode node in the cluster and its running status is Running (as shown below), it indicates successful joining.
158131

@@ -168,11 +141,11 @@ IoTDB> show cluster
168141
+------+----------+-------+---------------+------------+-------+-----------+
169142
```
170143

171-
### 3.5 Stop AINode
144+
### 3.6 Stop AINode
172145

173146
If you need to stop a running AINode node, execute the corresponding shutdown script.
174147

175-
#### Stop command
148+
Stop command
176149

177150
```shell
178151
# Linux / MacOS
@@ -182,15 +155,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc
182155
sbin\stop-ainode.bat
183156
```
184157

185-
#### Example
186-
187-
```shell
188-
# Linux / MacOS
189-
bash sbin/stop-ainode.sh
190-
191-
# Windows
192-
sbin\stop-ainode.bat
193-
```
194158
After stopping AINode, you can still see AINode nodes in the cluster, whose running status is UNKNOWN (as shown below), and the AINode function cannot be used at this time.
195159

196160
```shell
@@ -209,9 +173,9 @@ If you need to restart the node, you need to execute the startup script again.
209173

210174
### 4.1 An error occurs when starting AINode stating that the venv module cannot be found
211175

212-
When starting AINode using the default method, a Python virtual environment will be created in the installation package directory and dependencies will be installed, so it is required to install the venv module. Generally speaking, Python 3.10 and above versions come with built-in VenV, but for some systems with built-in Python environments, this requirement may not be met. There are two solutions when this error occurs (choose one or the other):
176+
When starting AINode using the default method, a Python virtual environment will be created in the installation package directory and dependencies will be installed, so it is required to install the venv module. Generally speaking, Python 3.10 and above versions come with built-in VenV, but for some systems with built-in Python environments, this requirement may not be met. There are two solutions when this error occurs (choose one or the other):
213177

214-
To install the Venv module locally, taking Ubuntu as an example, you can run the following command to install the built-in Venv module in Python. Or install a Python version with built-in Venv from the Python official website.
178+
To install the Venv module locally, taking Ubuntu as an example, you can run the following command to install the built-in Venv module in Python. Or install a Python version with built-in Venv from the Python official website.
215179

216180
```shell
217181
apt-get install python3.10-venv
@@ -221,14 +185,14 @@ Install version 3.10.0 of venv into AINode in the AINode path.
221185
```shell
222186
../Python-3.10.0/python -m venv venv(Folder Name)
223187
```
224-
When running the startup script, use ` -i ` to specify an existing Python interpreter path as the running environment for AINode, eliminating the need to create a new virtual environment.
188+
When running the startup script, use ` -i ` to specify an existing Python interpreter path as the running environment for AINode, eliminating the need to create a new virtual environment.
225189
226-
### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources
190+
### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources
227191
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
228192
You can install OpenSSLS and then rebuild Python to solve this problem
229193
> Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1.
230194
231-
Python requires OpenSSL to be installed on our system, the specific installation method can be found in [link](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos)
195+
Python requires OpenSSL to be installed on our system, the specific installation method can be found in [link](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos)
232196
233197
```shell
234198
sudo apt-get install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev uuid-dev lzma-dev liblzma-dev
@@ -237,9 +201,9 @@ make
237201
sudo make install
238202
```
239203
240-
### 4.3 Pip version is lower
204+
### 4.3 Pip version is lower
241205
242-
A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows
206+
A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows
243207
244208
The corresponding error occurs during installation and compilation, usually due to insufficient C++version or Setup tools version. You can check it in
245209
@@ -249,14 +213,14 @@ The corresponding error occurs during installation and compilation, usually due
249213
```
250214
251215
252-
### 4.4 Install and compile Python
216+
### 4.4 Install and compile Python
253217
254-
Use the following instructions to download the installation package from the official website and extract it:
218+
Use the following instructions to download the installation package from the official website and extract it:
255219
```shell
256220
.wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
257221
tar Jxf Python-3.10.0.tar.xz
258222
```
259-
Compile and install the corresponding Python package:
223+
Compile and install the corresponding Python package:
260224
```shell
261225
cd Python-3.10.0
262226
./configure prefix=/usr/local/python3

0 commit comments

Comments
 (0)