开发者社区 问答 正文

ClusterCanalConnector——zookeeper模式下连接canal过慢

前提:集群搭建没有问题,java直接连接zk速度也很快,用Simple模式也很快,但是,

CanalConnector connector = CanalConnectors.newClusterConnector("200.200.200.64:2181", "es", "", ""); int batchSize = 1000; int emptyCount = 0; try { System.out.println("start connect"); connector.connect(); System.out.println("connect successed!"); connector.subscribe(".."); System.out.println("subscribeed !!"); ... 在connector.subscribe(".."); 非常慢,有时候还需要重启两次才能正常连接!! debug查看是 public void subscribe(String filter) throws CanalClientException { this.waitClientRunning();

发生问题,有什么办法可以解决?

原提问者GitHub用户wql6

展开
收起
绿子直子 2023-05-09 15:15:18 150 分享 版权
1 条回答
写回答
取消 提交回答
  • 你这是基于zookeeper的集群模式启动,上一次异常退出时尽量使用平滑退出,不要kill -9,正确调用disconnect

    原回答者GitHub用户agapple

    2023-05-10 10:58:05
    赞同 展开评论