版本选择:
Doris 2.1.6
MySQL 8.0
Flink 1.18.0
FlinkCDC 3.1.0
Doris-Flink-Connector 24.0.0
准备工作
MySQL 开启 Binlog 并建立测试库表
MySQL 开启 Binlog:sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 。
conf 体验AI代码助手 代码解读复制代码server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_format = ROW
重启 MySQL 服务:sudo service mysql restart。
使用 MySQL 建立对应的库表:
-- create database
CREATE DATABASE app_db;
USE app_db;
-- create orders table
CREATE TABLE `orders` (
`id` INT NOT NULL,
`price` DECIMAL(10,2) NOT NULL,
PRIMARY KEY (`id`)
);
-- insert records
INSERT INTO `orders` (`id`, `price`) VALUES (1, 4.00);
INSERT INTO `orders` (`id`, `price`) VALUES (2, 100.00);
-- c