测试项目:canal的HA功能验证
测试平台:CentOS Linux release 7.1.1503 (Core) Mysql测试版本:5.6.24-72.2-log Canal版本:1.0.22
测试方案:
在测试机部署两台canal-server,配置为:172.17.1.181:11121和172.17.1.181:11120
部署一台mysql:172.17.1.181:3306
测试步骤:
(1) 启动canal-server-1:bin/start.sh,查看zookeeper中canal-server信息:
zk: localhost:2181(CONNECTED) 47] get /otter/canal/destinations/example/running
{"active":true,"address":"172.17.1.181:11121","cid":1}
cZxid = 0x50015c322
ctime = Thu Oct 20 13:49:11 CST 2016
mZxid = 0x50015c322
mtime = Thu Oct 20 13:49:11 CST 2016
pZxid = 0x50015c322
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x357e032d65a0027
dataLength = 54
numChildren = 0
(2) 启动canal-server-2: bin/start.sh
(3) 启动canal-client: ./start.sh >log.log 2>&1 &
(4) 执行数据库数据出入脚本(默认插入数据9999条记录):./insert-data-182.sh,查看client端日志输出
================> binlog[mysql-bin.000003:8224261] , executeTime : 1476943586000 , delay : 17313ms
BEGIN ----> Thread id: 30032
----------------> binlog[mysql-bin.000003:8224389] , name[test,canal_test] , eventType : INSERT , executeTime : 1476943586000 , delay : 17315ms
id : 1 type=int(10) update=true
name : joe type=varchar(20) update=true
age : 20 type=int(4) update=true
department : AE type=varchar(20) update=true
----------------
END ----> transaction id: 90100