Quick Start
This article mainly introduces CloudCanal to get started quickly, taking the new deployment of CloudCanal for Docker for Linux machines as an example.
Machine Prepare
Prepare a Linux (CentOS 7/8) virtual machine
- CPU cores: 4
- Memory: 8 GB
Install and Activate
- Refer to Install (Linux/MacOS) document Install and activate CloudCanal.
Add DataSource
Log in to the CloudCanal console,DataSource > Add DataSource.
- Select Self Maintenance database
- Select MySQL database type
- Fill necessary information such as connection url, account and password, etc
- Test Connection to verify connectivity
- Click the Add DataSource button to complete
The DataSource just added
Create DataJob and Run
Log in to the added MySQL database.
Run following script to prepare the test data.
# source database
create database sample_src;
# target database
create database sample_dst;
# prepare table and data for migration and sync
use sample_src;
CREATE TABLE IF NOT EXISTS `sample_src`.`test_table`(
`id` INT UNSIGNED AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL,
`age` int not null ,
PRIMARY KEY ( `id` )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
# prepare test data
insert into `sample_src`.`test_table`(id,name,age) values(1,'hello',18);
insert into `sample_src`.`test_table`(id,name,age) values(2,'world',18);
insert into `sample_src`.`test_table`(id,name,age) values(3,',',18);
insert into `sample_src`.`test_table`(id,name,age) values(4,'cloudcanal',18);Back in the CloudCanal console,DataJob > Create DataJob.
Select the added DataSource as source and target.
Click Test Connection and click Next Step.
Choose Incremental as DataJobType, select Full Data, and click Next Step.
Select the tables and click Next Step.
Select all columns and click Next Step.
Confirm and Create DataJob.
DataJob running normally.
- DataJob will automatically Initialize, Schema Migration, Full Data, Incremental, the progress bar changes gradually.
Data Verification.
- Create several insert,update,delete in the source DataSource.
- Find peer DataSource has consistent data.
Summary
CloudCanal can be quickly and simple used for Data Migration and Synchronization in four steps.
Include Machine prepare, Install and activate, Add DataSource, Create DataJob and run.