下面是同步整个数据库的示例文件mysql-to-doris.yaml:
################################################################################
# Description: Sync MySQL all tables to Doris
################################################################################
source:
type: mysql
hostname: localhost
port: 3306
username: root
password: 123456
tables: app_db.\.*
server-id: 5400-5404
server-time-zone: UTC
sink:
type: doris
fenodes: 127.0.0.1:8030
username: root
password: ""
pipeline:
name: Sync MySQL Database to Doris
parallelism: 2
需要根据自己的需求修改配置文件。最后使用Cli将作业提交到Flink Standalone集群。
cd /path/flink-cdc-*
./bin/flink-cdc.sh mysql-to-doris.yaml
提交成功后返回信息如下:
Pipeline has been submitted to cluster.
Job ID: ae30f4580f1918bebf16752d4963dc54
Job Description: Sync MySQL Database to Doris
然后你就可以通过 Flink Web UI 找到正在运行的名为 Sync MySQL Database to Doris 的作业。