公众号:架构师与哈苏
关注公众号进入it交流群! 公众号:架构师与哈苏 不定时都会推送一些实用的干货。。。

版本

canal.deployer-1.1.5
canal.admin-1.1.5
rocketmq-all-4.9.3-bin-release
rocketmq-deshboard-master
mysql5.7

官网

链接:canal
链接:rocket

操作系统

centos7

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就可以看的消息了)

posted on 2022-03-11 17:23  公众号/架构师与哈苏  阅读(95)  评论(0编辑  收藏  举报