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

[FEATURE][TOOLS-CDC]:add flink Command line support #104

Closed
wants to merge 3 commits into from

Conversation

xxsc0529
Copy link
Contributor

Summary

When synchronizing data to OceanBase, the flink CLI is supported. close #101

Solution Description

Define program entries, receive parameters, and parse them. Use Oceanbase Catalog to obtain the information required by Flink and create the corresponding sink。Here's how it works.
`CREATE TABLE test_history (
itemid BIGINT NOT NULL,
clock INT DEFAULT 0 NOT NULL,
value DOUBLE PRECISION DEFAULT 0.0000 NOT NULL,
ns INT DEFAULT 0 NOT NULL,
PRIMARY KEY (itemid, clock, ns)
) ;

CREATE TABLE test_history_uint (
itemid BIGINT NOT NULL,
clock INT DEFAULT 0 NOT NULL,
value DECIMAL(20,0) DEFAULT 0 NOT NULL,
ns INT DEFAULT 0 NOT NULL,
PRIMARY KEY (itemid, clock, ns)
) ;

CREATE TABLE test_history_str (
itemid BIGINT NOT NULL,
clock INT DEFAULT 0 NOT NULL,
value VARCHAR(255) DEFAULT '' NOT NULL,
ns INT DEFAULT 0 NOT NULL,
PRIMARY KEY (itemid, clock, ns)
);The command line is as follows./bin/flink run
-Dexecution.checkpointing.interval=10s
-Dparallelism.default=1
-c com.oceanbase.connector.flink.tools.cdc.CdcTools
lib/flink-connector-oceanbase-tools-cdc-1.4-SNAPSHOT.jar
mysql-sync-database
--database test_db
--mysql-conf hostname=xxxx
--mysql-conf port=3306
--mysql-conf username=root
--mysql-conf password=xxxx
--mysql-conf database-name=test_db
--including-tables "tbl1|test.*"
--sink-conf username=xxxx@xxxx
--sink-conf password=xxxx
--sink-conf url=jdbc:mysql://xxxx:xxxx
--sink-conf sink.label-prefix=label
--table-conf replication_num=1`
The sink-config configuration is the configuration of the OceanBase database

@xxsc0529 xxsc0529 closed this Nov 11, 2024
@xxsc0529 xxsc0529 reopened this Nov 11, 2024
@xxsc0529 xxsc0529 closed this by deleting the head repository Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add command line tools to support Flink Jdbc Connector as source
1 participant