Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-395] Create the 1.2.0 version document #436

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
to: "/docs/next/introduction",
},
{
label: "1.1.0",
label: "1.2.0",
to: "/docs/introduction",
},
{
label: "1.1.0",
to: "/docs/1.1.0/introduction",
},
{
label: "1.0.0",
to: "/docs/1.0.0/introduction",
Expand Down
66 changes: 66 additions & 0 deletions i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"version.label": {
"message": "1.2.0",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.category.Design and Concept": {
"message": "设计和概念",
"description": "The label for category Design and Concept in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Quick Start": {
"message": "快速开始",
"description": "The label for category Quick Start in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Deployment": {
"message": "安装部署",
"description": "The label for category Deployment in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Components": {
"message": "组件介绍",
"description": "The label for category Components in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Manager": {
"message": "Manager",
"description": "The label for category Manager in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Dashboard": {
"message": "Dashboard",
"description": "The label for category Dashboard in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Agent": {
"message": "Agent",
"description": "The label for category Agent in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.DataProxy": {
"message": "DataProxy",
"description": "The label for category DataProxy in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.DataProxy-SDK": {
"message": "DataProxy-SDK",
"description": "The label for category DataProxy-SDK in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.TubeMQ": {
"message": "TubeMQ",
"description": "The label for category TubeMQ in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.tubemq-manager": {
"message": "tubemq-manager",
"description": "The label for category tubemq-manager in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Sort": {
"message": "Sort",
"description": "The label for category Sort in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Development": {
"message": "开发指引",
"description": "The label for category Development in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.User Guide": {
"message": "用户指引",
"description": "The label for category User Guide in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Data Nodes": {
"message": "数据节点",
"description": "The label for category Data Nodes in sidebar tutorialSidebar"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 审批管理
sidebar_position: 2
---

作为具有审批权限的数据接入员和系统成员,具备对数据接入或者消费审批职责:

![](img/approval-list.png)

#### 数据接入审批

新建数据接入审批:目前为一级审批,由系统管理员审批。

系统管理员将根据数据接入业务信息,审核此次接入流程是否符合接入要求:

![](img/approval-access.png)

#### 新建数据消费审批

新建数据消费审批:目前为一级审批,由业务负责人审批。

业务审批:由数据接入业务负责人根据接入信息判断此消费是否符合业务要求:

![](img/approval-consumption.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: 用户管理
sidebar_position: 1
---

角色为系统管理员的用户才可以使用此功能,他们可以创建、修改、删除用户:

### 新建用户

具有系统管理员权限用户,可以进行创建新用户账号:

![](img/user-create.png)

- 账号类型: 普通用户(具有数据接入和数据消费权限,不具有数据接入审批和账号管理权限);系统管理员(具有数据接入和数据消费权限、数据接入审批和管理账号的权限)
- 用户名称:用户登录账号ID
- 用户密码:用户登录密码
- 有效时长:该账号可在系统使用期限

### 删除用户

系统管理员可以对已创建的用户进行账户删除,删除后此账号将停止使用:

![](img/user-delete.png)

### 修改用户

系统管理员可以修改已创建的账号:

![](img/user-edit.png)

### 更改密码

用户可以修改账号密码,点击【修改密码】,输入旧密码和新密码,确认后此账号新密码将生效:

![](img/user-edit.png)
24 changes: 24 additions & 0 deletions i18n/zh-CN/docusaurus-plugin-content-docs/version-1.2.0/contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 联系我们
sidebar_position: 10
---

联系方式
-------
- Slack频道: [Apache InLong Slack](https://the-asf.slack.com/archives/C01QAG6U00L)
- 邮件列表:

| Name | Scope | | | |
|:------------------------------------------------------------------------------|:--------------------------------|:----------------------------------------------------------------|:--------------------------------------------------------------------|:-----------------------------------------------------------------------------|
| [dev@inlong.apache.org](mailto:dev@inlong.apache.org) | Development-related discussions | [Subscribe](mailto:dev-subscribe@inlong.apache.org) | [Unsubscribe](mailto:dev-unsubscribe@inlong.apache.org) | [Archives](http://mail-archives.apache.org/mod_mbox/inlong-dev/) |

- 主页: https://inlong.apache.org
- Issues: https://issues.apache.org/jira/browse/InLong



License
-------
© Contributors Licensed under an [Apache-2.0](https://github.com/apache/inlong/blob/master/LICENSE) license.


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: 自动推送
sidebar_position: 2
---

## 概述
**自动推送**是指使用 DataProxy SDK 发送数据到 DataProxy 模块,不经过 Agent 进行采集。
DataProxy SDK 目前支持 TCP、HTTP、UDP 协议,使用方式可以参考 [DataProxy SDK Example](https://inlong.apache.org/zh-CN/docs/next/sdk/dataproxy-sdk/example/) 。
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: 文件
sidebar_position: 3
---

## 参数说明
![File Params](img/file_param.png)
- 数据源名称
- 数据源IP:采集节点 Agent IP
- ⽂件路径:必须是绝对路径,支持正则表达式,多个时以逗号分隔
- 时间偏移量:从文件的某个时间开始采集,'1m'表示1分钟之后,'-1m'表示1分钟之前,支持m(分钟),h(小时),d(天),空则从当前时间开始采集
- 文件分隔符:支持竖线(|), 逗号(,),分好(;)
- 源数据字段:分隔符切分后的字段

## 路径配置
```
/data/inlong-agent/test.log //代表读取inlong-agent文件夹下的的新增文件test.log
/data/inlong-agent/test[0-9]{1} //代表读取inlong-agent文件夹下的新增文件test后接一个数字结尾
/data/inlong-agent/test //如果test为目录,则代表读取test下的所有新增文件
/data/inlong-agent/^\\d+(\\.\\d+)? // 以一个或多个数字开头,之后可以是.或者一个.或多个数字结尾,?代表可选,可以匹配的实例:"5", "1.5" 和 "2.21"
```

## 数据时间
Agent支持从文件名称中获取时间当作数据的生产时间,配置说明如下:
```
/data/inlong-agent/***YYYYMMDDHH***
```

其中YYYYDDMMHH代表数据时间,YYYY表示年,MM表示月份,DD表示天,HH表示小时
其中***为任意字符

同时需要在job conf中加入当前数据的周期,当前支持天周期以及小时周期,
在添加任务时,加入属性 job.cycleUnit。job.cycleUnit 包含如下两种类型:
- D : 代表数据时间天维度
- H : 代表数据时间小时维度

例如:
配置数据源为
```
/data/inlong-agent/2021020211.log
```
写入数据到 2021020211.log
配置 job.cycleUnit 为 D
则agent会在2021020211时间尝试2021020211.log文件,读取文件中的数据时,会将所有数据以20210202这个时间写入到后端proxy
如果配置 job.cycleUnit 为 H
则采集2021020211.log文件中的数据时,会将所有数据以2021020211这个时间写入到后端proxy。
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
title: Kafka
sidebar_position: 4
---
## 概述

`Kafka Extract` 节点 支持从 Kafka topics 中读取数据。它支持以普通的方式读取数据和 Upsert 的方式读取数据。`upsert-kafka` 连接器生产 `changelog` 流,
其中每条数据记录代表一个更新或删除事件。`kafka-inlong` 连接器可以以普通方式读取数据和元数据信息。

## 支持的版本

| Extract 节点 | Kafka 版本 |
|-----------------------------|-----------|
| [Kafka](./kafka.md) | 0.10+ |

## 依赖

为了设置 Kafka Extract 节点, 下面提供了使用构建自动化工具(例如 Maven 或 SBT)和带有 Sort Connector JAR 包的 SQL 客户端的两个项目的依赖关系信息。

### Maven 依赖

```xml
<dependency>
<groupId>org.apache.inlong</groupId>
<artifactId>sort-connector-kafka</artifactId>
<!-- 选择适合你的 Application 的版本 -->
<version>inlong_version</version>
</dependency>
```

## 如何创建 Kafka Extract 节点

### SQL API 用法

下面这个例子展示了如何用 `Flink SQL` 创建一个 Kafka Extract 节点:
* 连接器是 `kafka-inlong`
```sql
-- 设置 Checkpoint 为 3000 毫秒
Flink SQL> SET 'execution.checkpointing.interval' = '3s';

-- 使用 Flink SQL 创建 Kafka 表 'kafka_extract_node'
Flink SQL> CREATE TABLE kafka_extract_node (
`id` INT,
`name` STRINTG
) WITH (
'connector' = 'kafka-inlong',
'topic' = 'user',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'earliest-offset',
'format' = 'csv'
)

-- 读取数据
Flink SQL> SELECT * FROM kafka_extract_node;
```
* 连接器是 `upsert-kafka`
```sql
-- 设置 Checkpoint 为 3000 毫秒
Flink SQL> SET 'execution.checkpointing.interval' = '3s';

-- 使用 Flink SQL 创建 Kafka 表 'kafka_extract_node'
Flink SQL> CREATE TABLE kafka_extract_node (
`id` INT,
`name` STRINTG,
PRIMARY KEY (`id`) NOT ENFORCED
) WITH (
'connector' = 'upsert-kafka',
'topic' = 'user',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'earliest-offset',
'key.format' = 'csv',
'value.format' = 'csv'
)

-- 读取数据
Flink SQL> SELECT * FROM kafka_extract_node;
```
### InLong Dashboard 用法

TODO: 将在未来支持此功能。

### InLong Manager Client 用法

TODO: 将在未来支持此功能。

## Kafka Extract 节点参数

| 参数 | 是否必选 | 默认值 | 数据类型 | 描述 |
|---------|----------|---------|------|------------|
| connector | 必选 | (none) | String | 指定要使用的连接器 1. Upsert Kafka 连接器使用: `upsert-kafka` 2. Kafka连接器使用: `kafka-inlong` |
| topic | 可选 | (none) | String | 当表用作 source 时读取数据的 topic 名。亦支持用分号间隔的 topic 列表,如 `topic-1;topic-2`。注意,对 source 表而言,`topic` 和 `topic-pattern` 两个选项只能使用其中一个。 |
| topic-pattern | 可选 | (none) | String | 匹配读取 topic 名称的正则表达式。在作业开始运行时,所有匹配该正则表达式的 topic 都将被 Kafka consumer 订阅。注意,对 source 表而言,`topic` 和 `topic-pattern` 两个选项只能使用其中一个。 |
| properties.bootstrap.servers | 必选 | (none) | String | 逗号分隔的 Kafka broker 列表。 |
| properties.group.id | 必选 | (none) | String | Kafka source 的消费组 id。 |
| properties.* | 可选 | (none) | String | 可以设置和传递任意 Kafka 的配置项。后缀名必须匹配在 [Kafka 配置文档](https://kafka.apache.org/documentation/#configuration) 中定义的配置键。Flink 将移除 "properties." 配置键前缀并将变换后的配置键和值传入底层的 Kafka 客户端。例如,你可以通过 'properties.allow.auto.create.topics' = 'false' 来禁用 topic 的自动创建。但是某些配置项不支持进行配置,因为 Flink 会覆盖这些配置,例如 'key.deserializer' 和 'value.deserializer'。 |
| format | 对于 Kafka 必选 | (none) | String | 用来序列化或反序列化 Kafka 消息的格式。 请参阅 [格式](https://nightlies.apache.org/flink/flink-docs-release-1.13/docs/connectors/table/formats/overview/) 页面以获取更多关于格式的细节和相关配置项。 注意:该配置项和 'value.format' 二者必需其一。 |
| key.format | 可选 | (none) | String | 用来序列化和反序列化 Kafka 消息键(Key)的格式。 请参阅 格式 页面以获取更多关于格式的细节和相关配置项。 注意:如果定义了键格式,则配置项 'key.fields' 也是必需的。 否则 Kafka 记录将使用空值作为键。 |
| key.fields | 可选 | [] | `List<String>` | 表结构中用来配置消息键(Key)格式数据类型的字段列表。默认情况下该列表为空,因此消息键没有定义。 列表格式为 'field1;field2'。 |
| key.fields-prefix | 可选 | (none) | String | 为所有消息键(Key)格式字段指定自定义前缀,以避免与消息体(Value)格式字段重名。默认情况下前缀为空。 如果定义了前缀,表结构和配置项 'key.fields' 都需要使用带前缀的名称。 当构建消息键格式字段时,前缀会被移除,消息键格式将会使用无前缀的名称。 请注意该配置项要求必须将 'value.fields-include' 配置为 'EXCEPT_KEY'。 |
| value.format | 对于 Upsert Kafka 必选 | (none) | String | 用于对 Kafka 消息中 value 部分序列化和反序列化的格式。支持的格式包括 'csv'、'json'、'avro'。请参考[格式](https://nightlies.apache.org/flink/flink-docs-release-1.13/zh/docs/connectors/table/formats/overview/)页面以获取更多详细信息和格式参数。 |
| value.fields-include | 可选 | ALL | String | 控制哪些字段应该出现在 value 中。可取值:<br/> ALL:消息的 value 部分将包含 schema 中所有的字段,包括定义为主键的字段。<br/> EXCEPT_KEY:记录的 value 部分包含 schema 的所有字段,定义为主键的字段除外。 |
| scan.startup.mode | 可选 | group-offsets | String | Kafka consumer 的启动模式。有效值为:'earliest-offset','latest-offset','group-offsets','timestamp' 和 'specific-offsets'。 请参阅下方 起始消费位点 以获取更多细节。 |
| scan.startup.specific-offsets | 可选 | (none) | String | 在使用 'specific-offsets' 启动模式时为每个 partition 指定 offset,例如 'partition:0,offset:42;partition:1,offset:300'。 |
| scan.startup.timestamp-millis | 可选 | (none) | Long | 在使用 'timestamp' 启动模式时指定启动的时间戳(单位毫秒)。 |
| scan.topic-partition-discovery.interval | 可选 | (none) | Duration | Consumer 定期探测动态创建的 Kafka topic 和 partition 的时间间隔。 |

## 可用的元数据字段

以下格式元数据可以作为表定义中的只读 (VIRTUAL) 列公开。 它支持读取格式 `canal-json-inlong` 的元数据。

| 字段名称 | 数据类型 | 描述 |
|-----|------------|-------------|
| value.table_name | STRING | 包含该行的表的名称 |
| value.database_name | STRING | 包含该行的数据库的名称 |
| value.op_ts| TIMESTAMP(3) | 它指示在数据库中进行更改的时间。 如果记录是从表的快照而不是binlog中读取的,则该值始终为0 |
| value.op_type| STRING | 操作类型, INSERT/UPDATE/DELETE |
| value.batch_id| BIGINT | 不重要的, 一个简单的自增器 |
| value.is_ddl| BOOLEAN | 不下发 DDL, 值是 false |
| value.update_before| `ARRAY<MAP<STRING, STRING>>` | UPDATE 记录的 update-before 数据 |
| value.mysql_type | MAP<STRING, STRING> | MySQL 字段类型 |
| value.pk_names | `ARRAY<STRING>` | 主键 |
| value.sql_type | MAP<STRING, INT> | SQL 字段类型 |
| value.ts | TIMESTAMP_LTZ(3) | ts_ms 字段用于存储有关连接器处理/生成事件的本地时间的信息 |

扩展的 CREATE TABLE 示例演示了使用这些元数据字段的语法:

```sql
CREATE TABLE `kafka_extract_node` (
`id` INT,
`name` STRING,
`database_name` string METADATA FROM 'value.database_name',
`table_name` string METADATA FROM 'value.table_name',
`op_ts` timestamp(3) METADATA FROM 'value.op_ts',
`op_type` string METADATA FROM 'value.op_type',
`batch_id` bigint METADATA FROM 'value.batch_id',
`is_ddl` boolean METADATA FROM 'value.is_ddl',
`update_before` ARRAY<MAP<STRING, STRING>> METADATA FROM 'value.update_before',
`mysql_type` MAP<STRING, STRING> METADATA FROM 'value.mysql_type',
`pk_names` ARRAY<STRING> METADATA FROM 'value.pk_names',
`data` STRING METADATA FROM 'value.data',
`sql_type` MAP<STRING, INT> METADATA FROM 'value.sql_type',
`ingestion_ts` TIMESTAMP(3) METADATA FROM 'value.ts',
) WITH (
'connector' = 'kafka-inlong',
'topic' = 'user',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'earliest-offset',
'format' = 'canal-json-inlong'
)
```

## 数据类型映射

Kafka 将消息键值以二进制进行存储,因此 Kafka 并不存在 schema 或数据类型。Kafka 消息使用格式配置进行序列化和反序列化,例如 csv,json,avro。 因此,数据类型映射取决于使用的格式。请参阅 [格式](https://nightlies.apache.org/flink/flink-docs-release-1.13/zh/docs/connectors/table/formats/overview/) 页面以获取更多细节。
Loading