Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    MySQL源端任务延迟如何手动添加心跳表?

    官方FAQ
    心跳
    1
    1
    350
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • junyu-cloudcanal
      junyu-cloudcanal last edited by

      简述

      CloudCanal 商业版提供了系统自带的心跳功能,如果社区版需要添加心跳能力,可按以下步骤添加。

      步骤

      • 源库添加 cloudcanal_hb 库(或其他名字)
      • 在 cloudcanal_hb 库添加 hb_tab 表(或其他名字)
        create table hb_tab
        (
          `id`           bigint(20) NOT NULL AUTO_INCREMENT,
          `gmt_modified` datetime   NOT NULL DEFAULT CURRENT_TIMESTAMP,
          PRIMARY KEY (`id`)
        );
        insert into hb_tab(id, gmt_modified) VALUES (1,now());
        
      • 配置 crontab 任务,定时对源端数据库执行如下 UPDATE SQL 即可
         update  hb_tab set gmt_modified=now() where id=1;
        
      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2020 ClouGence, Inc.备案号:浙ICP备20007605号-2