canal-client的HA功能验证

10 篇文章 0 订阅
4 篇文章 0 订阅
测试题目:canal-client的HA功能验证
测试平台:CentOS Linux release 7.1.1503 (Core) mariadb版本:10.1.14-MariaDB Canal版本:1.0.23
测试方案:
在测试机部署两台canal-server,配置为:172.17.1.181:22220和172.17.1.181:22221
部署一台mariadb:172.17.1.181:3306
测试步骤:
1.启动多个canal-client进程:
[linwenxue@presto1.bi.bj2.yongche.com client]$ java -Djava.ext.dirs=lib1.0.23 com.yc.otter.client.ClusterCanalClient linwenxue > log/client-cluster1.log 2>&1 &
[1] 140079
[linwenxue@presto1.bi.bj2.yongche.com client]$ java -Djava.ext.dirs=lib1.0.23 com.yc.otter.client.ClusterCanalClient linwenxue > log/client-cluster2.log 2>&1 &
[2] 140151
[linwenxue@presto1.bi.bj2.yongche.com client]$ java -Djava.ext.dirs=lib1.0.23 com.yc.otter.client.ClusterCanalClient linwenxue > log/client-cluster3.log 2>&1 &
[3] 142007
2.顺序间隔一会关闭client1和client2进程:
[linwenxue@presto1.bi.bj2.yongche.com client]$ kill 140079
[linwenxue@presto1.bi.bj2.yongche.com client]$ kill 140151
3.观察输出日志:
log/client-cluster1.log
10-25-15:23:28 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 1 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true
-------------------EventType.INSERT end---------------------
................ 省略中间日志............
10-25-15:23:48 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 2496 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true

-------------------EventType.INSERT end---------------------
EventType is TRANSACTIONEND
********************************获取messageId:455,解析消息结束**********************************
10-25-15:23:48 INFO ********************************获取messageId:455,解析消息结束**********************************
10-25-15:23:48 INFO ## canal client is down.
==========================client-cluster1.log结束====================

log/client-cluster2.log
10-25-15:23:53 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 2497 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true

-------------------EventType.INSERT end---------------------
................ 省略中间日志............
-------------------EventType.INSERT end---------------------
EventType is TRANSACTIONEND
10-25-15:24:11 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 5462 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true

-------------------EventType.INSERT end---------------------
EventType is TRANSACTIONEND
********************************获取messageId:882,解析消息结束**********************************
10-25-15:24:11 INFO ********************************获取messageId:882,解析消息结束**********************************
10-25-15:24:11 INFO ## canal client is down.
==========================client-cluster2.log结束====================

log/client-cluster3.log
10-25-15:24:17 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 5463 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true

-------------------EventType.INSERT end---------------------
................ 省略中间日志............
10-25-15:29:53 INFO Entry MetaInfo: schema is canal_test, table is canal_mariadb_test
-------------------EventType.INSERT start-------------------
id : 50000 type=int(10) update=true
name : a type=varchar(20) update=true
age : 1 type=int(4) update=true
department : A type=varchar(20) update=true

-------------------EventType.INSERT end---------------------

测试结果:在50000条数据录入的情况,canal-client实现了HA功能,不存在重复和缺失数据情况
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值