You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2021/07/12 09:42:06 UTC
[iotdb] 01/01: Update docker doc
This is an automated email from the ASF dual-hosted git repository.
xiangweiwei pushed a commit to branch dockerdoc
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5b48356df2effef9b418b336b218fd7727eb35d5
Author: Alima777 <wx...@gmail.com>
AuthorDate: Mon Jul 12 17:41:26 2021 +0800
Update docker doc
---
docs/UserGuide/QuickStart/WayToGetIoTDB.md | 47 +++++++++--------------
docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md | 55 +++++++++++----------------
2 files changed, 42 insertions(+), 60 deletions(-)
diff --git a/docs/UserGuide/QuickStart/WayToGetIoTDB.md b/docs/UserGuide/QuickStart/WayToGetIoTDB.md
index 21f0d85..8f0c282 100644
--- a/docs/UserGuide/QuickStart/WayToGetIoTDB.md
+++ b/docs/UserGuide/QuickStart/WayToGetIoTDB.md
@@ -72,31 +72,28 @@ After build, the IoTDB server will be at the folder "server/target/iotdb-server-
### Installation by Docker (Dockerfile)
Apache IoTDB' Docker image is released on [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb),
-Using `docker pull apache/iotdb:latest` can get the latest docker image.
-Users can also build a docker image themselves.
-Now a Dockerfile has been written at docker/src/main/Dockerfile.
+1. **Get IoTDB docker image**
+ - **Recommended:** Using `docker pull apache/iotdb:latest` can get the latest docker image.
+ - Users can also build a docker image themselves. Now a Dockerfile has been written at docker/src/main/Dockerfile.
+ - Way 1: `$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker`
+ - Way 2:
+ ```shell
+ $ git clone https://github.com/apache/iotdb
+ $ cd iotdb
+ $ cd docker
+ $ docker build -t iotdb:base .
+ ```
-1. You can build a docker image by:
-```shell
-$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker
-```
-Or:
-```shell
-$ git clone https://github.com/apache/iotdb
-$ cd iotdb
-$ cd docker
-$ docker build -t iotdb:base .
-```
Once the docker image has been built locally (the tag is iotdb:base in this example), you are almost done!
-2. create docker volume for data files and logs:
+2. **Create docker volume for data files and logs:**
```shell
$ docker volume create mydata
$ docker volume create mylogs
```
-3. run a docker container:
+3. **Run a docker container:**
```shell
$ docker run -p 6667:6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh
```
@@ -111,25 +108,21 @@ $ docker container ls
```
suppose the ID is <C_ID>.
-And get the docker IP by:
+And get the docker IP by the following, suppose the IP is <C_IP>.:
```shell
$ docker inspect --format='{{.NetworkSettings.IPAddress}}' <C_ID>
```
-suppose the IP is <C_IP>.
+Now IoTDB server has started succesfully.
4. If you just want to have a try by using iotdb-cli, you can:
```shell
-$ docker exec -it /bin/bash <C_ID>
-$ (now you have enter the container): /cli/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
+$ 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, run a new docker container as the client:
+Or, if you have a iotdb-cli locally, execute the following command:
```shell
-$ docker run -it iotdb:base /cli/sbin/start-cli.sh -h <C_IP> -p 6667 -u root -pw root
-```
-Or, if you have a iotdb-cli locally (e.g., you have compiled the source code by `mvn package`), and suppose your work_dir is cli/bin, then you can just run:
-```shell
-$ start-cli.sh -h localhost -p 6667 -u root -pw root
+$ /%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:
```xml
@@ -140,5 +133,3 @@ $ start-cli.sh -h localhost -p 6667 -u root -pw root
</dependency>
```
Some examples about how to use IoTDB with IoTDB-JDBC can be found at: https://github.com/apache/iotdb/tree/master/example/jdbc/src/main/java/org/apache/iotdb
-
-6. Now enjoy it!
diff --git a/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md b/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
index 27a7769..1231328 100644
--- a/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
+++ b/docs/zh/UserGuide/QuickStart/WayToGetIoTDB.md
@@ -74,33 +74,32 @@ Shell > uzip iotdb-<version>.zip
### 通过Docker安装 (Dockerfile)
Apache IoTDB的Docker镜像已经上传至 [https://hub.docker.com/r/apache/iotdb](https://hub.docker.com/r/apache/iotdb),
-使用`docker pull apache/iotdb:latest`即可获取最新的docker镜像。
-用户也可以根据代码提供的Dockerfile文件来自己生成镜像。
-Dockerfile 存放在的 docker 工程下的 src/main/Dockerfile 中.
+1. **获取 IoTDB docker 镜像**
-1. 您可以使用下面的命令构建 docker image:
+ - **推荐**:执行 `docker pull apache/iotdb:latest` 即可获取最新的docker镜像。
-```shell
-$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker
-```
-或者:
+ - 用户也可以根据代码提供的Dockerfile文件来自己生成镜像。Dockerfile 存放在的 docker 工程下的 src/main/Dockerfile 中。
-```shell
-$ git clone https://github.com/apache/iotdb
-$ cd iotdb
-$ mvn package -DskipTests
-$ cd docker
-$ docker build -t iotdb:base .
-```
-当 docker image 在本地构建完成当时候 (示例中的 tag为 iotdb:base),已经距完成只有一步之遥了!
+ - 方法1:```$ docker build -t iotdb:base git://github.com/apache/iotdb#master:docker```
+
+ - 方法2:
+ ```shell
+ $ git clone https://github.com/apache/iotdb
+ $ cd iotdb
+ $ mvn package -DskipTests
+ $ cd docker
+ $ docker build -t iotdb:base .
+ ```
+
+ 当 docker image 在本地构建完成的时候 (示例中的 tag为 iotdb:base),已经距完成只有一步之遥了!
-2. 创建数据文件和日志的 docker 挂载目录(docker volume):
+2. **创建数据文件和日志的 docker 挂载目录(docker volume):**
```
$ docker volume create mydata
$ docker volume create mylogs
```
-3. 运行 docker container:
+3. **运行 docker 容器:**
```shell
$ docker run -p 6667:6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d iotdb:base /iotdb/bin/start-server.sh
@@ -117,29 +116,24 @@ $ docker container ls
```
假设这个 ID 为 <C_ID>.
-然后使用下面的命令获取这个 ID 对应的 IP 地址:
+然后使用下面的命令获取这个 ID 对应的 IP 地址,假设获取的 IP 为 <C_IP>:
```shell
$ docker inspect --format='{{.NetworkSettings.IPAddress}}' <C_ID>
```
-假设获取的 IP 为 <C_IP>.
+现在 IoTDB 服务器已经启动成功了。
4. 如果您想尝试使用 iotdb-cli 命令行, 您可以使用如下命令:
```shell
-$ docker exec -it /bin/bash <C_ID>
-$ (now you have enter the container): /cli/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
+$ 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
```
-或者运行一个新的 client docker container,命令如下:
+还可以使用本地的 iotdb-cli,执行如下命令:
```shell
-$ docker run -it iotdb:base /cli/sbin/start-cli.sh -h <C_IP> -p 6667 -u root -pw root
-```
-还可以使用本地的 iotdb-cli (比如:您已经使用`mvn package`编译过源码), 假设您的 work_dir 是 cli/bin, 那么您可以直接运行:
-
-```shell
-$ start-cli.sh -h localhost -p 6667 -u root -pw root
+$ /%IOTDB_HOME%/sbin/start-cli.sh -h localhost -p 6667 -u root -pw root
```
5. 如果您想写一些代码来插入或者查询数据,您可以在 pom.xml 文件中加入下面的依赖:
@@ -152,6 +146,3 @@ $ start-cli.sh -h localhost -p 6667 -u root -pw root
```
这里是一些使用 IoTDB-JDBC 连接 IoTDB 的示例: https://github.com/apache/iotdb/tree/master/example/jdbc/src/main/java/org/apache/iotdb
-6. 现在已经大功告成了
-
-