使用canal同步MySQL数据
一、MySQL配置 1.1 安装 MySQL 略 1.2 修改 my.ini 配置文件 1[mysqld] 2log-bin=mysql-bin # 开启binlog 3binlog-format=ROW # 选择row模式 4server_id=1 # serverid唯一 1.3 授权 1GRANTSELECT,REPLICATIONSLAVE,REPLICATIONCLIENTON*.*TO'canal'@'%'IDENTIFIEDBY'canal';2FLUSHPRIVILEGES;1.4 重启数据库 1service mysqld restart 二、部署 canal 2.1 安装 java 1yum -y install java 验证安装 1java -version 2openjdk version "1.8.0_312" 3OpenJDK Runtime Environment (build 1.8.0_312-b07) 4OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) 2.2 下载 canal 1wget https://github.com/alibaba/canal/releases/download/canal-1.1.5/canal.deployer-1.1.5.tar.gz 2mkdir -p /opt/canal/deploy 3tar xf canal.deployer-1.1.5.tar.gz -C /opt/canal/deploy 2.3 配置 canal 1cd /opt/canal/deploy 2vim conf/example/instance.properties 3################################################# 4## mysql serverId , v1.0.26+ will autoGen server-id 自动生成 5# canal.instance.mysql.slaveId=0 6 7#……