Canal Quick Start for MySQL Binlog Subscription
Canal reads MySQL binary logs and exposes row-level change events to downstream consumers. It is commonly used for cache synchronization, search indexing, auditing, and data pipelines.
Enable row-based binary logging and assign a unique server ID:
[mysqld]
server-id=1
log-bin=mysql-bin
binlog-format=ROW
binlog-row-image=FULL
Create a dedicated replication account with only the required privileges, then configure the Canal instance with the MySQL address, credentials, destination, and starting position. Start Canal Server and inspect its instance logs before connecting a client.
A client subscribes to a destination, fetches message batches, processes row events, and acknowledges only after downstream work succeeds. Roll back or leave the batch unacknowledged when processing fails.
If no events arrive, verify binlog is enabled, the account can read it, the position still exists, filters match the database and table, clocks are correct, and the client is connected to the expected destination. Consumers must be idempotent because reconnects and retries can produce duplicate processing.