使用 Windows 方式部署 Canal Server
参考:
https://github.com/alibaba/canal/wiki/QuickStart
下载 Canal Server 安装文件
从浏览器 或 命令行 下载最新稳定的 Canal Server 安装文件将其安装到系统中 $PATH。
注意:可先网页下载到本地;
访问 release 页面 , 选择需要的包下载, 如以 1.1.7 版本为例
https://github.com/alibaba/canal/releases
直接点击链接下载安装包
下载并安装(推荐)
解压完成后,进入 D:\Java\canal.adapter-1.1.7
目录,可以看到如下结构
快速启动 Canal Server
1. 配置修改
修改 conf/example/instance.properties
## mysql serverId , v1.0.26+ will autoGen
# canal.instance.mysql.slaveId=0
#position info,需要改成自己的数据库信息
canal.instance.master.address = 192.168.3.20:3306
#binlog日志名称
canal.instance.master.journal.name = mysql-bin.000001
# mysql主库链接时起始的binlog偏移量
canal.instance.master.position = 326513581
# mysql主库链接时起始的binlog的时间戳
canal.instance.master.timestamp =
#canal.instance.standby.address =
#canal.instance.standby.journal.name =
#canal.instance.standby.position =
#canal.instance.standby.timestamp =
#username/password,需要改成自己的数据库信息
canal.instance.dbUsername = canal
canal.instance.dbPassword = canal
canal.instance.defaultDatabaseName =
canal.instance.connectionCharset = UTF-8
#table regex
canal.instance.filter.regex = .\*\\\\..\*
- canal.instance.connectionCharset 代表数据库的编码方式对应到 java 中的编码类型,比如 UTF-8,GBK , ISO-8859-1
- 如果系统是1个 cpu,需要将 canal.instance.parser.parallel 设置为 false
2. 启动
cd D:\Java\canal.deployer-1.1.7\bin
startup.bat
3. 查看 server 日志
tail -f logs/canal/canal.log
2013-02-05 22:45:27.967 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## start the canal server.
2013-02-05 22:45:28.113 [main] INFO com.alibaba.otter.canal.deployer.CanalController - ## start the canal server[10.1.29.120:11111]
2013-02-05 22:45:28.210 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## the canal server is running now ......
4. 查看 instance 的日志
tail -f logs/example/example.log
2013-02-05 22:50:45.636 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [canal.properties]
2013-02-05 22:50:45.641 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [example/instance.properties]
2013-02-05 22:50:45.803 [main] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start CannalInstance for 1-example
2013-02-05 22:50:45.810 [main] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start successful
作者:Jeebiz 创建时间:2024-03-26 18:06
最后编辑:Jeebiz 更新时间:2024-07-10 22:56
最后编辑:Jeebiz 更新时间:2024-07-10 22:56