First, download the source code
-
Download: https://github.com/alibaba/canal
I use a canal-1.1.4 version
-
Source structure
client-adapter of this project is to deploy a minor operation
-
IDEA source introduced into the structure as follows:
Second, the installation configuration
- Find manven module has the module root, and then click install to install
After installation is complete, the package will have the corresponding operation in the corresponding items of the target directory, you do not want to run in the development tool, it can be a direct copy of the corresponding packet.
-
Modify launcher configuration of application.yml
-
es adapter configuration
Under launcher project profiles created es directory and add the required synchronization profile
Third, run debug
Once configured, run the launcher directly to the springBoot project, which is run CanalAdapterApplication this class on it.
When prompted to start to see the log after a successful launch on behalf of success!
Fourth, testing and certification
Incremental synchronization test installation with canal-adapter package deployment were running, here are introduced and test conditions for synchronization and full amount of synchronization function, namely etl function.
launcher spring boot program is a program in which the package has a rest controller class (CommonRest.java), which provides a number of interfaces, wherein one interface for the total amount of synchronization data
-
canal full amount of sync
We send a http request in accordance with the content of comments to:
All data canal_db1.yml for a profile es under the directory, the following message appears after you run, you can let the data table canal_db1.yml full configuration synchronization to es in the
In kibana see whether the data has been generated:
-
canal condition synchronization
如果想执行从某一个时刻的数据同步,在上面的测试URL后加上对应的参数就可以了
其参数由es的配置项决定的,以下截图的配置文件中的etlCondition: