# cdc
**Repository Path**: ericzyh/cdc
## Basic Information
- **Project Name**: cdc
- **Description**: mysql binlog parser into rabbitmq
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-10-09
- **Last Updated**: 2021-01-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# cdc
[](https://www.travis-ci.org/rong360/cdc)
[](http://www.apache.org/licenses/LICENSE-2.0.html)
[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.rong360%22%20AND%20a%3A%22cdc%22)
A mysql binlog parser, which has running stable for more then 36 months in our production environment on more than 10 mysql instances. It transforms binlog event(insert/delete/update) into json format data into rabbitmq or other mq(such as kafka), Based on this project: [mysql-binlog-connector-java](https://github.com/shyiko/mysql-binlog-connector-java).
## What is cdc?
change data capture, Key Features:
- High availability, cluster deployment
- Table level filter
- Supports almost all mysql field parsing
- Automatically save binlog file/position, smooth upgrade and restart
- Configure centralized management
- Operational status monitoring
- Dynamically loading table configuration files
- support split table config
- Mysql binlog data order Guaranteed
- Support a easy way to tap it into other mq (sucn as kafka,nsq,redis...)
## dependency
- Java 8 or above is required.
- etcd 3.0 or above is required.
- mysql 5.6+
- open mysql binlog log
```html
[mysqld]
log-bin=mysql-bin
binlog-format=ROW
server_id=666
```
- authorize mysql slave read permission
```mysql
CREATE USER root IDENTIFIED BY '123';
GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
```
## Download
### Maven
```xml
com.rong360
cdc
1.4.0
```
## Quick start
* install [etcd](https://coreos.com/etcd/docs/latest/dl_build.html), start etcd
```bash
$ ./bin/etcd
```
* Set the database configuration in etcd
```config
etcdctl put cdc/master/admin/config/app/mysql/host 10.0.0.2
etcdctl put cdc/master/admin/config/app/mysql/port 3306
etcdctl put cdc/master/admin/config/app/mysql/username admin
etcdctl put cdc/master/admin/config/app/mysql/password 123
```
* Start program
```java
CdcClient client = new CdcClient("http://127.0.0.1:2379", "", "");
client.setInstance("admin");//"admin" is one of the ETCD configuration prefix elements
client.setWatchAllTable(true);
client.start();
```
## Documentation
### English
See [DOUCUMENT](https://github.com/rong360/cdc/blob/master/doc/english.md) for details.
### 简体中文
请见详细[文档](https://github.com/rong360/cdc/blob/master/doc/中文.md)。
## Connect with us
### Q&A