github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/README.md (about) 1 # TiCDC 2 3 [![Build Status](https://internal.pingcap.net/idc-jenkins/job/build_cdc_multi_branch/job/master/badge/icon)](https://internal.pingcap.net/idc-jenkins/job/build_cdc_multi_branch/job/master) 4 [![codecov](https://codecov.io/gh/pingcap/ticdc/branch/master/graph/badge.svg)](https://codecov.io/gh/pingcap/ticdc) 5 [![Coverage Status](https://coveralls.io/repos/github/pingcap/ticdc/badge.svg)](https://coveralls.io/github/pingcap/ticdc) 6 [![LICENSE](https://img.shields.io/github/license/pingcap/ticdc.svg)](https://github.com/pingcap/ticdc/blob/master/LICENSE) 7 [![Go Report Card](https://goreportcard.com/badge/github.com/pingcap/ticdc)](https://goreportcard.com/report/github.com/pingcap/ticdc) 8 9 **TiCDC** is [TiDB](https://docs.pingcap.com/tidb/stable)'s change data capture framework. It supports replicating change data to various downstreams, including MySQL protocol-compatible databases, message queues via the open CDC protocol and other systems such as local file storage. 10 11 ## Architecture 12 13 <img src="docs/media/cdc_architecture.svg?sanitize=true" alt="architecture" width="600"/> 14 15 See a detailed introduction to [the TiCDC architecture](https://docs.pingcap.com/tidb/stable/ticdc-overview#ticdc-architecture). 16 17 ## Documentation 18 19 - [English](https://docs.pingcap.com/tidb/stable/ticdc-overview) 20 - [Chinese](https://docs.pingcap.com/zh/tidb/stable/ticdc-overview) 21 22 ## Blog 23 24 - [English](https://pingcap.com/blog/) 25 - [Chinese](https://pingcap.com/blog-cn/) 26 27 ## Building 28 29 To check the source code, run test cases and build binaries, you can simply run: 30 31 ```bash 32 $ make 33 $ make test 34 ``` 35 36 Note that TiCDC supports building with Go version `Go >= 1.13`. 37 38 When TiCDC is built successfully, you can find binary in the `bin` directory. Instructions for unit test and integration test can be found in [Running tests](tests/README.md). 39 40 ## Deployment 41 42 You can setup a CDC cluster for replication test manually as following: 43 44 1. Setup a TiDB cluster. 45 2. Start a CDC cluster, which contains one or more CDC servers. The command to start on CDC server is `cdc server --pd http://10.0.10.25:2379`, where `http://10.0.10.25:2379` is the client-url of pd-server. 46 3. Start a replication changefeed by `cdc cli changefeed create --pd http://10.0.10.25:2379 --start-ts 413105904441098240 --sink-uri mysql://root:123456@127.0.0.1:3306/`. The TSO is TiDB `timestamp oracle`. If it is not provided or set to zero, the TSO of start time will be used. Currently, we support MySQL protocol-compatible databases as downstream sinks only, and will add more sink types in the future. 47 48 For details, see [Deploy TiCDC](https://docs.pingcap.com/tidb/stable/deploy-ticdc). 49 50 ## Quick start 51 52 ```sh 53 # Start TiDB cluster 54 $ docker-compose -f docker-compose-mysql.yml up -d 55 56 # Attach to control container to run TiCDC 57 $ docker exec -it ticdc_controller_1 sh 58 59 # Start to feed the changes on the upstream tidb, and sink to the downstream tidb 60 $ ./cdc cli changefeed create --pd http://upstream-pd:2379 --sink-uri mysql://root@downstream-tidb:4000/ 61 62 # Exit the control container 63 $ exit 64 65 # Load data to the upstream tidb 66 $ sysbench --mysql-host=127.0.0.1 --mysql-user=root --mysql-port=4000 --mysql-db=test oltp_insert --tables=1 --table-size=100000 prepare 67 68 # Check sync progress 69 $ mysql -h 127.0.0.1 -P 5000 -u root -e "SELECT COUNT(*) FROM test.sbtest1" 70 ``` 71 72 ## Contributing 73 74 Contributions are welcomed and greatly appreciated. See [CONTRIBUTING.md](./CONTRIBUTING.md) 75 for details on submitting patches and the contribution workflow. 76 77 ## License 78 79 TiCDC is under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for details.