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/inlong-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 192b2c07c5 [INLONG-902][Doc] Add MySQL to ClickHouse example document 
for data sync (#903)
192b2c07c5 is described below

commit 192b2c07c54382caf9d48078a334b006543eda49
Author: haifxu <[email protected]>
AuthorDate: Wed Dec 20 10:17:49 2023 +0800

    [INLONG-902][Doc] Add MySQL to ClickHouse example document for data sync 
(#903)
---
 .../data_sync/img/mysql_clickhouse/approve.png     | Bin 0 -> 23656 bytes
 .../data_sync/img/mysql_clickhouse/audit.png       | Bin 0 -> 54862 bytes
 .../img/mysql_clickhouse/clickhouse_datanode.png   | Bin 0 -> 20194 bytes
 .../data_sync/img/mysql_clickhouse/cluster_tag.png | Bin 0 -> 28397 bytes
 .../img/mysql_clickhouse/group_stream.png          | Bin 0 -> 22784 bytes
 .../data_sync/img/mysql_clickhouse/pulsar.png      | Bin 0 -> 26969 bytes
 .../data_sync/img/mysql_clickhouse/sink.png        | Bin 0 -> 35250 bytes
 .../data_sync/img/mysql_clickhouse/sink_data.png   | Bin 0 -> 16167 bytes
 .../data_sync/img/mysql_clickhouse/sink_fields.png | Bin 0 -> 22308 bytes
 .../data_sync/img/mysql_clickhouse/source.png      | Bin 0 -> 29963 bytes
 .../data_sync/img/mysql_clickhouse/source_data.png | Bin 0 -> 7015 bytes
 .../data_sync/mysql_clickhouse_example.md          | 136 +++++++++++++++++++++
 .../data_sync/img/mysql_clickhouse/approve.png     | Bin 0 -> 24000 bytes
 .../data_sync/img/mysql_clickhouse/audit.png       | Bin 0 -> 47587 bytes
 .../img/mysql_clickhouse/clickhouse_datanode.png   | Bin 0 -> 19768 bytes
 .../data_sync/img/mysql_clickhouse/cluster_tag.png | Bin 0 -> 14019 bytes
 .../img/mysql_clickhouse/group_stream.png          | Bin 0 -> 23988 bytes
 .../data_sync/img/mysql_clickhouse/pulsar.png      | Bin 0 -> 28881 bytes
 .../data_sync/img/mysql_clickhouse/sink.png        | Bin 0 -> 21930 bytes
 .../data_sync/img/mysql_clickhouse/sink_data.png   | Bin 0 -> 16167 bytes
 .../data_sync/img/mysql_clickhouse/sink_fields.png | Bin 0 -> 21498 bytes
 .../data_sync/img/mysql_clickhouse/source.png      | Bin 0 -> 31136 bytes
 .../data_sync/img/mysql_clickhouse/source_data.png | Bin 0 -> 7015 bytes
 .../data_sync/mysql_clickhouse_example.md          | 127 +++++++++++++++++++
 24 files changed, 263 insertions(+)

diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/approve.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/approve.png
new file mode 100644
index 0000000000..c4b0697225
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/approve.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/audit.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/audit.png
new file mode 100644
index 0000000000..50a2e97d1d
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/audit.png differ
diff --git 
a/docs/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png
new file mode 100644
index 0000000000..3047553494
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png
new file mode 100644
index 0000000000..bc1fc8a16d
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/group_stream.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/group_stream.png
new file mode 100644
index 0000000000..467c55a244
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/group_stream.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/pulsar.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/pulsar.png
new file mode 100644
index 0000000000..eb725498e7
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/pulsar.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/sink.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink.png
new file mode 100644
index 0000000000..468e72b352
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/sink_data.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink_data.png
new file mode 100644
index 0000000000..a5d2db1a31
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink_data.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png
new file mode 100644
index 0000000000..c80e5e2772
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/source.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/source.png
new file mode 100644
index 0000000000..615b2ac6ee
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/source.png differ
diff --git a/docs/quick_start/data_sync/img/mysql_clickhouse/source_data.png 
b/docs/quick_start/data_sync/img/mysql_clickhouse/source_data.png
new file mode 100644
index 0000000000..d2c1aef169
Binary files /dev/null and 
b/docs/quick_start/data_sync/img/mysql_clickhouse/source_data.png differ
diff --git a/docs/quick_start/data_sync/mysql_clickhouse_example.md 
b/docs/quick_start/data_sync/mysql_clickhouse_example.md
new file mode 100644
index 0000000000..9f337849b1
--- /dev/null
+++ b/docs/quick_start/data_sync/mysql_clickhouse_example.md
@@ -0,0 +1,136 @@
+---
+title: MySQL to ClickHouse Example
+sidebar_position: 1
+---
+
+Here we use an example to introduce how to use Apache InLong creating `MySQL 
-> ClickHouse` data synchronization.
+
+## Deployment
+### Install InLong
+
+Before we begin, we need to install InLong. Here we provide two ways:
+- [Docker Deployment](deployment/docker.md) (Recommended)
+- [Bare Metal Deployment](deployment/bare_metal.md)
+
+### Add Connectors
+
+Download the [connectors](https://inlong.apache.org/downloads/) corresponding 
to Flink 1.13, and after decompression, place 
`sort-connector-jdbc-[version]-SNAPSHOT.jar` in `/inlong-sort/connectors/` 
directory.
+
+### Install ClickHouse
+```shell
+docker run -d --rm --net=host --name clickhouse -e CLICKHOUSE_USER=admin -e 
CLICKHOUSE_PASSWORD=inlong -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 
clickhouse/clickhouse-server:22.8
+```
+
+## Cluster Initialize
+When all containers are successfully started, you can access the InLong 
dashboard address http://localhost, and use the following default account to 
log in.
+```
+User: admin
+Password: inlong
+```
+
+### Create Cluster Tag
+Click [Clusters] -> [ClusterTags] -> [Create] on the page to specify the 
cluster label name and person in charge.
+
+![Create Cluster Tag](img/mysql_clickhouse/cluster_tag.png)
+
+:::caution
+`default_cluster` is the default ClusterTags reported by each component. If 
you decide to use a different name, make sure to update the corresponding tag 
configuration accordingly.
+:::
+
+### Register Pulsar Cluster
+Click [Clusters] -> [Cluster] -> [Create] on the page to register Pulsar 
Cluster.
+
+![Create Pulsar](img/mysql_clickhouse/pulsar.png)
+
+:::note
+The ClusterTags selects the newly created `default_cluster`, the Pulsar 
cluster deployed by docker:
+
+Service URL is `pulsar://pulsar:6650`, Admin URL is `http://pulsar:8080`.
+:::
+
+### Register ClickHouse DataNodes
+
+Click [DataNodes] -> [Create] on the page to register ClickHouse DataNodes.
+
+![Create Clickhouse Datanode](img/mysql_clickhouse/clickhouse_datanode.png)
+
+## Create Task
+### Create Data Streams Group
+
+Click [Synchronization] → [Create] on the page and input the Group ID and 
Steam ID:
+
+![Create Group_Stream](img/mysql_clickhouse/group_stream.png)
+
+### Create Data Source
+In the data source, click [New] → [MySQL] to configure the source name, 
address, databases and tables information.
+
+![Create Source](img/mysql_clickhouse/source.png)
+
+:::note
+- Please create the test.source_table database table in advance, the schema 
is: CREATE TABLE test.source_table (id INT PRIMARY KEY, name VARCHAR(50));
+:::
+
+### Create Data Sink
+
+In the data target, click [New] → [ClickHouse] to configure the name, DB name, 
table name, and created ck data node.
+
+![Create Sink](img/mysql_clickhouse/sink.png)
+
+### Configuration Fields
+
+Configure fields mapping in [Source Field] and [Target Field] respectively, 
and click [Submit] after completion.
+
+![Create Fields](img/mysql_clickhouse/sink_fields.png)
+
+### Approve Data Stream
+
+Click [Approval] -> [MyApproval] -> [Approval] -> [Ok].
+
+![Approve](img/mysql_clickhouse/approve.png)
+
+Back to [Synchronization] page, wait for [success].
+
+## Test Data
+### Send Data
+
+```shell
+#!/bin/bash
+
+# MySQL info
+DB_HOST="mysql"
+DB_USER="root"
+DB_PASS="inlong"
+DB_NAME="test"
+DB_TABLE="source_table"
+
+# Insert data in a loop
+for ((i=1; i<=1000; i++))
+do
+# Generate data
+id=$i
+name="name_$i"
+
+    # Build an insert SQL
+    query="INSERT INTO $DB_TABLE (id, name) VALUES ($id, '$name');"
+
+    # Execute insert SQL
+    mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME -e "$query"
+done
+```
+
+Insert 1000 pieces of data in total:
+
+![Source_data](img/mysql_clickhouse/source_data.png)
+
+### Verify Data
+
+Then enter the ClickHouse container and view the source table data:
+
+![Source_data](img/mysql_clickhouse/sink_data.png)
+
+You can also view audit data on the page:
+
+![Source_data](img/mysql_clickhouse/audit.png)
+
+## FAQ
+ClickHouse fails to write data, you can view the error on the Flink page and 
check the permissions of the user and table engine used.
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/approve.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/approve.png
new file mode 100644
index 0000000000..c1376e2f27
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/approve.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/audit.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/audit.png
new file mode 100644
index 0000000000..f34ed0e4ca
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/audit.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png
new file mode 100644
index 0000000000..34dc55c978
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/clickhouse_datanode.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png
new file mode 100644
index 0000000000..aa4b45fdc8
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/cluster_tag.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/group_stream.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/group_stream.png
new file mode 100644
index 0000000000..c0abc716d4
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/group_stream.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/pulsar.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/pulsar.png
new file mode 100644
index 0000000000..fb75c178aa
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/pulsar.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink.png
new file mode 100644
index 0000000000..0813cd9f7c
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_data.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_data.png
new file mode 100644
index 0000000000..a5d2db1a31
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_data.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png
new file mode 100644
index 0000000000..0e7f69daec
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/sink_fields.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source.png
new file mode 100644
index 0000000000..659f1c60a5
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source_data.png
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source_data.png
new file mode 100644
index 0000000000..d2c1aef169
Binary files /dev/null and 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/img/mysql_clickhouse/source_data.png
 differ
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/mysql_clickhouse_example.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/mysql_clickhouse_example.md
new file mode 100644
index 0000000000..4c3f88145d
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/quick_start/data_sync/mysql_clickhouse_example.md
@@ -0,0 +1,127 @@
+---
+title: MySQL 到 ClickHouse 示例
+sidebar_position: 1
+---
+
+在下面的内容中,我们将通过一个完整的示例介绍如何使用 Apache InLong 创建 MySQL -> ClickHouse 数据同步。
+
+## 环境部署
+### 安装 InLong
+
+在开始之前,我们需要安装 InLong 的全部组件,这里提供两种方式:
+- [Docker 部署](deployment/docker.md)(推荐)
+- [Bare Metal 部署](deployment/bare_metal.md)
+
+### 添加 Connectors
+
+下载 Flink 1.13 对应版本的 
[connectors](https://inlong.apache.org/zh-CN/downloads),解压后将 
`sort-connector-jdbc-[version]-SNAPSHOT.jar` 放在 `/inlong-sort/connectors/` 目录下。
+
+### 安装 ClickHouse
+```shell
+docker run -d --rm --net=host --name clickhouse -e CLICKHOUSE_USER=admin -e 
CLICKHOUSE_PASSWORD=inlong -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 
clickhouse/clickhouse-server:22.8
+```
+
+## 集群初始化
+当所有容器都成功启动后,可以访问 InLong Dashboard 地址 http://localhost,并使用以下默认账号登录:
+```
+User: admin
+Password: inlong
+```
+### 创建集群标签
+页面点击 【集群管理】→【标签管理】→【新建】
+
+![Create Cluster Tag](img/mysql_clickhouse/cluster_tag.png)
+
+**注意:default_cluster 是各个组件默认上报集群标签,如果使用其它名称,确认对应标签配置已修改。**
+
+### 注册 Pulsar 集群
+
+![Create Pulsar](img/mysql_clickhouse/pulsar.png)
+
+**可以参考截图信息填写内部,包括集群名称、所属标签、Pulsar 集群地址等。**
+
+### 注册 ClickHouse 数据节点
+
+页面点击 【数据节点】→【新建】,新增 ClickHouse 数据节点:
+
+![Create Clickhouse Datanode](img/mysql_clickhouse/clickhouse_datanode.png)
+
+## 任务创建
+### 新建数据流组
+
+页面点击【数据同步】→【新建数据同步】,填写 数据流组 ID 和 SteamID:
+
+![Create Group_Stream](img/mysql_clickhouse/group_stream.png)
+
+### 新建数据源
+
+数据来源中 点击 【新建】→【MySQL】,配置数据源名称、地址、用户密码以及库表(test.source_table)信息等。
+
+![Create Source](img/mysql_clickhouse/source.png)
+
+注:请预先创建 test.source_table 库表,schema 为: CREATE TABLE test.source_table ( id INT 
PRIMARY KEY, name VARCHAR(50) );
+
+### 新建数据目标
+
+数据目标中 点击 【新建】→【ClickHouse】,配置名称、库表、已创建的 ck 数据节点。数据同步不支持自动创建数据目标表,所以需要手动创建。
+
+![Create Sink](img/mysql_clickhouse/sink.png)
+
+### 配置字段信息
+
+分别在 【源字段】 和 【目标字段】中配置 Schema 映射信息,完成后点击 【提交审批】
+
+![Create Fields](img/mysql_clickhouse/sink_fields.png)
+
+### 审批数据流
+
+页面点击【审批管理】->【我的审批】->【详情】->【通过】
+
+![Approve](img/mysql_clickhouse/approve.png)
+
+返回 【数据同步】页面,等待任务配置成功
+
+## 测试数据
+### 发送数据
+
+```shell
+#!/bin/bash
+
+# MySQL数据库连接信息
+DB_HOST="mysql"
+DB_USER="root"
+DB_PASS="inlong"
+DB_NAME="test"
+DB_TABLE="source_table"
+
+# 循环插入数据
+for ((i=1; i<=1000; i++))
+do
+# 生成要插入的数据
+id=$i
+name="name_$i"
+
+    # 构建插入语句
+    query="INSERT INTO $DB_TABLE (id, name) VALUES ($id, '$name');"
+
+    # 执行插入语句
+    mysql -h $DB_HOST -u $DB_USER -p$DB_PASS $DB_NAME -e "$query"
+done
+```
+
+累计插入 1000 条数据:
+
+![Source_data](img/mysql_clickhouse/source_data.png)
+
+### 数据验证
+
+然后进入 ClickHouse 容器,查看库表数据:
+
+![Source_data](img/mysql_clickhouse/sink_data.png)
+
+也可以在页面查看审计数据:
+
+![Source_data](img/mysql_clickhouse/audit.png)
+
+## 常见问题
+ClickHouse 写入数据失败,可以在 Flink 页面查看报错,并检查所使用的用户的权限以及表引擎
\ No newline at end of file

Reply via email to