You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/01/20 07:50:46 UTC

[incubator-inlong-website] branch master updated: [INLONG-2169][Feature][Agent] should provide docs for agent db sql collect (#254)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a0ff9a  [INLONG-2169][Feature][Agent] should provide docs for agent db sql collect (#254)
7a0ff9a is described below

commit 7a0ff9addbf8f6e81f0e409eabf30b5edfbeae9b
Author: ziruipeng <zp...@connect.ust.hk>
AuthorDate: Thu Jan 20 15:50:43 2022 +0800

    [INLONG-2169][Feature][Agent] should provide docs for agent db sql collect (#254)
    
    Co-authored-by: EMsnap <st...@tencent.com>
---
 docs/modules/agent/sql.md                          | 60 ++++++++++++++++++++++
 .../current/modules/agent/sql.md                   | 60 ++++++++++++++++++++++
 2 files changed, 120 insertions(+)

diff --git a/docs/modules/agent/sql.md b/docs/modules/agent/sql.md
new file mode 100644
index 0000000..c4256c0
--- /dev/null
+++ b/docs/modules/agent/sql.md
@@ -0,0 +1,60 @@
+---
+title: MySQL SQL
+sidebar_position: 3
+---
+
+## Overview
+Currently, Agent supports MYSQL version 5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x
+Currently, the Agent only supports the curl request to create a Job to submit collection tasks, and temporarily does not support the manager front-end to create SQL collection
+
+## Create A MySQL Job
+
+1. Apply for access on the manager, when filling in the data information, select the message source as "Independent Push"
+2. Select the source data field separator
+3. Fill in the source data fields, and the field order should be consistent with the field order in the sql query result
+4. Create a SQL read task using curl request
+
+## Parameter Description
+
+````
+Each parameter used in SQL Agent Job is described as
+1. job.sql.command: The actual executed sql statement, for example: select * from apache_inlong_manager.user
+2. job.sql.user: the user used when connecting to the database, for example: abc
+3. job.sql.password: The password used when connecting to the database, for example: 123456
+4. job.sql.hostname: The IP address of the connected database, for example: 127.0.0.1
+5. job.sql.port: the connected database port, for example: 3306
+6. job.sql.separator: The separator used to separate multiple fields needs to be used with the manager front-end
+````
+
+## Example
+
+```bash
+curl --location --request POST 'http://localhost:8008/config/job' \--header 'Content-Type: application/json' \--data '{
+  "job": {
+    "sql": {
+      "command": "select * from apache_inlong_manager.user",
+      "user":  "root",
+      "password": "inlong",
+      "hostname": "10.0.0.6",
+      "port": "3306",
+      "separator": "|"
+    },
+    "id": 1,
+    "thread": {
+      "running": {
+        "core": "4"
+      }
+    },
+    "name": "test",
+    "source": "org.apache.inlong.agent.plugin.sources.DataBaseSource",
+    "sink": "org.apache.inlong.agent.plugin.sinks.ProxySink",
+    "channel": "org.apache.inlong.agent.plugin.channel.MemoryChannel"
+  },
+  "proxy": {
+    "inlongGroupId": "b_test_tube_hive_20211221_01",
+    "inlongStreamId": "test_data_stream_20211221_01_01"
+  },
+  "op": "add"
+}
+'
+```
\ No newline at end of file
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/agent/sql.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/agent/sql.md
new file mode 100644
index 0000000..8299313
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/agent/sql.md
@@ -0,0 +1,60 @@
+---
+title: MySQL SQL
+sidebar_position: 3
+---
+
+## 总览
+目前 Agent 支持 MySQL 版本为5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x
+目前 Agent 只支持 curl 请求创建 Job 方式提交采集任务,暂时不支持 manager 前端创建 SQL 采集
+
+## MySQL Job创建步骤
+
+1、在 manager 上申请接入,填写数据信息时,选择消息来源为"自主推送"
+2、选择源数据字段分隔符
+3、填写源数据字段,字段顺序与 sql 查询结果中的字段顺序保持一致
+4、使用 curl 请求创建一个 SQL 读取任务
+
+## 参数说明
+
+```
+SQL Agent Job 中各个使用参数说明为
+1、job.sql.command: 实际执行的 sql 语句,举例: select * from apache_inlong_manager.user
+2、job.sql.user: 连接数据库时使用的 user,举例: abc
+3、job.sql.password: 连接数据库时使用的 password, 举例: 123456
+4、job.sql.hostname: 连接的数据库 ip 地址,举例:127.0.0.1
+5、job.sql.port:连接的数据库端口,举例:3306
+6、job.sql.separator: 使用的分割符来分割多个字段,需要与 manager 前端
+```
+
+## 举例
+
+```bash
+curl --location --request POST 'http://localhost:8008/config/job' \--header 'Content-Type: application/json' \--data '{
+  "job": {
+    "sql": {
+      "command": "select * from apache_inlong_manager.user",
+      "user":  "root",
+      "password": "inlong",
+      "hostname": "10.0.0.6",
+      "port": "3306",
+      "separator": "|"
+    },
+    "id": 1,
+    "thread": {
+      "running": {
+        "core": "4"
+      }
+    },
+    "name": "test",
+    "source": "org.apache.inlong.agent.plugin.sources.DataBaseSource",
+    "sink": "org.apache.inlong.agent.plugin.sinks.ProxySink",
+    "channel": "org.apache.inlong.agent.plugin.channel.MemoryChannel"
+  },
+  "proxy": {
+    "inlongGroupId": "b_test_tube_hive_20211221_01",
+    "inlongStreamId": "test_data_stream_20211221_01_01"
+  },
+  "op": "add"
+}
+'
+```
\ No newline at end of file