From fcd211a722210f063049edea4c89db8e076cedb6 Mon Sep 17 00:00:00 2001 From: CloudWise-Lukemiao <76942485+CloudWise-Lukemiao@users.noreply.github.com> Date: Thu, 20 Jan 2022 19:15:35 +0800 Subject: [PATCH] [IOTDB-2313][REST API Doc] how to avoid GC overhead (#4926) Co-authored-by: Steve Yurong Su --- docs/UserGuide/API/RestService.md | 17 ++++++++++++++++- .../Ecosystem Integration/Grafana Plugin.md | 2 ++ docs/zh/UserGuide/API/RestService.md | 16 +++++++++++++++- .../Ecosystem Integration/Grafana Plugin.md | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/docs/UserGuide/API/RestService.md b/docs/UserGuide/API/RestService.md index 08da887d76..12e7552fc9 100644 --- a/docs/UserGuide/API/RestService.md +++ b/docs/UserGuide/API/RestService.md @@ -22,13 +22,26 @@ ## RESTful Services IoTDB's RESTful services can be used for query, write, and management operations, using the OpenAPI standard to define interfaces and generate frameworks. +### Enable RESTful Services +RESTful services are disabled by default. + +* Developer + + Find the `IoTDBrestServiceConfig` class under `org.apache.iotdb.db.conf.rest` in the sever module, and modify `enableRestService=true`. + +* User + + Find the `conf/iotdb.properties` file under the IoTDB installation directory and set `enable_rest_service` to `true` to enable the module. + + ```properties + enable_rest_service=true + ``` ### Authentication RESTful services use the basic authentication. Each URL request needs to carry `'Authorization': 'Basic ' + base64.encode(username + ':' + password)`. - ### Interface #### ping @@ -96,6 +109,8 @@ Response parameters: **Examples:** +Tip: Statements like `select * from root.xx.**` are not recommended because those statements may cause OOM. + **Expression query** ```shell diff --git a/docs/UserGuide/Ecosystem Integration/Grafana Plugin.md b/docs/UserGuide/Ecosystem Integration/Grafana Plugin.md index 5a005cb8e0..318df9573f 100644 --- a/docs/UserGuide/Ecosystem Integration/Grafana Plugin.md +++ b/docs/UserGuide/Ecosystem Integration/Grafana Plugin.md @@ -213,6 +213,8 @@ Here are some examples of valid CONTROL content: * `group by ([0, 20), 2ms, 3ms), level=1` +Tip: Statements like `select * from root.xx.**` are not recommended because those statements may cause OOM. + #### Support for variables and template functions This plugin supports Grafana's variables and templates (https://grafana.com/docs/grafana/v7.0/variables/) feature. diff --git a/docs/zh/UserGuide/API/RestService.md b/docs/zh/UserGuide/API/RestService.md index 977422b22b..e772bedca4 100644 --- a/docs/zh/UserGuide/API/RestService.md +++ b/docs/zh/UserGuide/API/RestService.md @@ -22,7 +22,19 @@ ## RESTful 服务 IoTDB 的 RESTful 服务可用于查询、写入和管理操作,它使用 OpenAPI 标准来定义接口并生成框架。 - +### 开启RESTful 服务 +RESTful 服务默认情况是关闭的 + * 开发者 + + 找到sever模块中`org.apache.iotdb.db.conf.rest` 下面的`IoTDBRestServiceConfig`类,修改`enableRestService=true`即可。 + + * 使用者 + + 找到IoTDB安装目录下面的`conf/iotdb.properties`文件,将 `enable_rest_service` 设置为 `true` 以启用该模块。 + + ```properties + enable_rest_service=true + ``` ### 鉴权 RESTful 服务使用了基础(basic)鉴权,每次 URL 请求都需要在 header 中携带 `'Authorization': 'Basic ' + base64.encode(username + ':' + password)`。 @@ -96,6 +108,8 @@ query 接口可以用于处理数据查询和元数据查询。 请求示例如下所示: +提示:为了避免OOM问题,不推荐使用select * from root.xx.** 这种查找方式。 + 请求示例 表达式查询: ```shell curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"sql":"select s3, s4, s3 + 1 from root.sg27 limit 2"}' http://127.0.0.1:18080/rest/v1/query diff --git a/docs/zh/UserGuide/Ecosystem Integration/Grafana Plugin.md b/docs/zh/UserGuide/Ecosystem Integration/Grafana Plugin.md index 1072784eb9..7d5088b1ac 100644 --- a/docs/zh/UserGuide/Ecosystem Integration/Grafana Plugin.md +++ b/docs/zh/UserGuide/Ecosystem Integration/Grafana Plugin.md @@ -220,7 +220,7 @@ CONTROL 输入框为非必须填写项目,填写内容应当是控制查询类 * `group by ((2017-11-01T00:00:00, 2017-11-07T23:00:00], 1d), level=1` * `group by ([0, 20), 2ms, 3ms), level=1` - +提示:为了避免OOM问题,不推荐使用select * from root.xx.** 这种语句在Grafana plugin中使用。 #### 变量与模板功能的支持 -- GitLab