diff --git a/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md index 50c532376..0e6610163 100644 --- a/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -24,10 +24,10 @@ ### 1.1 Capability Introduction - 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. +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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. +AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -39,62 +39,47 @@ ### 2.1 Get installation package - Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | +Unzip and install the package +`(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ------------ | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - - Python version between 3.9 and 3.12, with pip and venv tools installed; + - Python version between 3.9 and 3.12, with pip and venv tools installed; ## 3. Installation steps ### 3.1 Install AINode - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip - ``` -3. Create a virtual environment (execute in the ainode directory): - - ```shell - python3 -m venv venv - ``` - -4. Activate the virtual environment: - - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` + unzip apache-iotdb--ainode-bin.zip +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | 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 | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + +### 3.4 Start AINode - 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。 +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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +125,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +141,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +155,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell @@ -209,9 +173,9 @@ If you need to restart the node, you need to execute the startup script again. ### 4.1 An error occurs when starting AINode stating that the venv module cannot be found - 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): +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): - 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. +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. ```shell apt-get install python3.10-venv @@ -221,14 +185,14 @@ Install version 3.10.0 of venv into AINode in the AINode path. ```shell ../Python-3.10.0/python -m venv venv(Folder Name) ``` - 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. +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. - ### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources +### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. You can install OpenSSLS and then rebuild Python to solve this problem > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - 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) +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) ```shell 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 sudo make install ``` - ### 4.3 Pip version is lower +### 4.3 Pip version is lower - A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows +A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows The corresponding error occurs during installation and compilation, usually due to insufficient C++version or Setup tools version. You can check it in @@ -249,14 +213,14 @@ The corresponding error occurs during installation and compilation, usually due ``` - ### 4.4 Install and compile Python +### 4.4 Install and compile Python - Use the following instructions to download the installation package from the official website and extract it: +Use the following instructions to download the installation package from the official website and extract it: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - Compile and install the corresponding Python package: +Compile and install the corresponding Python package: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 50c532376..e17233214 100644 --- a/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -24,10 +24,10 @@ ### 1.1 Capability Introduction - 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. +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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. +AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -39,62 +39,106 @@ ### 2.1 Get installation package - Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | +Unzip and install the package +`(timechodb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ----------- | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - - Python version between 3.9 and 3.12, with pip and venv tools installed; + - Python version between 3.9 and 3.12, with pip and venv tools installed; ## 3. Installation steps ### 3.1 Install AINode - - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. Create a virtual environment (execute in the ainode directory): +3. Activate AINode: - ```shell - python3 -m venv venv - ``` +- Enter the IoTDB CLI -4. Activate the virtual environment: +```sql +# For Linux or macOS +./start-cli.sh -sql_dialect table - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` +# For Windows +./start-cli.bat -sql_dialect table +``` + +- Run the following command to retrieve the machine code required for activation: + +```sql +show system info +``` + +- Copy the returned machine code and send it to the Timecho team: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- Enter the activation code provided by the Timecho team in the CLI using the following format. Wrap the activation code in single quotes ('): + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- You can verify the activation using the following method: when the status shows ACTIVATED, it indicates successful activation. + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | cluster_name | Identifier of the cluster AINode joins | string | defaultCluster | @@ -110,13 +154,20 @@ AINode supports modifying some necessary parameters. You can find the following | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. - 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。 -#### Networking environment startup +### 3.4 Start AINode -##### Start command +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。 + +- Networking environment startup + +Start command ```shell # Start command @@ -134,25 +185,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +201,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +215,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell @@ -209,9 +233,9 @@ If you need to restart the node, you need to execute the startup script again. ### 4.1 An error occurs when starting AINode stating that the venv module cannot be found - 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): +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): - 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. +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. ```shell apt-get install python3.10-venv @@ -221,14 +245,14 @@ Install version 3.10.0 of venv into AINode in the AINode path. ```shell ../Python-3.10.0/python -m venv venv(Folder Name) ``` - 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. +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. - ### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources +### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. You can install OpenSSLS and then rebuild Python to solve this problem > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - 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) +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) ```shell 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 +261,9 @@ make sudo make install ``` - ### 4.3 Pip version is lower +### 4.3 Pip version is lower - A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows +A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows The corresponding error occurs during installation and compilation, usually due to insufficient C++version or Setup tools version. You can check it in @@ -249,14 +273,14 @@ The corresponding error occurs during installation and compilation, usually due ``` - ### 4.4 Install and compile Python +### 4.4 Install and compile Python - Use the following instructions to download the installation package from the official website and extract it: +Use the following instructions to download the installation package from the official website and extract it: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - Compile and install the corresponding Python package: +Compile and install the corresponding Python package: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md index 50c532376..b83ca8a12 100644 --- a/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ 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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. + AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -41,19 +41,20 @@ Unzip and install the package `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | + +| **Catalogue** | **Type** | **Explain** | +| ------------ | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - Python version between 3.9 and 3.12, with pip and venv tools installed; @@ -65,36 +66,20 @@ 1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip - ``` -3. Create a virtual environment (execute in the ainode directory): - - ```shell - python3 -m venv venv - ``` - -4. Activate the virtual environment: - - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` + unzip apache-iotdb--ainode-bin.zip +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | 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 | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> + Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + +### 3.4 Start AINode 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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +125,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +141,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +155,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell diff --git a/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 50c532376..47b3bdf33 100644 --- a/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ 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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. + AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -40,20 +40,21 @@ ### 2.1 Get installation package Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | + `(timechodb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ----------- | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - Python version between 3.9 and 3.12, with pip and venv tools installed; @@ -62,39 +63,82 @@ ### 3.1 Install AINode - - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. Create a virtual environment (execute in the ainode directory): +3. Activate AINode: - ```shell - python3 -m venv venv - ``` +- Enter the IoTDB CLI -4. Activate the virtual environment: +```sql +# For Linux or macOS +./start-cli.sh - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` +# For Windows +./start-cli.bat +``` + +- Run the following command to retrieve the machine code required for activation: + +```sql +show system info +``` + +- Copy the returned machine code and send it to the Timecho team: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- Enter the activation code provided by the Timecho team in the CLI using the following format. Wrap the activation code in single quotes ('): + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- You can verify the activation using the following method: when the status shows ACTIVATED, it indicates successful activation. + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | cluster_name | Identifier of the cluster AINode joins | string | defaultCluster | @@ -110,13 +154,20 @@ AINode supports modifying some necessary parameters. You can find the following | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + + +### 3.4 Start AINode 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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +185,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +201,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command + Stop command ```shell # Linux / MacOS @@ -182,15 +215,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell diff --git a/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md index 50c532376..0e6610163 100644 --- a/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -24,10 +24,10 @@ ### 1.1 Capability Introduction - 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. +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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. +AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -39,62 +39,47 @@ ### 2.1 Get installation package - Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | +Unzip and install the package +`(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ------------ | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - - Python version between 3.9 and 3.12, with pip and venv tools installed; + - Python version between 3.9 and 3.12, with pip and venv tools installed; ## 3. Installation steps ### 3.1 Install AINode - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip - ``` -3. Create a virtual environment (execute in the ainode directory): - - ```shell - python3 -m venv venv - ``` - -4. Activate the virtual environment: - - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` + unzip apache-iotdb--ainode-bin.zip +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | 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 | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + +### 3.4 Start AINode - 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。 +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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +125,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +141,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +155,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell @@ -209,9 +173,9 @@ If you need to restart the node, you need to execute the startup script again. ### 4.1 An error occurs when starting AINode stating that the venv module cannot be found - 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): +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): - 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. +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. ```shell apt-get install python3.10-venv @@ -221,14 +185,14 @@ Install version 3.10.0 of venv into AINode in the AINode path. ```shell ../Python-3.10.0/python -m venv venv(Folder Name) ``` - 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. +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. - ### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources +### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. You can install OpenSSLS and then rebuild Python to solve this problem > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - 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) +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) ```shell 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 sudo make install ``` - ### 4.3 Pip version is lower +### 4.3 Pip version is lower - A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows +A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows The corresponding error occurs during installation and compilation, usually due to insufficient C++version or Setup tools version. You can check it in @@ -249,14 +213,14 @@ The corresponding error occurs during installation and compilation, usually due ``` - ### 4.4 Install and compile Python +### 4.4 Install and compile Python - Use the following instructions to download the installation package from the official website and extract it: +Use the following instructions to download the installation package from the official website and extract it: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - Compile and install the corresponding Python package: +Compile and install the corresponding Python package: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 50c532376..e17233214 100644 --- a/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -24,10 +24,10 @@ ### 1.1 Capability Introduction - 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. +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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. +AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -39,62 +39,106 @@ ### 2.1 Get installation package - Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | +Unzip and install the package +`(timechodb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ----------- | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - - Python version between 3.9 and 3.12, with pip and venv tools installed; + - Python version between 3.9 and 3.12, with pip and venv tools installed; ## 3. Installation steps ### 3.1 Install AINode - - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. Create a virtual environment (execute in the ainode directory): +3. Activate AINode: - ```shell - python3 -m venv venv - ``` +- Enter the IoTDB CLI -4. Activate the virtual environment: +```sql +# For Linux or macOS +./start-cli.sh -sql_dialect table - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` +# For Windows +./start-cli.bat -sql_dialect table +``` + +- Run the following command to retrieve the machine code required for activation: + +```sql +show system info +``` + +- Copy the returned machine code and send it to the Timecho team: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- Enter the activation code provided by the Timecho team in the CLI using the following format. Wrap the activation code in single quotes ('): + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- You can verify the activation using the following method: when the status shows ACTIVATED, it indicates successful activation. + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | cluster_name | Identifier of the cluster AINode joins | string | defaultCluster | @@ -110,13 +154,20 @@ AINode supports modifying some necessary parameters. You can find the following | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. - 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。 -#### Networking environment startup +### 3.4 Start AINode -##### Start command +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。 + +- Networking environment startup + +Start command ```shell # Start command @@ -134,25 +185,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +201,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +215,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell @@ -209,9 +233,9 @@ If you need to restart the node, you need to execute the startup script again. ### 4.1 An error occurs when starting AINode stating that the venv module cannot be found - 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): +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): - 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. +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. ```shell apt-get install python3.10-venv @@ -221,14 +245,14 @@ Install version 3.10.0 of venv into AINode in the AINode path. ```shell ../Python-3.10.0/python -m venv venv(Folder Name) ``` - 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. +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. - ### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources +### 4.2 The SSL module in Python is not properly installed and configured to handle HTTPS resources WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. You can install OpenSSLS and then rebuild Python to solve this problem > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - 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) +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) ```shell 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 +261,9 @@ make sudo make install ``` - ### 4.3 Pip version is lower +### 4.3 Pip version is lower - A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows +A compilation issue similar to "error: Microsoft Visual C++14.0 or greater is required..." appears on Windows The corresponding error occurs during installation and compilation, usually due to insufficient C++version or Setup tools version. You can check it in @@ -249,14 +273,14 @@ The corresponding error occurs during installation and compilation, usually due ``` - ### 4.4 Install and compile Python +### 4.4 Install and compile Python - Use the following instructions to download the installation package from the official website and extract it: +Use the following instructions to download the installation package from the official website and extract it: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - Compile and install the corresponding Python package: +Compile and install the corresponding Python package: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md index 50c532376..b83ca8a12 100644 --- a/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ 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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. + AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -41,19 +41,20 @@ Unzip and install the package `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | + +| **Catalogue** | **Type** | **Explain** | +| ------------ | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - Python version between 3.9 and 3.12, with pip and venv tools installed; @@ -65,36 +66,20 @@ 1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip - ``` -3. Create a virtual environment (execute in the ainode directory): - - ```shell - python3 -m venv venv - ``` - -4. Activate the virtual environment: - - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` + unzip apache-iotdb--ainode-bin.zip +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | 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 | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> + Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + +### 3.4 Start AINode 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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +125,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +141,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command +Stop command ```shell # Linux / MacOS @@ -182,15 +155,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell diff --git a/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 50c532376..47b3bdf33 100644 --- a/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ 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. ### 1.2 Delivery Method - It is an additional package outside the IoTDB cluster, with independent installation. + AINode is an additional package outside the IoTDB cluster, with independent installation. ### 1.3 Deployment mode
@@ -40,20 +40,21 @@ ### 2.1 Get installation package Unzip and install the package - `(apache-iotdb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: -| **Catalogue** | **Type** | **Explain** | -| ------------ | -------- | ------------------------------------------------ | -| lib | folder | AINode compiled binary executable files and related code dependencies | -| sbin | folder | The running script of AINode can start, remove, and stop AINode | -| conf | folder | Contains configuration items for AINode, specifically including the following configuration items | -| LICENSE | file | Certificate | -| NOTICE | file | Tips | -| README_ZH.md | file | Explanation of the Chinese version of the markdown format | -| `README.md` | file | Instructions | + `(timechodb--ainode-bin.zip)`, The directory structure after unpacking the installation package is as follows: + +| **Catalogue** | **Type** | **Explain** | +| ----------- | -------- |-----------------------------------------------------------------------| +| lib | folder | Python package files for AINode | +| sbin | folder | The running script of AINode can start, remove, and stop AINode | +| conf | folder | Configuration files for AINode, and runtime environment setup scripts | +| LICENSE | file | Certificate | +| NOTICE | file | Tips | +| README_ZH.md | file | Explanation of the Chinese version of the markdown format | +| README.md | file | Instructions | ### 2.2 Environmental Preparation -1. Recommended operating systems: Ubuntu, CentOS, MacOS +1. Recommended operating systems: Ubuntu, MacOS 2. IoTDB version: >= V 2.0.5.1 3. Runtime environment - Python version between 3.9 and 3.12, with pip and venv tools installed; @@ -62,39 +63,82 @@ ### 3.1 Install AINode - - 1. Ensure Python version is between 3.9 and 3.12: +1. Ensure Python version is between 3.9 and 3.12: ```shell - python --version +python --version # or python3 --version ``` - 2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: +2. Download and import AINode into a dedicated folder, switch to the folder, and unzip the package: ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. Create a virtual environment (execute in the ainode directory): +3. Activate AINode: - ```shell - python3 -m venv venv - ``` +- Enter the IoTDB CLI -4. Activate the virtual environment: +```sql +# For Linux or macOS +./start-cli.sh - ```shell - source venv/bin/activate - ``` -5. Update pip and install AINode dependencies: - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` +# For Windows +./start-cli.bat +``` + +- Run the following command to retrieve the machine code required for activation: + +```sql +show system info +``` + +- Copy the returned machine code and send it to the Timecho team: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- Enter the activation code provided by the Timecho team in the CLI using the following format. Wrap the activation code in single quotes ('): + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- You can verify the activation using the following method: when the status shows ACTIVATED, it indicates successful activation. + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` ### 3.2 Configuration item modification 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: + | **Name** | **Description** | **Type** | **Default Value** | | ------------------------------ | ------------------------------------------------------------ | -------- | ------------------ | | cluster_name | Identifier of the cluster AINode joins | string | defaultCluster | @@ -110,13 +154,20 @@ AINode supports modifying some necessary parameters. You can find the following | 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 | | ain_thrift_compression_enabled | Whether to enable Thrift compression for AINode (0=disabled, 1=enabled) | Boolean | 0 | -### 3.3 Start AINode +### 3.3 Importing Weight Files + +> Offline environment only (Online environments can skip this step) +> +Contact Timecho team to obtain the model weight files, then place them in the /IOTDB_AINODE_HOME/data/ainode/models/weights/ directory. + + +### 3.4 Start AINode 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。 -#### Networking environment startup +- Networking environment startup -##### Start command +Start command ```shell # Start command @@ -134,25 +185,7 @@ AINode supports modifying some necessary parameters. You can find the following nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` - -#### Example - -```shell - # Start command - # Linux and MacOS systems - bash sbin/start-ainode.sh - # Windows systems - sbin\start-ainode.bat - - - # Backend startup command (recommended for long-term running) - # Linux and MacOS systems - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows systems - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 Detecting the status of AINode nodes +### 3.5 Detecting the status of AINode nodes 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. @@ -168,11 +201,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 Stop AINode +### 3.6 Stop AINode If you need to stop a running AINode node, execute the corresponding shutdown script. -#### Stop command + Stop command ```shell # Linux / MacOS @@ -182,15 +215,6 @@ If you need to stop a running AINode node, execute the corresponding shutdown sc sbin\stop-ainode.bat ``` -#### Example - -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 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. ```shell diff --git a/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md index 052c039c2..cbe5b64fa 100644 --- a/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -40,19 +40,20 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | ### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,34 +66,15 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip apache-iotdb--ainode-bin.zip ``` - -3. 创建虚拟环境(在 ainode 目录下执行): - - ```shell - python3 -m venv venv - ``` - -4. 激活虚拟环境: - - ```shell - source venv/bin/activate - ``` - -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +94,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +124,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +139,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 + 停止命令 ```shell # Linux / MacOS @@ -182,14 +153,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -204,8 +167,6 @@ IoTDB> show cluster ``` 如果需要重新启动该节点,需重新执行启动脚本。 - - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 diff --git a/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 052c039c2..f4f2be0a4 100644 --- a/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/zh/UserGuide/Master/Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -39,20 +39,21 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 -AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: +AINode 安装包(`timechodb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | ### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,78 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): +3. 激活 AINode: - ```shell - python3 -m venv venv - ``` +- 进入 IoTDB CLI -4. 激活虚拟环境: +```sql + # Linux或MACOS系统 + ./start-cli.sh -sql_dialect table + + # windows系统 + ./start-cli.bat -sql_dialect table +``` - ```shell - source venv/bin/activate - ``` +- 执行以下内容获取激活所需机器码: + +```sql +show system info +``` + +- 将返回的机器码复制给天谋工作人员: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- 将工作人员返回的激活码输入到CLI中,输入以下内容 + - 注:激活码前后需要用'符号进行标注,如所示 + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- 可通过如下方式验证激活,当看到状态显示为 ACTIVATED 表示激活成功 + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +156,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> + 联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +186,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +201,31 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +除此之外,还可以通过 show models 命令来查看模型状态。如果模型状态不对,请检查权重文件路径是否正确。 + +```sql +IoTDB:etth> show models ++---------------------+--------------------+--------+------+ +| ModelId| ModelType|Category| State| ++---------------------+--------------------+--------+------+ +| arima| Arima|BUILT-IN|ACTIVE| +| holtwinters| HoltWinters|BUILT-IN|ACTIVE| +|exponential_smoothing|ExponentialSmoothing|BUILT-IN|ACTIVE| +| naive_forecaster| NaiveForecaster|BUILT-IN|ACTIVE| +| stl_forecaster| StlForecaster|BUILT-IN|ACTIVE| +| gaussian_hmm| GaussianHmm|BUILT-IN|ACTIVE| +| gmm_hmm| GmmHmm|BUILT-IN|ACTIVE| +| stray| Stray|BUILT-IN|ACTIVE| +| sundial| Timer-Sundial|BUILT-IN|ACTIVE| +| timer_xl| Timer-XL|BUILT-IN|ACTIVE| ++---------------------+--------------------+--------+------+ +``` + +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +- 停止命令 ```shell # Linux / MacOS @@ -182,14 +235,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -205,7 +250,6 @@ IoTDB> show cluster 如果需要重新启动该节点,需重新执行启动脚本。 - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 diff --git a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md index 052c039c2..27d03f65e 100644 --- a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -40,21 +40,22 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | -### 2.2 环境准备 +### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 -3. 运行环境 +3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,16 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip apache-iotdb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): - - ```shell - python3 -m venv venv - ``` - -4. 激活虚拟环境: - - ```shell - source venv/bin/activate - ``` - -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +94,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 - 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 -#### 联网环境启动 +### 3.4 启动 AINode -##### 启动命令 +在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 + +- 联网环境启动 + +启动命令 ```shell # 启动命令 @@ -136,24 +124,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +139,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +停止命令 ```shell # Linux / MacOS @@ -182,14 +153,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -204,32 +167,30 @@ IoTDB> show cluster ``` 如果需要重新启动该节点,需重新执行启动脚本。 - - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 - 当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): +当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): - 在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 +在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 ```shell apt-get install python3.10-venv ``` - 安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 +安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 ```shell ../Python-3.10.0/python -m venv venv(文件夹名) ``` - 在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 +在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 - ### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 +### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 可以安装 OpenSSLS 后,再重新构建 python 来解决这个问题 > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) +Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) ```shell 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 @@ -238,11 +199,11 @@ make sudo make install ``` - ### 4.3 pip版本较低 +### 4.3 pip版本较低 - windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 +windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 - 出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 +出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 ```shell ./python -m pip install --upgrade pip @@ -250,14 +211,14 @@ sudo make install ``` - ### 4.4 安装编译python +### 4.4 安装编译python - 使用以下指定从官网下载安装包并解压: +使用以下指定从官网下载安装包并解压: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - 编译安装对应的 python 包: +编译安装对应的 python 包: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 052c039c2..f1d62434b 100644 --- a/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/zh/UserGuide/Master/Tree/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -39,22 +39,23 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 -AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: +AINode 安装包(`timechodb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | -### 2.2 环境准备 +### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 -3. 运行环境 +3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,78 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): +3. 激活 AINode: - ```shell - python3 -m venv venv - ``` +- 进入 IoTDB CLI -4. 激活虚拟环境: +```sql + # Linux或MACOS系统 + ./start-cli.sh + + # windows系统 + ./start-cli.bat +``` - ```shell - source venv/bin/activate - ``` +- 执行以下内容获取激活所需机器码: + +```sql +show system info +``` + +- 将返回的机器码复制给天谋工作人员: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- 将工作人员返回的激活码输入到CLI中,输入以下内容 + - 注:激活码前后需要用'符号进行标注,如所示 + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- 可通过如下方式验证激活,当看到状态显示为 ACTIVATED 表示激活成功 + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +156,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode - 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 +在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +186,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +201,31 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +除此之外,还可以通过 show models 命令来查看模型状态。如果模型状态不对,请检查权重文件路径是否正确。 + +```sql +IoTDB:etth> show models ++---------------------+--------------------+--------+------+ +| ModelId| ModelType|Category| State| ++---------------------+--------------------+--------+------+ +| arima| Arima|BUILT-IN|ACTIVE| +| holtwinters| HoltWinters|BUILT-IN|ACTIVE| +|exponential_smoothing|ExponentialSmoothing|BUILT-IN|ACTIVE| +| naive_forecaster| NaiveForecaster|BUILT-IN|ACTIVE| +| stl_forecaster| StlForecaster|BUILT-IN|ACTIVE| +| gaussian_hmm| GaussianHmm|BUILT-IN|ACTIVE| +| gmm_hmm| GmmHmm|BUILT-IN|ACTIVE| +| stray| Stray|BUILT-IN|ACTIVE| +| sundial| Timer-Sundial|BUILT-IN|ACTIVE| +| timer_xl| Timer-XL|BUILT-IN|ACTIVE| ++---------------------+--------------------+--------+------+ +``` + +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +- 停止命令 ```shell # Linux / MacOS @@ -182,14 +235,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -205,31 +250,30 @@ IoTDB> show cluster 如果需要重新启动该节点,需重新执行启动脚本。 - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 - 当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): +当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): - 在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 +在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 ```shell apt-get install python3.10-venv ``` - 安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 +安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 ```shell ../Python-3.10.0/python -m venv venv(文件夹名) ``` - 在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 +在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 - ### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 +### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 可以安装 OpenSSLS 后,再重新构建 python 来解决这个问题 > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) +Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) ```shell 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 @@ -238,11 +282,11 @@ make sudo make install ``` - ### 4.3 pip版本较低 +### 4.3 pip版本较低 - windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 +windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 - 出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 +出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 ```shell ./python -m pip install --upgrade pip @@ -250,14 +294,14 @@ sudo make install ``` - ### 4.4 安装编译python +### 4.4 安装编译python - 使用以下指定从官网下载安装包并解压: +使用以下指定从官网下载安装包并解压: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - 编译安装对应的 python 包: +编译安装对应的 python 包: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md index 052c039c2..cbe5b64fa 100644 --- a/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -40,19 +40,20 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | ### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,34 +66,15 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip apache-iotdb--ainode-bin.zip ``` - -3. 创建虚拟环境(在 ainode 目录下执行): - - ```shell - python3 -m venv venv - ``` - -4. 激活虚拟环境: - - ```shell - source venv/bin/activate - ``` - -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +94,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +124,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +139,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 + 停止命令 ```shell # Linux / MacOS @@ -182,14 +153,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -204,8 +167,6 @@ IoTDB> show cluster ``` 如果需要重新启动该节点,需重新执行启动脚本。 - - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 diff --git a/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 052c039c2..f4f2be0a4 100644 --- a/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/zh/UserGuide/latest-Table/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -39,20 +39,21 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 -AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: +AINode 安装包(`timechodb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | ### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,78 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): +3. 激活 AINode: - ```shell - python3 -m venv venv - ``` +- 进入 IoTDB CLI -4. 激活虚拟环境: +```sql + # Linux或MACOS系统 + ./start-cli.sh -sql_dialect table + + # windows系统 + ./start-cli.bat -sql_dialect table +``` - ```shell - source venv/bin/activate - ``` +- 执行以下内容获取激活所需机器码: + +```sql +show system info +``` + +- 将返回的机器码复制给天谋工作人员: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- 将工作人员返回的激活码输入到CLI中,输入以下内容 + - 注:激活码前后需要用'符号进行标注,如所示 + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- 可通过如下方式验证激活,当看到状态显示为 ACTIVATED 表示激活成功 + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +156,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> + 联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +186,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +201,31 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +除此之外,还可以通过 show models 命令来查看模型状态。如果模型状态不对,请检查权重文件路径是否正确。 + +```sql +IoTDB:etth> show models ++---------------------+--------------------+--------+------+ +| ModelId| ModelType|Category| State| ++---------------------+--------------------+--------+------+ +| arima| Arima|BUILT-IN|ACTIVE| +| holtwinters| HoltWinters|BUILT-IN|ACTIVE| +|exponential_smoothing|ExponentialSmoothing|BUILT-IN|ACTIVE| +| naive_forecaster| NaiveForecaster|BUILT-IN|ACTIVE| +| stl_forecaster| StlForecaster|BUILT-IN|ACTIVE| +| gaussian_hmm| GaussianHmm|BUILT-IN|ACTIVE| +| gmm_hmm| GmmHmm|BUILT-IN|ACTIVE| +| stray| Stray|BUILT-IN|ACTIVE| +| sundial| Timer-Sundial|BUILT-IN|ACTIVE| +| timer_xl| Timer-XL|BUILT-IN|ACTIVE| ++---------------------+--------------------+--------+------+ +``` + +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +- 停止命令 ```shell # Linux / MacOS @@ -182,14 +235,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -205,7 +250,6 @@ IoTDB> show cluster 如果需要重新启动该节点,需重新执行启动脚本。 - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 diff --git a/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md b/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md index 052c039c2..27d03f65e 100644 --- a/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md +++ b/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_apache.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -40,21 +40,22 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | -### 2.2 环境准备 +### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 -3. 运行环境 +3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,16 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip apache-iotdb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): - - ```shell - python3 -m venv venv - ``` - -4. 激活虚拟环境: - - ```shell - source venv/bin/activate - ``` - -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +94,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 - 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 -#### 联网环境启动 +### 3.4 启动 AINode -##### 启动命令 +在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 + +- 联网环境启动 + +启动命令 ```shell # 启动命令 @@ -136,24 +124,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +139,11 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +停止命令 ```shell # Linux / MacOS @@ -182,14 +153,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -204,32 +167,30 @@ IoTDB> show cluster ``` 如果需要重新启动该节点,需重新执行启动脚本。 - - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 - 当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): +当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): - 在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 +在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 ```shell apt-get install python3.10-venv ``` - 安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 +安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 ```shell ../Python-3.10.0/python -m venv venv(文件夹名) ``` - 在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 +在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 - ### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 +### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 可以安装 OpenSSLS 后,再重新构建 python 来解决这个问题 > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) +Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) ```shell 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 @@ -238,11 +199,11 @@ make sudo make install ``` - ### 4.3 pip版本较低 +### 4.3 pip版本较低 - windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 +windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 - 出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 +出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 ```shell ./python -m pip install --upgrade pip @@ -250,14 +211,14 @@ sudo make install ``` - ### 4.4 安装编译python +### 4.4 安装编译python - 使用以下指定从官网下载安装包并解压: +使用以下指定从官网下载安装包并解压: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - 编译安装对应的 python 包: +编译安装对应的 python 包: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3 diff --git a/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md b/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md index 052c039c2..f1d62434b 100644 --- a/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md +++ b/src/zh/UserGuide/latest/Deployment-and-Maintenance/AINode_Deployment_timecho.md @@ -27,7 +27,7 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点,该节点通过与 IoTDB 集群的 DataNode、ConfigNode 的交互,扩展了对时间序列进行机器学习分析的能力,支持从外部引入已有机器学习模型进行注册,并使用注册的模型在指定时序数据上通过简单 SQL 语句完成时序分析任务的过程,将模型的创建、管理及推理融合在数据库引擎中。目前已提供常见时序分析场景(例如预测与异常检测)的机器学习算法或自研模型。 ### 1.2 交付方式 - 是 IoTDB 集群外的额外套件,独立安装包。 +AINode 是 IoTDB 集群外的额外套件,独立安装包。 ### 1.3 部署模式
@@ -39,22 +39,23 @@ AINode 是 IoTDB 在 ConfigNode、DataNode 后提供的第三种内生节点, ### 2.1 安装包获取 -AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压后目录结构如下: +AINode 安装包(`timechodb--ainode-bin.zip`),安装包解压后目录结构如下: + | **目录** | **类型** | **说明** | | ------------ | -------- | ------------------------------------------------ | -| lib | 文件夹 | AINode编译后的二进制可执行文件以及相关的代码依赖 | +| lib | 文件夹 | AINode 的 python 包文件 | | sbin | 文件夹 | AINode的运行脚本,可以启动,移除和停止AINode | -| conf | 文件夹 | 包含AINode的配置项,具体包含以下配置项 | +| conf | 文件夹 | AINode 的配置文件和运行环境设置脚本 | | LICENSE | 文件 | 证书 | | NOTICE | 文件 | 提示 | | README_ZH.md | 文件 | markdown格式的中文版说明 | -| `README.md` | 文件 | 使用说明 | +| README.md | 文件 | 使用说明 | -### 2.2 环境准备 +### 2.2 环境准备 -1. 建议操作环境: Ubuntu, CentOS, MacOS +1. 建议操作环境: Ubuntu, MacOS 2. IoTDB 版本:>= V 2.0.5.1 -3. 运行环境 +3. 运行环境 - Python 版本在 3.9 ~3.12,且带有 pip 和 venv 工具; @@ -65,35 +66,78 @@ AINode 安装包(`apache-iotdb--ainode-bin.zip`),安装包解压 1. 保证 Python 版本介于 3.9 ~3.12 ```shell - python --version +python --version # 或 python3 --version ``` 2. 下载导入 AINode 到专用文件夹,切换到专用文件夹并解压安装包 ```shell - unzip timechodb-2.0.5.1-ainode-bin.zip + unzip timechodb--ainode-bin.zip ``` -3. 创建虚拟环境(在 ainode 目录下执行): +3. 激活 AINode: - ```shell - python3 -m venv venv - ``` +- 进入 IoTDB CLI -4. 激活虚拟环境: +```sql + # Linux或MACOS系统 + ./start-cli.sh + + # windows系统 + ./start-cli.bat +``` - ```shell - source venv/bin/activate - ``` +- 执行以下内容获取激活所需机器码: + +```sql +show system info +``` + +- 将返回的机器码复制给天谋工作人员: + +```sql ++--------------------------------------------------------------+ +| SystemInfo| ++--------------------------------------------------------------+ +| 01-TE5NLES4-UDDWCMYE| ++--------------------------------------------------------------+ +``` + +- 将工作人员返回的激活码输入到CLI中,输入以下内容 + - 注:激活码前后需要用'符号进行标注,如所示 + +```sql +IoTDB> activate '01-D4EYQGPZ-EAUJJODW-NUKRDR6F-TUQS3B75-EDZFLK3A-6BOKJFFZ-ALDHOMN7-NB2E4BHI-7ZK' +``` + +- 可通过如下方式验证激活,当看到状态显示为 ACTIVATED 表示激活成功 + +```sql +IoTDB> show cluster ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +|NodeID| NodeType| Status|InternalAddress|InternalPort| Version| BuildInfo|ActivateStatus| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ +| 0|ConfigNode|Running| 127.0.0.1| 10710| | xxxxxxx| ACTIVATED| +| 1| DataNode|Running| 127.0.0.1| 10730| | xxxxxxx| ACTIVATED| +| 2| AINode|Running| 127.0.0.1| 10810| | xxxxxxx| ACTIVATED| ++------+----------+-------+---------------+------------+--------------+-----------+--------------+ + +IoTDB> show activation ++---------------+---------+-----------------------------+ +| LicenseInfo| Usage| Limit| ++---------------+---------+-----------------------------+ +| Status|ACTIVATED| -| +| ExpiredTime| -|2025-07-16T00:00:00.000+08:00| +| DataNodeLimit| 1| Unlimited| +| AiNodeLimit| 1| 1| +| CpuLimit| 11| Unlimited| +| DeviceLimit| 0| Unlimited| +|TimeSeriesLimit| 0| 9,999| ++---------------+---------+-----------------------------+ + +``` -5. 更新 pip 并安装 AINode 依赖 - ```shell - python -m pip install --upgrade pip - poetry lock - poetry install - ``` - ### 3.2 配置项修改 AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properties` 文件中找到下列参数并进行持久化的修改: @@ -112,13 +156,19 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti | ain_models_dir | AINode 存储模型文件的路径,相对路径的起始目录与操作系统相关,建议使用绝对路径 | String | data/AINode/models | | ain_thrift_compression_enabled | AINode 是否启用 thrift 的压缩机制,0-不启动、1-启动 | Boolean | 0 | -### 3.3 启动 AINode +### 3.3 导入权重文件 + +> 仅离线环境,在线环境可忽略本步骤 +> +联系天谋工作人员获取模型权重文件,并放置到/IOTDB_AINODE_HOME/data/ainode/models/weights/目录下。 + +### 3.4 启动 AINode - 在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 +在完成 Seed-ConfigNode 的部署后,可以通过添加 AINode 节点来支持模型的注册和推理功能。在配置项中指定 IoTDB 集群的信息后,可以执行相应的指令来启动 AINode,加入 IoTDB 集群。 -#### 联网环境启动 +- 联网环境启动 -##### 启动命令 +启动命令 ```shell # 启动命令 @@ -136,24 +186,7 @@ AINode 支持修改一些必要的参数。可以在 `conf/iotdb-ainode.properti nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & ``` -#### 示例 - -```shell - # 启动命令 - # Linux 和 MacOS 系统 - bash sbin/start-ainode.sh - # Windows 系统 - sbin\start-ainode.bat - - - # 后台启动命令(长期运行推荐) - # Linux 和 MacOS 系统 - nohup bash sbin/start-ainode.sh > myout.file 2>& 1 & - # Windows 系统 - nohup bash sbin\start-ainode.bat > myout.file 2>& 1 & - ``` - -### 3.4 检测 AINode 节点状态 +### 3.5 检测 AINode 节点状态 AINode 启动过程中会自动将新的 AINode 加入 IoTDB 集群。启动 AINode 后可以在 命令行中输入 SQL 来查询,集群中看到 AINode 节点,其运行状态为 Running(如下展示)表示加入成功。 @@ -168,11 +201,31 @@ IoTDB> show cluster +------+----------+-------+---------------+------------+-------+-----------+ ``` -### 3.5 停止 AINode +除此之外,还可以通过 show models 命令来查看模型状态。如果模型状态不对,请检查权重文件路径是否正确。 + +```sql +IoTDB:etth> show models ++---------------------+--------------------+--------+------+ +| ModelId| ModelType|Category| State| ++---------------------+--------------------+--------+------+ +| arima| Arima|BUILT-IN|ACTIVE| +| holtwinters| HoltWinters|BUILT-IN|ACTIVE| +|exponential_smoothing|ExponentialSmoothing|BUILT-IN|ACTIVE| +| naive_forecaster| NaiveForecaster|BUILT-IN|ACTIVE| +| stl_forecaster| StlForecaster|BUILT-IN|ACTIVE| +| gaussian_hmm| GaussianHmm|BUILT-IN|ACTIVE| +| gmm_hmm| GmmHmm|BUILT-IN|ACTIVE| +| stray| Stray|BUILT-IN|ACTIVE| +| sundial| Timer-Sundial|BUILT-IN|ACTIVE| +| timer_xl| Timer-XL|BUILT-IN|ACTIVE| ++---------------------+--------------------+--------+------+ +``` + +### 3.6 停止 AINode 如果需要停止正在运行的 AINode 节点,则执行相应的关闭脚本。 -#### 停止命令 +- 停止命令 ```shell # Linux / MacOS @@ -182,14 +235,6 @@ IoTDB> show cluster sbin\stop-ainode.bat ``` -#### 示例 -```shell - # Linux / MacOS - bash sbin/stop-ainode.sh - - # Windows - sbin\stop-ainode.bat - ``` 停止 AINode 后,还可以在集群中看到 AINode 节点,其运行状态为 UNKNOWN(如下展示),此时无法使用 AINode 功能。 ```shell @@ -205,31 +250,30 @@ IoTDB> show cluster 如果需要重新启动该节点,需重新执行启动脚本。 - ## 4. 常见问题 ### 4.1 启动AINode时出现找不到venv模块的报错 - 当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): +当使用默认方式启动 AINode 时,会在安装包目录下创建一个 python 虚拟环境并安装依赖,因此要求安装 venv 模块。通常来说 python3.10 及以上的版本会自带 venv,但对于一些系统自带的 python 环境可能并不满足这一要求。出现该报错时有两种解决方案(二选一): - 在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 +在本地安装 venv 模块,以 ubuntu 为例,可以通过运行以下命令来安装 python 自带的 venv 模块。或者从 python 官网安装一个自带 venv 的 python 版本。 ```shell apt-get install python3.10-venv ``` - 安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 +安装 3.10.0 版本的 venv 到 AINode 里面 在 AINode 路径下 ```shell ../Python-3.10.0/python -m venv venv(文件夹名) ``` - 在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 +在运行启动脚本时通过 `-i` 指定已有的 python 解释器路径作为 AINode 的运行环境,这样就不再需要创建一个新的虚拟环境。 - ### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 +### 4.2 python中的SSL模块没有被正确安装和配置,无法处理HTTPS资源 WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 可以安装 OpenSSLS 后,再重新构建 python 来解决这个问题 > Currently Python versions 3.6 to 3.9 are compatible with OpenSSL 1.0.2, 1.1.0, and 1.1.1. - Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) +Python 要求我们的系统上安装有 OpenSSL,具体安装方法可见[链接](https://stackoverflow.com/questions/56552390/how-to-fix-ssl-module-in-python-is-not-available-in-centos) ```shell 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 @@ -238,11 +282,11 @@ make sudo make install ``` - ### 4.3 pip版本较低 +### 4.3 pip版本较低 - windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 +windows下出现类似“error:Microsoft Visual C++ 14.0 or greater is required...”的编译问题 - 出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 +出现对应的报错,通常是 c++版本或是 setuptools 版本不足,可以在 ```shell ./python -m pip install --upgrade pip @@ -250,14 +294,14 @@ sudo make install ``` - ### 4.4 安装编译python +### 4.4 安装编译python - 使用以下指定从官网下载安装包并解压: +使用以下指定从官网下载安装包并解压: ```shell .wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz tar Jxf Python-3.10.0.tar.xz ``` - 编译安装对应的 python 包: +编译安装对应的 python 包: ```shell cd Python-3.10.0 ./configure prefix=/usr/local/python3