MySQL CDC source connector
The MySQL CDC connector allows for reading snapshot data and incremental data from MySQL database. This document describes how to set up the MySQL CDC connector to run SQL queries against MySQL databases.
name | type | required | default value |
---|---|---|---|
username | String | Yes | - |
password | String | Yes | - |
database-names | List | No | - |
table-names | List | Yes | - |
base-url | String | Yes | - |
startup.mode | Enum | No | INITIAL |
startup.timestamp | Long | No | - |
startup.specific-offset.file | String | No | - |
startup.specific-offset.pos | Long | No | - |
stop.mode | Enum | No | NEVER |
stop.timestamp | Long | No | - |
stop.specific-offset.file | String | No | - |
stop.specific-offset.pos | Long | No | - |
incremental.parallelism | Integer | No | 1 |
snapshot.split.size | Integer | No | 8096 |
snapshot.fetch.size | Integer | No | 1024 |
server-id | String | No | - |
server-time-zone | String | No | UTC |
connect.timeout.ms | Duration | No | 30000 |
connect.max-retries | Integer | No | 3 |
connection.pool.size | Integer | No | 20 |
chunk-key.even-distribution.factor.upper-bound | Double | No | 1000 |
chunk-key.even-distribution.factor.lower-bound | Double | No | 0.05 |
debezium.* | config | No | - |
format | Enum | No | DEFAULT |
common-options | no | - |
Name of the database to use when connecting to the database server.
Password to use when connecting to the database server.
Database name of the database to monitor.
Table name of the database to monitor. The table name needs to include the database name, for example: database_name.table_name
URL has to be with database, like "jdbc:mysql://localhost:5432/db" or "jdbc:mysql://localhost:5432/db?useSSL=true".
Optional startup mode for MySQL CDC consumer, valid enumerations are "initial", "earliest", "latest" and "specific".
Start from the specified epoch timestamp (in milliseconds).
Note, This option is required when the "startup.mode" option used 'timestamp'
.
Start from the specified binlog file name.
Note, This option is required when the "startup.mode" option used 'specific'
.
Start from the specified binlog file position.
Note, This option is required when the "startup.mode" option used 'specific'
.
Optional stop mode for MySQL CDC consumer, valid enumerations are "never".
Stop from the specified epoch timestamp (in milliseconds).
Note, This option is required when the "stop.mode" option used 'timestamp'
.
Stop from the specified binlog file name.
Note, This option is required when the "stop.mode" option used 'specific'
.
Stop from the specified binlog file position.
Note, This option is required when the "stop.mode" option used 'specific'
.
The number of parallel readers in the incremental phase.
The split size (number of rows) of table snapshot, captured tables are split into multiple splits when read the snapshot of table.
The maximum fetch size for per poll when read table snapshot.
A numeric ID or a numeric ID range of this database client, The numeric ID syntax is like '5400', the numeric ID range syntax is like '5400-5408'.
Every ID must be unique across all currently-running database processes in the MySQL cluster. This connector joins the MySQL cluster as another server (with this unique ID) so it can read the binlog.
By default, a random number is generated between 5400 and 6400, though we recommend setting an explicit value.
The session time zone in database server.
The maximum time that the connector should wait after trying to connect to the database server before timing out.
The max retry times that the connector should retry to build database server connection.
The connection pool size.
Pass-through Debezium's properties to Debezium Embedded Engine which is used to capture data changes from MySQL server.
See more about the Debezium's MySQL Connector properties
Optional output format for MySQL CDC, valid enumerations are "DEFAULT"、"COMPATIBLE_DEBEZIUM_JSON".
source {
MySQL-CDC {
debezium {
snapshot.mode = "never"
decimal.handling.mode = "double"
}
}
}
Source plugin common parameters, please refer to Source Common Options for details.
source {
MySQL-CDC {
result_table_name = "fake"
parallelism = 1
server-id = 5656
username = "mysqluser"
password = "mysqlpw"
table-names = ["inventory_vwyw0n.products"]
base-url = "jdbc:mysql://localhost:56725/inventory_vwyw0n"
}
}
- Add MySQL CDC Source Connector