メインコンテンツまでスキップ
バージョン: 2.1

クイックスタート

1. ソースクラスターとターゲットクラスターのbinlog設定を開く

ソースクラスターとターゲットクラスターの両方のfe.confとbe.confで以下の情報を設定してください:

enable_feature_binlog=true

2. Syncer のデプロイ

2.1. 以下のリンクから最新のパッケージをダウンロードしてください:

https://apache-doris-releases.oss-accelerate.aliyuncs.com/ccr-release/ccr-syncer-3.0.6-rc04-x64.tar.xz

2.2. Syncer の起動と停止

# Start
cd bin && sh start_syncer.sh --daemon
# Stop
sh stop_syncer.sh

ステップ 3. ソースクラスター内の同期対象データベース/TableのBinlogを開く

-- If synchronizing the entire database, execute the following script to enable binlog for all tables in that database
./enable_db_binlog.sh --host $host --port $port --user $user --password $password --db $db

-- If synchronizing a single table, only enable the binlog for that table by executing:
ALTER TABLE your_table_name ENABLE BINLOG SET ("binlog.enable" = "true");

ステップ 4. Syncer で同期ジョブを開始する

curl -X POST -H "Content-Type: application/json" -d '{
"name": "ccr_test",
"src": {
"host": "localhost",
"port": "9030",
"thrift_port": "9020",
"user": "root",
"password": "",
"database": "your_db_name",
"table": "your_table_name"
},
"dest": {
"host": "localhost",
"port": "9030",
"thrift_port": "9020",
"user": "root",
"password": "",
"database": "your_db_name",
"table": "your_table_name"
}
}' http://127.0.0.1:9190/create_ccr

同期ジョブのパラメータの説明:

name: The name of the CCR synchronization job, must be unique
host, port: Correspond to the host and MySQL (JDBC) port of the cluster Master FE
user, password: The identity used by Syncer to start transactions and pull data
database, table:
If synchronizing at the database level, fill in your_db_name, and leave your_table_name empty
If synchronizing at the table level, fill in both your_db_name and your_table_name
The name used to initiate the synchronization job can only be used once