9.5 9.5 安装 canal 和启动
步骤 1: 下载 Canal
wget https://github.com/alibaba/canal/releases/download/canal-1.1.2/canal.deployer-1.1.2.tar.gz
步骤 2: 解压
mkdir /opt/module/canal
tar -zxvf canal.deployer-1.1.2.tar.gz -C /opt/module/canal
步骤 3: 配置
conf/canal.properties
canal 的通用配置, 主要关注下canal.port
, 默认是11111
conf/example/instance.properties
instance.properties
是针对要追踪的 mysql 的实例配置
canal.instance.mysql.slaveId=100
canal.instance.gtidon=false
canal.instance.master.address=hadoop201:3306
canal.instance.master.journal.name=
canal.instance.master.position=
canal.instance.master.timestamp=
canal.instance.master.gtid=
canal.instance.rds.accesskey=
canal.instance.rds.secretkey=
canal.instance.rds.instanceId=
canal.instance.tsdb.enable=true
canal.instance.dbUsername=root
canal.instance.dbPassword=aaa
canal.instance.connectionCharset = UTF-8
canal.instance.defaultDatabaseName =
canal.instance.enableDruid=false
canal.instance.filter.regex=.*\\..*
canal.instance.filter.black.regex=
canal.mq.topic=example
canal.mq.partition=0
步骤 4: 启动 canal
bin/startup.sh
步骤 5: 查看日志
步骤 6: 关闭 Canal
bin/stop.sh