This is an automated email from the ASF dual-hosted git repository. diwu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 3692c10654 [doc](flink-connector) add pg and sqlserver database sync (#23427) 3692c10654 is described below commit 3692c10654394b8c461e911180d3b1965c2520e9 Author: wudi <676366...@qq.com> AuthorDate: Fri Aug 25 15:30:59 2023 +0800 [doc](flink-connector) add pg and sqlserver database sync (#23427) --- docs/en/docs/ecosystem/flink-doris-connector.md | 54 +++++++++++++++++++++- docs/zh-CN/docs/ecosystem/flink-doris-connector.md | 54 +++++++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/ecosystem/flink-doris-connector.md b/docs/en/docs/ecosystem/flink-doris-connector.md index b8f385469d..5b7620c659 100644 --- a/docs/en/docs/ecosystem/flink-doris-connector.md +++ b/docs/en/docs/ecosystem/flink-doris-connector.md @@ -416,7 +416,7 @@ insert into doris_sink select id,name from cdc_mysql_source; <FLINK_HOME>/bin/flink run \ -c org.apache.doris.flink.tools.cdc.CdcTools \ lib/flink-doris-connector-1.16-1.4.0-SNAPSHOT.jar\ - <mysql-sync-database|oracle-sync-database> \ + <mysql-sync-database|oracle-sync-database|postgres-sync-database|sqlserver-sync-database> \ --database <doris-database-name> \ [--job-name <flink-job-name>] \ [--table-prefix <doris-table-prefix>] \ @@ -490,6 +490,58 @@ insert into doris_sink select id,name from cdc_mysql_source; --table-conf replication_num=1 ``` +### PostgreSQL synchronization example + +```shell +<FLINK_HOME>/bin/flink run \ + -Dexecution.checkpointing.interval=10s \ + -Dparallelism.default=1\ + -c org.apache.doris.flink.tools.cdc.CdcTools \ + ./lib/flink-doris-connector-1.16-1.5.0-SNAPSHOT.jar \ + postgres-sync-database \ + --database db1\ + --postgres-conf hostname=127.0.0.1 \ + --postgres-conf port=5432 \ + --postgres-conf username=postgres \ + --postgres-conf password="123456" \ + --postgres-conf database-name=postgres \ + --postgres-conf schema-name=public \ + --postgres-conf slot.name=test \ + --postgres-conf decoding.plugin.name=pgoutput \ + --including-tables "tbl1|tbl2" \ + --sink-conf fenodes=127.0.0.1:8030 \ + --sink-conf username=root \ + --sink-conf password=\ + --sink-conf jdbc-url=jdbc:mysql://127.0.0.1:9030 \ + --sink-conf sink.label-prefix=label \ + --table-conf replication_num=1 +``` + +### SQLServer synchronization example + +```shell +<FLINK_HOME>/bin/flink run \ + -Dexecution.checkpointing.interval=10s \ + -Dparallelism.default=1 \ + -c org.apache.doris.flink.tools.cdc.CdcTools \ + ./lib/flink-doris-connector-1.16-1.5.0-SNAPSHOT.jar \ + sqlserver-sync-database \ + --database db1\ + --sqlserver-conf hostname=127.0.0.1 \ + --sqlserver-conf port=1433 \ + --sqlserver-conf username=sa \ + --sqlserver-conf password="123456" \ + --sqlserver-conf database-name=CDC_DB \ + --sqlserver-conf schema-name=dbo \ + --including-tables "tbl1|tbl2" \ + --sink-conf fenodes=127.0.0.1:8030 \ + --sink-conf username=root \ + --sink-conf password=\ + --sink-conf jdbc-url=jdbc:mysql://127.0.0.1:9030 \ + --sink-conf sink.label-prefix=label \ + --table-conf replication_num=1 +``` + ## Use FlinkCDC to update Key column Generally, in a business database, the number is used as the primary key of the table, such as the Student table, the number (id) is used as the primary key, but with the development of the business, the number corresponding to the data may change. diff --git a/docs/zh-CN/docs/ecosystem/flink-doris-connector.md b/docs/zh-CN/docs/ecosystem/flink-doris-connector.md index ad1947aaee..179234b606 100644 --- a/docs/zh-CN/docs/ecosystem/flink-doris-connector.md +++ b/docs/zh-CN/docs/ecosystem/flink-doris-connector.md @@ -418,7 +418,7 @@ insert into doris_sink select id,name from cdc_mysql_source; <FLINK_HOME>/bin/flink run \ -c org.apache.doris.flink.tools.cdc.CdcTools \ lib/flink-doris-connector-1.16-1.4.0-SNAPSHOT.jar \ - <mysql-sync-database|oracle-sync-database> \ + <mysql-sync-database|oracle-sync-database|postgres-sync-database|sqlserver-sync-database> \ --database <doris-database-name> \ [--job-name <flink-job-name>] \ [--table-prefix <doris-table-prefix>] \ @@ -491,6 +491,58 @@ insert into doris_sink select id,name from cdc_mysql_source; --table-conf replication_num=1 ``` +### PostgreSQL同步示例 + +```shell +<FLINK_HOME>/bin/flink run \ + -Dexecution.checkpointing.interval=10s \ + -Dparallelism.default=1\ + -c org.apache.doris.flink.tools.cdc.CdcTools \ + ./lib/flink-doris-connector-1.16-1.5.0-SNAPSHOT.jar \ + postgres-sync-database \ + --database db1\ + --postgres-conf hostname=127.0.0.1 \ + --postgres-conf port=5432 \ + --postgres-conf username=postgres \ + --postgres-conf password="123456" \ + --postgres-conf database-name=postgres \ + --postgres-conf schema-name=public \ + --postgres-conf slot.name=test \ + --postgres-conf decoding.plugin.name=pgoutput \ + --including-tables "tbl1|tbl2" \ + --sink-conf fenodes=127.0.0.1:8030 \ + --sink-conf username=root \ + --sink-conf password=\ + --sink-conf jdbc-url=jdbc:mysql://127.0.0.1:9030 \ + --sink-conf sink.label-prefix=label \ + --table-conf replication_num=1 +``` + +### SQLServer同步示例 + +```shell +<FLINK_HOME>/bin/flink run \ + -Dexecution.checkpointing.interval=10s \ + -Dparallelism.default=1 \ + -c org.apache.doris.flink.tools.cdc.CdcTools \ + ./lib/flink-doris-connector-1.16-1.5.0-SNAPSHOT.jar \ + sqlserver-sync-database \ + --database db1\ + --sqlserver-conf hostname=127.0.0.1 \ + --sqlserver-conf port=1433 \ + --sqlserver-conf username=sa \ + --sqlserver-conf password="123456" \ + --sqlserver-conf database-name=CDC_DB \ + --sqlserver-conf schema-name=dbo \ + --including-tables "tbl1|tbl2" \ + --sink-conf fenodes=127.0.0.1:8030 \ + --sink-conf username=root \ + --sink-conf password=\ + --sink-conf jdbc-url=jdbc:mysql://127.0.0.1:9030 \ + --sink-conf sink.label-prefix=label \ + --table-conf replication_num=1 +``` + ## 使用FlinkCDC更新Key列 一般在业务数据库中,会使用编号来作为表的主键,比如Student表,会使用编号(id)来作为主键,但是随着业务的发展,数据对应的编号有可能是会发生变化的。 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org