canal README

The project's README from github.com/alibaba/canal. As one markdown file: README.md.

build status codecov maven license average time to resolve an issue percentage of issues still open Leaderboard

简介

canal [kə'næl],译意为水道/管道/沟渠,主要用途是基于 MySQL 数据库增量日志解析,提供增量数据订阅和消费

早期阿里巴巴因为杭州和美国双机房部署,存在跨机房同步的业务需求,实现方式主要是基于业务 trigger 获取增量变更。从 2010 年开始,业务逐步尝试数据库日志解析获取增量变更进行同步,由此衍生出了大量的数据库增量订阅和消费业务。

基于日志增量订阅和消费的业务包括

当前的 canal 支持源端 MySQL 版本包括 5.1.x , 5.5.x , 5.6.x , 5.7.x , 8.0.x

工作原理

MySQL主备复制原理

canal 工作原理

重要版本更新说明

  1. canal 1.1.x 版本(release_note),性能与功能层面有较大的突破,重要提升包括:
  1. canal 1.1.4版本,迎来最重要的WebUI能力,引入canal-admin工程,支持面向WebUI的canal动态管理能力,支持配置、任务、日志等在线白屏运维能力,具体文档:Canal Admin Guide

文档

多语言

canal 特别设计了 client-server 模式,交互协议使用 protobuf 3.0 , client 端可采用不同语言实现不同的消费逻辑,欢迎大家提交 pull request

canal 作为 MySQL binlog 增量获取和解析工具,可将变更记录投递到 MQ 系统中,比如 Kafka/RocketMQ,可以借助于 MQ 的多语言能力

基于canal开发的工具

相关开源&产品

问题反馈

本项目的Issues会被同步沉淀至阿里云开发者社区

canal (alibaba/canal)

Searching Database…

29.7K ·GitHub
What is this?Canal is Alibaba's MySQL binlog incremental subscription and consumption component. It disguises itself as a MySQL slave, pulls binlog events from a MySQL master, and lets you consume the parsed changes for things like cache refresh, index building, or database synchronization.
Is this a library I embed, or a standalone server?It runs as a standalone client-server system: a canal server process talks to MySQL as a fake slave, and separate client applications (in Java, C#, Go, PHP, Python, Rust, or Node.js) connect to it over a protobuf 3.0 protocol to consume the changes.
How do I get it running?Follow the QuickStart guide (or the Docker QuickStart) to set up the canal server, point it at your MySQL master to start dumping binlog, and then write a client in your language of choice to consume the parsed events, or route them straight into Kafka/RocketMQ.
Do I need to configure MySQL replication first?Yes — canal mimics the MySQL replication protocol, so your MySQL master must have binlog enabled and configured as if it had a slave, since canal sends a dump request just like a real slave would.
Which MySQL versions does it actually support?It currently supports source-side MySQL versions 5.1.x, 5.5.x, 5.6.x, 5.7.x, and 8.0.x; other versions or heavily forked MySQL variants aren't guaranteed to work.
Who typically uses this, and why was it built?It was built inside Alibaba originally to sync data between its Hangzhou and US data centers; it's aimed at teams needing database mirroring, real-time backup, search index maintenance, or cache invalidation driven by DB changes.
Does it run on Linux servers in production?Yes, canal is a Java server process typically deployed on Linux, and it also ships an official Docker image for easier deployment.
Does canal have a web UI for management?Yes, since version 1.1.4 canal includes a canal-admin project that provides a WebUI for dynamically managing configuration, tasks, and logs without touching files manually.
Can canal deliver changes directly into Kafka or RocketMQ?Yes, canal natively supports pushing parsed binlog events straight into Kafka or RocketMQ as message delivery targets, removing the need for a custom relay client.
Does canal support Alibaba Cloud RDS instances?Yes, it has native support for subscribing to binlogs from Aliyun RDS for MySQL, which also handles issues like automatic master/slave failover and offline OSS binlog parsing.
Is there built-in monitoring for canal?Yes, canal exposes native Prometheus metrics support so you can monitor its performance and health out of the box.
Creator
alibaba
Size
23.7 MB
Stars
29.7K
Age
13y
Commits · 90 Days