未验证 提交 2b822766 编写于 作者: C Caideyipi 提交者: GitHub

[To rel/1.0] Modified some documents (#8220)

上级 89add7ba
......@@ -29,9 +29,9 @@ An illustration of the cluster architecture:
<img style="width:100%; max-width:500px; max-height:400px; margin-left:auto; margin-right:auto; display:block;" src="https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/Cluster/Architecture.png?raw=true">
ConfigNode is the control node of the cluster, which manages the node status of cluster, partition information, etc. All ConfigNodes in the cluster form a highly available group, which is fully replicated.
ConfigNode is the control node of the cluster, which manages the cluster's node status, partition information, etc. All ConfigNodes in the cluster form a highly available group, which is fully replicated.
DataNode stores the data and schema of cluster, which manages multiple data regions and schema regions. Data is a time-value pair, and schema is the path and data type of each time series.
DataNode stores the data and schema of the cluster, which manages multiple data regions and schema regions. Data is a time-value pair, and schema is the path and data type of each time series.
Client could only connect to the DataNode for operation.
......@@ -39,16 +39,16 @@ Client could only connect to the DataNode for operation.
| Concept | Type | Description |
|:------------------|:---------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|
| ConfigNode | node role | Configuration node, which manages cluster node information and partition information, monitors cluster status, controls load balancing |
| ConfigNode | node role | Configuration node, which manages cluster node information and partition information, monitors cluster status and controls load balancing |
| DataNode | node role | Data node, which manages data and meta data |
| Database | meta data | Database, data are isolated physically from different databases |
| DeviceId | device id | The full path from root to the penultimate level in the metadata tree represents a device id |
| SeriesSlot | schema partition | Each database contains many SeriesSlot, the partition key is DeviceId |
| SeriesSlot | schema partition | Each database contains many SeriesSlots, the partition key being DeviceId |
| SchemaRegion | schema region | A collection of multiple SeriesSlots |
| SchemaRegionGroup | logical concept | The number of SchemaRegions contained in group is the number of schema replication, it manages the same schema data, and back up each other |
| SeriesTimeSlot | data partition | The data of a time interval of SeriesSlot, a SeriesSlot contains multiple SeriesTimeSlots, the partition key is timestamp |
| SchemaRegionGroup | logical concept | The number of SchemaRegions contained in group is the number of schema replicas, it manages the same schema data, and back up each other |
| SeriesTimeSlot | data partition | The data of a time interval of SeriesSlot, a SeriesSlot contains multiple SeriesTimeSlots, the partition key being timestamp |
| DataRegion | data region | A collection of multiple SeriesTimeSlots |
| DataRegionGroup | logical concept | The number of DataRegions contained in group is the number of data replication, it manages the same data, and back up each other |
| DataRegionGroup | logical concept | The number of DataRegions contained in group is the number of data replicas, it manages the same data, and back up each other |
## Characteristics of Cluster
......@@ -87,7 +87,7 @@ Regions will be allocated to different DataNodes to avoid single point of failur
The replication strategy replicates data in multiple replicas, which are copies of each other. Multiple copies can provide high-availability services together and tolerate the failure of some copies.
A region is the basic unit of replication. Multiple replicas of a region construct a high-availability RegionGroup, to support high availability.
A region is the basic unit of replication. Multiple replicas of a region construct a high-availability RegionGroup.
* Replication and consensus
* ConfigNode Group: Consisting of all ConfigNodes.
......
......@@ -195,7 +195,6 @@ Start on Linux:
```
bash sbin/start-standalone.sh
```
It's recommended to use sudo here, for that the backstage logs may need sudo permission.
Besides, with our shell, you can also directly kill these processes.
......@@ -254,15 +253,15 @@ confignode\sbin\remove-confignode.bat <internal_address>:<internal_port>
### Remove DataNode
Execute the remove-datanode shell on an active, and make sure that there are no less than the number of data/schema_replication_factor DataNodes in Cluster after removing.
Execute the remove-datanode shell on an active DataNode, and make sure that the number of active DataNodes are no less than the number of data/schema_replication_factor in Cluster after removing.
Remove on Linux:
```
# Remove the DataNode with datanode_id
./datanode/sbin/remove-datanode.sh <datanode_id>
bash ./datanode/sbin/remove-datanode.sh <datanode_id>
# Remove the DataNode with rpc address:port
./datanode/sbin/remove-datanode.sh <rpc_address>:<rpc_port>
bash ./datanode/sbin/remove-datanode.sh <rpc_address>:<rpc_port>
```
Remove on Windows:
......@@ -283,10 +282,10 @@ illustrate how to start, expand, and shrink a IoTDB Cluster.
Unzip the apache-iotdb-1.0.0-all-bin.zip file to cluster0 folder.
### 2. Starting a Minimum Cluster
### 2. Start a Minimum Cluster
Starting the Cluster version with one ConfigNode and one DataNode(1C1D),
the default number of replica is one.
Start the Cluster version with one ConfigNode and one DataNode(1C1D), and
the default number of replicas is one.
```
./cluster0/sbin/start-confignode.sh
./cluster0/sbin/start-datanode.sh
......@@ -294,7 +293,7 @@ the default number of replica is one.
### 3. Verify the Minimum Cluster
+ The minimum cluster is successfully started. Start the Cli for verification.
+ If everything goes well, the minimum cluster will start successfully. Then, we can start the Cli for verification.
```
./cluster0/sbin/start-cli.sh
```
......@@ -370,7 +369,7 @@ For folder cluster2:
### 6. Expanding the Cluster
Expanding the Cluster to three ConfigNode and three DataNode(3C3D).
The following commands can be executed in no particular order.
The following commands can be executed in arbitrary order.
```
./cluster1/sbin/start-confignode.sh
......@@ -381,7 +380,7 @@ The following commands can be executed in no particular order.
### 7. Verify Cluster expansion
Execute the show cluster command, the result is shown below:
Execute the show cluster command, then the result is shown below:
```
IoTDB> show cluster
+------+----------+-------+---------------+------------+
......@@ -412,7 +411,7 @@ It costs 0.012s
### 9. Verify Cluster shrinkage
Execute the show cluster command, the result is shown below:
Execute the show cluster command, then the result is shown below:
```
IoTDB> show cluster
+------+----------+-------+---------------+------------+
......
......@@ -28,38 +28,40 @@ IoTDB provides Cli/shell tools for users to interact with IoTDB server in comman
## Installation
Under the root path of iotdb:
If you use the source code version of IoTDB, then under the root path of IoTDB, execute:
```shell
> mvn clean package -pl cli -am -DskipTests
```
After build, the IoTDB cli will be in the folder "cli/target/iotdb-cli-{project.version}".
After build, the IoTDB Cli will be in the folder "cli/target/iotdb-cli-{project.version}".
If you download the binary version, then the Cli can be used directly in sbin folder.
## Running
### Running Cli
After installation, there is a default user in IoTDB: `root`, and the
default password is `root`. Users can use this username to try IoTDB Cli/Shell tool. The cli startup script is the `start-cli` file under the \$IOTDB\_HOME/bin folder. When starting the script, you need to specify the IP and PORT. (Make sure the IoTDB server is running properly when you use Cli/Shell tool to connect it.)
default password is `root`. Users can use this username to try IoTDB Cli/Shell tool. The cli startup script is the `start-cli` file under the \$IOTDB\_HOME/bin folder. When starting the script, you need to specify the IP and PORT. (Make sure the IoTDB cluster is running properly when you use Cli/Shell tool to connect to it.)
Here is an example where the server is started locally and the user has not changed the running port. The default rpc port is
Here is an example where the cluster is started locally and the user has not changed the running port. The default rpc port is
6667 </br>
If you need to connect to the remote server or changes
the rpc port number of the server running, set the specific IP and RPC PORT at -h and -p.</br>
If you need to connect to the remote DataNode or changes
the rpc port number of the DataNode running, set the specific IP and RPC PORT at -h and -p.</br>
You also can set your own environment variable at the front of the start script ("/sbin/start-cli.sh" for linux and "/sbin/start-cli.bat" for windows)
The Linux and MacOS system startup commands are as follows:
```shell
Shell > sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
Shell > bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
```
The Windows system startup commands are as follows:
```shell
Shell > sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
```
After using these commands, the cli can be started successfully. The successful status will be as follows:
After operating these commands, the cli can be started successfully. The successful status will be as follows:
```
_____ _________ ______ ______
......@@ -70,10 +72,10 @@ After using these commands, the cli can be started successfully. The successful
|_____|'.__.' |_____| |______.'|_______/ version <version>
IoTDB> login successfully
Successfully login at 127.0.0.1:6667
IoTDB>
```
Enter ```quit``` or `exit` can exit Cli. The cli will shows `quit normally`
Enter ```quit``` or `exit` can exit Cli.
### Cli Parameters
......@@ -95,7 +97,7 @@ Following is a cli command which connects the host with IP
The Linux and MacOS system startup commands are as follows:
```shell
Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
Shell > bash sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
```
The Windows system startup commands are as follows:
......@@ -105,6 +107,7 @@ Shell > sbin\start-cli.bat -h 10.129.187.21 -p 6667 -u root -pw root -disableISO
### CLI Special Command
Special commands of Cli are below.
| Command | Description / Example |
|:---|:---|
| `set time_display_type=xxx` | eg. long, default, ISO8601, yyyy-MM-dd HH:mm:ss |
......@@ -121,7 +124,7 @@ Special commands of Cli are below.
Openid connect (oidc) uses keycloack as the authority authentication service of oidc service
#### configuration
#### Configuration
The configuration is located in iotdb-datanode.properties(iotdb-confignode.properties) , set the author_provider_class is org.apache.iotdb.db.auth.authorizer.OpenIdAuthorizer Openid service is enabled, and the default value is org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer Indicates that the openid service is not enabled.
```
......@@ -138,7 +141,7 @@ openID_url=http://127.0.0.1:8080/auth/realms/iotdb/
```shell
Shell >cd bin
Shell >./standalone.sh
Shell >bash ./standalone.sh
```
2、use url(https://ip:port/auth) login keycloack, the first login needs to create a user
![avatar](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/CLI/Command-Line-Interface/login_keycloak.png?raw=true)
......@@ -193,7 +196,7 @@ If OIDC is enabled on server side then no username / passwort is needed but a va
So as username you use the token and the password has to be empty, e.g.
```shell
Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
Shell > bash sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
```
Among them, you need to replace {my access token} (note, including {}) with your token, that is, the value corresponding to access_token.
......@@ -224,14 +227,14 @@ This has to be passed as username (with parameter `-u`) and empty password to th
-e parameter is designed for the Cli/shell tool in the situation where you would like to manipulate IoTDB in batches through scripts. By using the -e parameter, you can operate IoTDB without entering the cli's input mode.
In order to avoid confusion between statements and other parameters, the current situation only supports the -e parameter as the last parameter.
In order to avoid confusion between statements and other parameters, the current version only supports the -e parameter as the last parameter.
The usage of -e parameter for Cli/shell is as follows:
The Linux and MacOS system commands:
```shell
Shell > sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
Shell > bash sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
```
The Windows system commands:
......@@ -254,18 +257,18 @@ rpcPort=6667
user=root
pass=root
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create database root.demo"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create timeseries root.demo.s1 WITH DATATYPE=INT32, ENCODING=RLE"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(1,10)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(2,11)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(3,12)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "select s1 from root.demo"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create database root.demo"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create timeseries root.demo.s1 WITH DATATYPE=INT32, ENCODING=RLE"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(1,10)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(2,11)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(3,12)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "select s1 from root.demo"
```
The print results are shown in the figure, which are consistent with the cli and jdbc operations.
The results are shown in the figure, which are consistent with the Cli and jdbc operations.
```shell
Shell > ./shell.sh
Shell > bash ./shell.sh
+-----------------------------+------------+
| Time|root.demo.s1|
+-----------------------------+------------+
......
......@@ -67,8 +67,6 @@ Users can start IoTDB standalone mode by the start-standalone script under the s
# Unix/OS X
> bash sbin/start-standalone.sh
```
It's recommended to use sudo here, because you may need root permission to write backstage logs.
```
# Windows
> sbin\start-standalone.bat
......
......@@ -37,7 +37,7 @@ To use IoTDB, you need to have:
>Note: If you don't have maven installed, you should replace 'mvn' in the following commands with 'mvnw' or 'mvnw.cmd'.
>
>### Installation from binary files
>### Installation from binary files
You can download the binary file from:
[Download page](https://iotdb.apache.org/Download/)
......@@ -135,11 +135,11 @@ $ docker exec -it <C_ID> /bin/bash
$ (now you have enter the container): /iotdb/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
```
Or, if you have a iotdb-cli locally, execute the following command:
Or, if you have an iotdb-cli locally, execute the following command:
```shell
$ /%IOTDB_HOME%/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
```
5. If you want to write codes to insert data and query data, please add the following dependence:
5. If you want to write codes to insert data and query data, please add the following dependencies:
```xml
<dependency>
<groupId>org.apache.iotdb</groupId>
......
......@@ -194,7 +194,6 @@ Linux 启动方式:
```
bash sbin/start-standalone.sh
```
这里建议使用 sudo,因为后台日志的写入可能需要 root 权限。
也可以使用脚本直接关闭这些进程。
......
......@@ -25,13 +25,15 @@ IOTDB 为用户提供 cli/Shell 工具用于启动客户端和服务端程序。
> \$IOTDB\_HOME 表示 IoTDB 的安装目录所在路径。
## 安装
在 iotdb 的根目录下执行
如果使用源码版,可以在 iotdb 的根目录下执行
```shell
> mvn clean package -pl cli -am -DskipTests
```
在生成完毕之后,IoTDB 的 cli 工具位于文件夹"cli/target/iotdb-cli-{project.version}"中。
在生成完毕之后,IoTDB 的 Cli 工具位于文件夹"cli/target/iotdb-cli-{project.version}"中。
如果你下载的是二进制版,那么 Cli 可以在 sbin 文件夹下直接找到。
## 运行
......@@ -42,7 +44,7 @@ IOTDB 为用户提供 cli/Shell 工具用于启动客户端和服务端程序。
Linux 系统与 MacOS 系统启动命令如下:
```shell
Shell > sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
Shell > bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
```
Windows 系统启动命令如下:
......@@ -59,7 +61,7 @@ Shell > sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
_| |_| \__. | _| |_ _| |_.' /_| |__) |
|_____|'.__.' |_____| |______.'|_______/ version <version>
IoTDB> login successfully
Successfully login at 127.0.0.1:6667
```
输入`quit``exit`可退出 cli 结束本次会话,cli 输出`quit normally`表示退出成功。
......@@ -82,7 +84,7 @@ IoTDB> login successfully
Linux 系统与 MacOS 系统启动命令如下:
```shell
Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
Shell > bash sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u root -pw root -disableISO8601 -maxPRC 10
```
Windows 系统启动命令如下:
......@@ -92,6 +94,7 @@ Shell > sbin\start-cli.bat -h 10.129.187.21 -p 6667 -u root -pw root -disableISO
### CLI 特殊命令
下面列举了一些CLI的特殊命令。
| 命令 | 描述 / 例子 |
|:---|:---|
| `set time_display_type=xxx` | 例如: long, default, ISO8601, yyyy-MM-dd HH:mm:ss |
......@@ -124,8 +127,8 @@ openID_url=http://127.0.0.1:8080/auth/realms/iotdb/
1、下载 keycloack 程序,在 keycloack/bin 中启动 keycloack
```shell
Shell >cd bin
Shell >./standalone.sh
Shell > cd bin
Shell > bash ./standalone.sh
```
2、使用 https://ip:port/auth 登陆 keycloack, 首次登陆需要创建用户
......@@ -182,7 +185,7 @@ Shell >./standalone.sh
此时,登录命令如下:
```shell
Shell > sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
Shell > bash sbin/start-cli.sh -h 10.129.187.21 -p 6667 -u {my-access-token} -pw ""
```
其中,需要将{my-access-token} (注意,包括{})替换成你的 token,即 access_token 对应的值。
......@@ -214,7 +217,7 @@ curl -X POST "http://{your-keycloack-server}/auth/realms/{your-realm}/protocol/o
Linux 系统与 MacOS 指令:
```shell
Shell > sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
Shell > bash sbin/start-cli.sh -h {host} -p {rpcPort} -u {user} -pw {password} -e {sql for iotdb}
```
Windows 系统指令
......@@ -246,18 +249,18 @@ rpcPort=6667
user=root
pass=root
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "CREATE DATABASE root.demo"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create timeseries root.demo.s1 WITH DATATYPE=INT32, ENCODING=RLE"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(1,10)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(2,11)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(3,12)"
./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "select s1 from root.demo"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "CREATE DATABASE root.demo"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "create timeseries root.demo.s1 WITH DATATYPE=INT32, ENCODING=RLE"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(1,10)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(2,11)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "insert into root.demo(timestamp,s1) values(3,12)"
bash ./sbin/start-cli.sh -h ${host} -p ${rpcPort} -u ${user} -pw ${pass} -e "select s1 from root.demo"
```
打印出来的结果显示如下,通过这种方式进行的操作与客户端的输入模式以及通过 JDBC 进行操作结果是一致的。
```shell
Shell > ./shell.sh
Shell > bash ./shell.sh
+-----------------------------+------------+
| Time|root.demo.s1|
+-----------------------------+------------+
......
......@@ -60,7 +60,6 @@ Linux 系统与 MacOS 系统启动命令如下:
```
> bash sbin/start-standalone.sh
```
这里最好使用sudo,如果不使用 sudo,可能会提示后台日志无权限写入。
Windows 系统启动命令如下:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册