版本
canal.deployer-1.1.5
canal.admin-1.1.5
rocketmq-all-4.9.3-bin-release
rocketmq-deshboard-master
mysql5.7
官网
操作系统
centos7
mysql5.7安装
vim /etc/my.cnf
[mysqld]
log-bin=mysql-bin #添加这一行就ok
binlog-format=ROW #选择row模式
server_id=1 #配置mysql replaction需要定义,不能和canal的slaveId重复
配置canal.deployer
wget https://github.com/alibaba/canal/releases/download/canal-1.1.5/canal.deployer-1.1.5.tar.gz
# 解压
tar zxcf canal.deployer-1.1.5.tar.gz
-C deployer
# 修改cancal.properties
cd conf
vim cancal.properties
# tcp, kafka, rocketMQ, rabbitMQ
canal.serverMode = rocketMQ
rocketmq.producer.group = canal_group
rocketmq.namesrv.addr = 127.0.0.1:9876
vim conf/example/instance.properties
# 源数据库配置
canal.instance.master.address=127.0.0.1:3306
canal.instance.dbUsername=canal
canal.instance.dbPassword=canal
# mq config
canal.mq.topic=canal_topic
启动
sh bin/start.sh
配置rocket
# 官网下载rocket二进制包
# 启动mqnamesrv
nohup sh bin/mqnamesrv &
tail -f ~/logs/rocketmqlogs/namesrv.log
The Name Server boot success...
# 启动mqbroker
nohup sh bin/mqbroker -n localhost:9876 &
tail -f ~/logs/rocketmqlogs/broker.log
The broker[%s, 172.30.30.233:10911] boot success...
操作看看
1.在数据库中新增数据
2.启动rocketmq-deshboard-master打成的jar,看的rocket可视化界面
:Message -> Topic(下拉框选择:canal_topic就可以看的消息了)