Using Canal to parse MySQL binlog logs

Source: Internet
Author: User

First, the installation package download (canal.deployer-x.x.x.tar.gz official recommended to use the 1.0.22 version)

Https://github.com/alibaba/canal/releases

Second, unzip the file

TAR-ZXVF canal.deployer-1.0.22.tar.gz-c/app/canal/

Iii. modification of the canal configuration file

Vim $CANAL _home/conf/canal.properties

Vim $CANAL _home/conf/example/instance.properties

Description

CANAL.ZKSERVERS:ZK Address

Canal.instance.mysql.slaveId:mysql ServerID (cannot be the same as server_id in MySQL configuration)

Canal.instance.master.address: Database Address

Canal.instance.dbUsername:mysql User Name

Canal.instance.dbPassword: Password

Canal.instance.defaultDatabaseName: the default monitored database

Canal.instance.filter.regex: Filtered Regular expression (default full-Library full table)

Iv. Database Configuration

The database needs to turn on the Binlog log, and it is row mode

V. Start the Canal service (each machine starts, but only one server is available on ZK)

bin/startup.sh

Vi. updating records in the database

When logging in the operations database, clients can resolve to data changes

VII. Client Code

Https://github.com/smile0327/canal-test.git

Note: I am using the 1.0.22 version here. With the 1.0.25 version, if MySQL and canal server are on the same machine, the program will not error, but the canal server cannot consume the Binlog log.

Using Canal to parse MySQL binlog logs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.