-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INLONG-1086][Doc] Add documents for DolphinScheduler offline schedul…
…er (#1088)
- Loading branch information
Showing
53 changed files
with
253 additions
and
44 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
docs/quick_start/offline_data_sync/dolphinscheduler_example.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
title: Use DolphinScheduler third-party scheduling engine | ||
sidebar_position: 2 | ||
--- | ||
|
||
In the following content, we will introduce how to use DolphinScheduler, a third-party schedule engine in Apache InLong to create offline data synchronization. | ||
|
||
## Deployment | ||
|
||
### Install InLong | ||
|
||
Before we begin, we need to install InLong and a usable DolphinScheduler. 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 version, and after decompression, place `sort-connector-jdbc-[version]-SNAPSHOT.jar` in `/inlong-sort/connectors/` directory. | ||
|
||
> Currently, Apache InLong's offline data synchronization capability only supports Flink-1.18, so please download the 1.18 version of connectors. | ||
### Operations on DolphinScheduler | ||
|
||
Before using DolphinScheduler as your scheduling engine, please make sure you have a working DolphinScheduler on hand. If you need to deploy a DolphinScheduler for yourself, please refer to the [DolphinScheduler Official Document](https://dolphinscheduler.apache.org/zh-cn). | ||
|
||
![DolphinScheduler Security](img/pulsar_mysql/dolphinscheduler/ds_security.png) | ||
|
||
![DolphinScheduler Token Manager](img/pulsar_mysql/dolphinscheduler/ds_token_manager.png) | ||
|
||
Go into Token Manager page to create a token for InLong to access. | ||
|
||
![DolphinScheduler Token Generate](img/pulsar_mysql/dolphinscheduler/ds_token_generate.png) | ||
|
||
Set parameters for the token according to the steps in the figure, include [Expiration Time], [User], then generate a token. | ||
|
||
![DolphinScheduler Token Copy](img/pulsar_mysql/dolphinscheduler/ds_token_copy.png) | ||
|
||
### Modify configuration in InLong Manager | ||
|
||
For third-party scheduling engine, we need to modify configurations in manager. | ||
|
||
For DolphinScheduler engine there are following configurations need to be modified: | ||
|
||
* `schedule.engine.inlong.manager.url` : Third-party scheduling engine needs to access the inlong manager through this url. | ||
* `schedule.engine.dolphinscheduler.url` : DolphinScheduler deployment url, general format is http://{ip}:{port}/dolphinscheduler | ||
* `schedule.engine.dolphinscheduler.token` : Token you just generated in Token Manager of DolphinScheduler. | ||
|
||
![InLong Manager Configuration](img/pulsar_mysql/dolphinscheduler/inlong_manager_conf.png) | ||
|
||
After doing this, restart the InLong Manager to ensure the configuration is enabled. | ||
|
||
### Use DolphinScheduler in offline synchronization | ||
|
||
During configure the offline synchronization task, choose DolphinScheduler when selecting the scheduling engine, then configure other parameters. | ||
|
||
![DolphinScheduler Task Configuration](img/pulsar_mysql/dolphinscheduler/ds_task_conf.png) | ||
|
||
For details about how to manage clusters and configure data nodes, see [Use Quartz built-in scheduling engine](quartz_example.md). | ||
|
||
After approval data flow, return to the [Synchronization] page and wait for the task configuration to succeed. Once configured successfully, the DolphinScheduler will periodically calls back InLong to synchronize offline data and the Manager will periodically submit Flink Batch Jobs to the Flink cluster. | ||
|
||
![DolphinScheduler Schedule Process](img/pulsar_mysql/dolphinscheduler/ds_schedule_process.png) | ||
|
||
![DolphinScheduler Process Success](img/pulsar_mysql/dolphinscheduler/ds_process_success.png) | ||
|
||
![DolphinScheduler Process Instance](img/pulsar_mysql/dolphinscheduler/ds_process_instance.png) | ||
|
||
View the DolphinScheduler task instance logs. The following logs indicate that the configuration is successful. | ||
|
||
![DolphinScheduler Schedule Success](img/pulsar_mysql/dolphinscheduler/ds_schedule_success.png) | ||
|
||
## Test Data | ||
|
||
### Sending Data | ||
|
||
Use the Pulsar SDK to produce data into the Pulsar topic. An example is as follows: | ||
|
||
```java | ||
// Create Pulsar client and producer | ||
PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build(); | ||
Producer<byte[]> producer = pulsarClient.newProducer().topic("public/default/test").create(); | ||
|
||
// Send messages | ||
for (int i = 0; i < 10000; i++) { | ||
// Field separator is | | ||
String msgStr = i + "|msg-" + i; | ||
MessageId msgId = producer.send(msgStr.getBytes(StandardCharsets.UTF_8)); | ||
System.out.println("Send msg : " + msgStr + " with msgId: " + msgId); | ||
} | ||
``` | ||
|
||
### Data Validation | ||
|
||
Then enter MySQL to check the data in the table: | ||
|
||
![MySQL Result](img/pulsar_mysql/dolphinscheduler/mysql_result.png) |
Binary file added
BIN
+431 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_process_instance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+373 KB
...tart/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_process_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+245 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_schedule_process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+252 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_schedule_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+361 KB
...quick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_security.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67.9 KB
...uick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_task_conf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+127 KB
...ick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+112 KB
...start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_generate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+254 KB
..._start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+81.1 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/inlong_manager_conf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.2 KB
...uick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/mysql_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+38.2 KB
.../quick_start/offline_data_sync/img/pulsar_mysql/quartz/schedule_engine_type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...nt-docs/version-2.0.0/quick_start/offline_data_sync/dolphinscheduler_example.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
title: 使用第三方 DolphinScheduler 调度引擎 | ||
sidebar_position: 2 | ||
--- | ||
|
||
在接下来的内容中,我们将介绍如何在 Apache InLong 中集成第三方调度引擎 DolphinScheduler 来创建离线数据同步。 | ||
|
||
## 环境部署 | ||
|
||
### 安装 InLong | ||
|
||
在开始之前,我们需要安装 InLong 的全部组件,这里提供两种方式: | ||
|
||
- [Docker 部署](deployment/docker.md)(推荐) | ||
- [Bare Metal 部署](deployment/bare_metal.md) | ||
|
||
### 添加 Connectors | ||
|
||
下载与 Flink 版本对应的 [connectors](https://inlong.apache.org/zh-CN/downloads),解压后将 `sort-connector-jdbc-[version]-SNAPSHOT.jar` 放在 `/inlong-sort/connectors/` 目录下。 | ||
> 当前 Apache InLong 的离线数据同步能力只支持 Flink-1.18 版本,所以请下载 1.18 版本的 connectors。 | ||
### 在 DolphinScheduler 上的操作 | ||
|
||
在使用 DolphinScheduler 作为调度引擎之前,请确保有可以提供服务的 DolphinScheduler 。如果您需要为自己部署一个 DolphinScheduler,请参考 [DolphinScheduler 官方文档](https://dolphinscheduler.apache.org/zh-cn)。 | ||
|
||
![DolphinScheduler Security](img/pulsar_mysql/dolphinscheduler/ds_security.png) | ||
|
||
![DolphinScheduler Token Manager](img/pulsar_mysql/dolphinscheduler/ds_token_manager.png) | ||
|
||
进入令牌管理器页面创建一个令牌供 InLong 进行访问。 | ||
|
||
![DolphinScheduler Token Generate](img/pulsar_mysql/dolphinscheduler/ds_token_generate.png) | ||
|
||
按照图中步骤设置 token 参数,包括 [过期时间]、[用户],并生成令牌。 | ||
|
||
![DolphinScheduler Token Copy](img/pulsar_mysql/dolphinscheduler/ds_token_copy.png) | ||
|
||
### 修改 InLong Manager 中的配置 | ||
|
||
对于第三方调度引擎,我们需要在 InLong Manager 中修改配置。 | ||
|
||
对于 DolphinScheduler 引擎,需要修改以下配置: | ||
|
||
* `schedule.engine.inlong.manager.url` : 第三方调度引擎需要通过该 url 访问 InLong Manager。 | ||
* `schedule.engine.dolphinscheduler.url` : DolphinScheduler 部署的 url,一般格式为 http://{ip}:{port}/dolphinScheduler | ||
* `schedule.engine.dolphinscheduler.token` : 上文中在 DolphinScheduler 令牌管理器页面中生成的 Token。 | ||
|
||
![InLong Manager Configuration](img/pulsar_mysql/dolphinscheduler/inlong_manager_conf.png) | ||
|
||
完成这些操作后,重新启动 InLong Manager 以确保配置成功启用。 | ||
|
||
### 在离线同步任务中使用 DolphinScheduler | ||
|
||
在配置离线同步任务时,在选择调度引擎时选择 DolphinScheduler,然后配置其他参数。 | ||
|
||
![DolphinScheduler Task Configuration](img/pulsar_mysql/dolphinscheduler/ds_task_conf.png) | ||
|
||
集群管理和相关数据节点的配置请参见[使用内置的 Quartz 调度引擎](quartz_example.md)。 | ||
|
||
审批数据流后,返回【数据同步】页面,等待任务配置成功,配置成功后,DolphinScheduler 将定期回调 InLong Manager,并由 InLong Manager 周期提交 Flink Batch Job 到 Flink 集群。 | ||
|
||
![DolphinScheduler Schedule Process](img/pulsar_mysql/dolphinscheduler/ds_schedule_process.png) | ||
|
||
![DolphinScheduler Process Success](img/pulsar_mysql/dolphinscheduler/ds_process_success.png) | ||
|
||
![DolphinScheduler Process Instance](img/pulsar_mysql/dolphinscheduler/ds_process_instance.png) | ||
|
||
查看 DolphinScheduler 任务实例日志,输出如下日志表示配置成功。 | ||
|
||
![DolphinScheduler Schedule Success](img/pulsar_mysql/dolphinscheduler/ds_schedule_success.png) | ||
|
||
## 测试数据 | ||
|
||
### 发送数据 | ||
|
||
通过 Pulsar SDK 生产数据写入的 Pulsar topic 中,示例如下: | ||
|
||
```java | ||
// Create Pulsar client and producer | ||
PulsarClient pulsarClient = PulsarClient.builder().serviceUrl("pulsar://localhost:6650").build(); | ||
Producer<byte[]> producer = pulsarClient.newProducer().topic("public/default/test").create(); | ||
|
||
// Send messages | ||
for (int i = 0; i < 10000; i++) { | ||
// Field separator is | | ||
String msgStr = i + "|msg-" + i; | ||
MessageId msgId = producer.send(msgStr.getBytes(StandardCharsets.UTF_8)); | ||
System.out.println("Send msg : " + msgStr + " with msgId: " + msgId); | ||
} | ||
``` | ||
|
||
### 数据验证 | ||
|
||
然后进入 Mysql,查看库表数据,可以看到数据已经同步到 MySQL 中。 | ||
|
||
![MySQL Result](img/pulsar_mysql/dolphinscheduler/mysql_result.png) |
Binary file added
BIN
+431 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_process_instance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+322 KB
...tart/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_process_success.png
Oops, something went wrong.
Binary file added
BIN
+196 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_schedule_process.png
Oops, something went wrong.
Binary file added
BIN
+401 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_schedule_success.png
Oops, something went wrong.
Binary file added
BIN
+293 KB
...quick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_security.png
Oops, something went wrong.
Binary file added
BIN
+65.1 KB
...uick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_task_conf.png
Oops, something went wrong.
Binary file added
BIN
+131 KB
...ick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_copy.png
Oops, something went wrong.
Binary file added
BIN
+97.5 KB
...start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_generate.png
Oops, something went wrong.
Binary file added
BIN
+256 KB
..._start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/ds_token_manager.png
Oops, something went wrong.
Binary file added
BIN
+81.1 KB
...art/offline_data_sync/img/pulsar_mysql/dolphinscheduler/inlong_manager_conf.png
Oops, something went wrong.
Binary file added
BIN
+32.2 KB
...uick_start/offline_data_sync/img/pulsar_mysql/dolphinscheduler/mysql_result.png
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+29.2 KB
.../quick_start/offline_data_sync/img/pulsar_mysql/quartz/schedule_engine_type.png
Oops, something went wrong.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.