This is an automated email from the ASF dual-hosted git repository.
gosonzhang 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 934c97f [INLONG-683] Modify the file format of the Agent (#88)
934c97f is described below
commit 934c97f48087768a60afdae1bdc635a201a6ec6e
Author: gosonzhang <[email protected]>
AuthorDate: Thu Jul 8 11:23:55 2021 +0800
[INLONG-683] Modify the file format of the Agent (#88)
---
docs/en-us/modules/agent/quick_start.md | 65 +++++++++++++++--------------
docs/zh-cn/modules/agent/quick_start.md | 73 +++++++++++++++++----------------
2 files changed, 72 insertions(+), 66 deletions(-)
diff --git a/docs/en-us/modules/agent/quick_start.md
b/docs/en-us/modules/agent/quick_start.md
index f2a2840..294e052 100644
--- a/docs/en-us/modules/agent/quick_start.md
+++ b/docs/en-us/modules/agent/quick_start.md
@@ -16,28 +16,32 @@
The agent supports two modes of operation: local operation and online operation
-###2.1 Agent configuration
+### 2.1 Agent configuration
Online operation needs to pull the configuration from inlong-manager, the
configuration conf/agent.properties is as follows:
+```ini
agent.fetcher.classname=org.apache.inlong.agent.plugin.fetcher.ManagerFetcher
(the class name for fetch tasks, default ManagerFetcher)
agent.local.ip=Write local ip
agent.manager.vip.http.host=manager host
agent.manager.vip.http.port=manager port
+```
-###2.2 Proxy configuration
+### 2.2 Proxy configuration
Create a new folder named .inlong\.managerIps in the agent directory, and
create a new bid+.local file inside. For example, if the sending bid is set to
a, then create a new file a.local
write:
+```ini
+{"cluster_id":1,"isInterVisit":1,"size":1,"address": [{"port":write proxy
port,"host":"write proxy ip"}], "switch":0}
+```
- {"cluster_id":1,"isInterVisit":1,"size":1,"address": [{"port":write proxy
port,"host":"write proxy ip"}], "switch":0}
-
-###2.3 local job configuration
+### 2.3 local job configuration
If you do not use the online mode, you can use the local file to create a new
read task
Create a new directory jobs in conf,
vim job1.json:
put
-
+```json
+ {
"job": {
"dir": {
@@ -67,30 +71,27 @@ put
}
}
-
-
+```
The meaning of each parameter is :
-
- job.dir.pattern: Configure the read file path, which can include regular
expressions
-
- job.trigger: Trigger name, the default is DirectoryTrigger, the function
is to monitor the files under the folder to generate events
-
- job.source: The type of data source used, the default is TextFileSource,
which reads text files
-
- job.sink:The type of writer used, the default is ProxySink, which sends
messages to the proxy
-
- proxy.bid: The bid type used when writing proxy
-
-###2.4 Add job configuration in real time
-
-##agent.propertities Modify the following two places
-
- # whether enable http service
- agent.http.enable=true
- # http default port
- agent.http.port=Available ports
-
+- job.dir.pattern: Configure the read file path, which can include regular
expressions
+- job.trigger: Trigger name, the default is DirectoryTrigger, the function is
to monitor the files under the folder to generate events
+- job.source: The type of data source used, the default is TextFileSource,
which reads text files
+- job.sink:The type of writer used, the default is ProxySink, which sends
messages to the proxy
+- proxy.bid: The bid type used when writing proxy
+
+### 2.4 Add job configuration in real time
+
+#### 2.4.1 agent.propertities Modify the following two places
+```ini
+# whether enable http service
+agent.http.enable=true
+# http default port
+agent.http.port=Available ports
+```
+
+#### 2.4.2 Execute the following command
+```bash
curl --location --request POST 'http://localhost:8129/config/job' \
--header 'Content-Type: application/json' \
--data '{
@@ -121,9 +122,11 @@ The meaning of each parameter is :
},
"op": "add"
}'
+```
-
-##3、run
+## 3、run
After decompression, run the following command
- sh agent.sh start
+```bash
+sh agent.sh start
+```
\ No newline at end of file
diff --git a/docs/zh-cn/modules/agent/quick_start.md
b/docs/zh-cn/modules/agent/quick_start.md
index 2bfe2ce..3711af6 100644
--- a/docs/zh-cn/modules/agent/quick_start.md
+++ b/docs/zh-cn/modules/agent/quick_start.md
@@ -15,30 +15,33 @@
agent 支持两种运行模式:本地运行以及线上运行
-###2.1 Agent 线上运行相关设置
+### 2.1 Agent 线上运行相关设置
线上运行需要从inlong-manager拉取配置,配置conf/agent.properties如下:
+```ini
agent.fetcher.classname=org.apache.inlong.agent.plugin.fetcher.ManagerFetcher
(设置任务获取的类名,默认为ManagerFetcher)
agent.local.ip=写入本机ip
agent.manager.vip.http.host=manager host
agent.manager.vip.http.port=manager port
+```
-###2.2 Proxy 相关设置
+### 2.2 Proxy 相关设置
在agent目录下新建.inlong\.managerIps文件夹,内部新建bid+.local文件,例如设置的发送bid为a, 则新建a.local文件
-内部写入:
+内部将写入:
+```ini
+{"cluster_id":1,"isInterVisit":1,"size":1,"address": [{"port":写入proxy
port,"host":"写入proxy ip"}], "switch":0}
+```
- {"cluster_id":1,"isInterVisit":1,"size":1,"address": [{"port":写入proxy
port,"host":"写入proxy ip"}], "switch":0}
-
-###2.3 agent本地运行job配置
+### 2.3 agent本地运行job配置
如果不使用线上模式,可以使用本地文件新建读取任务
在conf中新建目录jobs,
vim job1.json:
写入
-
+```json
{
-
+
"job": {
"dir": {
@@ -68,30 +71,28 @@ vim job1.json:
}
}
-
+```
其中各个参数含义为:
-
- job.dir.pattern: 配置读取的文件路径,可包含正则表达式
-
- job.trigger: 触发器名称,默认为DirectoryTrigger,功能为监听文件夹下的文件产生事件
-
- job.source: 使用的数据源类型,默认为TextFileSource,读取文本文件
-
- job.sink:使用的写入器类型,默认为ProxySink,发送消息到proxy中
-
- proxy.bid: 写入proxy时使用的bid类型
-
-###2.4 实时添加job配置
-
-##agent.propertities 修改下面两处
-
- # whether enable http service
- agent.http.enable=true
- # http default port
- agent.http.port=可用端口
-
+- job.dir.pattern: 配置读取的文件路径,可包含正则表达式
+- job.trigger: 触发器名称,默认为DirectoryTrigger,功能为监听文件夹下的文件产生事件
+- job.source: 使用的数据源类型,默认为TextFileSource,读取文本文件
+- job.sink:使用的写入器类型,默认为ProxySink,发送消息到proxy中
+- proxy.bid: 写入proxy时使用的bid类型
+
+### 2.4 实时添加job配置
+
+#### 2.4.1 agent.propertities 修改下面两处
+```ini
+# whether enable http service
+agent.http.enable=true
+# http default port
+agent.http.port=可用端口
+```
+
+#### 2.4.2 执行如下命令:
+```bash
curl --location --request POST 'http://localhost:8129/config/job' \
--header 'Content-Type: application/json' \
--data '{
@@ -117,12 +118,14 @@ curl --location --request POST
'http://localhost:8129/config/job' \
},
"op": "add"
}'
+```
- 其中参数分别为:
- pattern: 代表读取/data/inlong-agent/test.log文件
- proxy.bid: 代表发送到proxy使用的bid
+其中参数分别为:
+- pattern: 代表读取/data/inlong-agent/test.log文件
+- proxy.bid: 代表发送到proxy使用的bid
-##三、运行
+## 三、运行
解压后如下命令运行
-
- sh agent.sh start
\ No newline at end of file
+```bash
+sh agent.sh start
+```
\ No newline at end of file