-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f32257
commit fc8e1ed
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,22 +31,21 @@ function run() { | |
SINK_URI="kafka://127.0.0.1:9092/$TOPIC_NAME?protocol=canal-json&enable-tidb-extension=true" | ||
run_cdc_cli changefeed create --start-ts=$start_ts --sink-uri="$SINK_URI" -c ${changefeed_id} --config="$CUR/conf/changefeed.toml" | ||
|
||
pd_addr="http://$UP_PD_HOST_1:$UP_PD_PORT_1" | ||
ensure $MAX_RETRIES check_changefeed_status --pd=$pd_addr $changefeed_id "normal" | ||
ensure $MAX_RETRIES check_changefeed_status 127.0.0.1:8300 $changefeed_id "normal" | ||
|
||
cdc_kafka_consumer --upstream-uri $SINK_URI --downstream-uri="mysql://[email protected]:3306/?safe-mode=true&batch-dml-enable=false" --upstream-tidb-dsn="root@tcp(${UP_TIDB_HOST}:${UP_TIDB_PORT})/?" --config="$CUR/conf/changefeed.toml" 2>&1 & | ||
|
||
run_sql "DROP DATABASE if exists dispatcher;" ${UP_TIDB_HOST} ${UP_TIDB_PORT} | ||
run_sql "CREATE DATABASE dispatcher;" ${UP_TIDB_HOST} ${UP_TIDB_PORT} | ||
run_sql "CREATE TABLE dispatcher.index (a int primary key, b int);" ${UP_TIDB_HOST} ${UP_TIDB_PORT} | ||
|
||
ensure $MAX_RETRIES check_changefeed_status --pd=$pd_addr $changefeed_id "failed" | ||
ensure $MAX_RETRIES check_changefeed_status 127.0.0.1:8300 $changefeed_id "failed" | ||
|
||
run_cdc_cli changefeed update -c ${changefeed_id} --sink-uri="$SINK_URI" --config="$CUR/conf/new_changefeed.toml" --no-confirm | ||
|
||
run_cdc_cli changefeed resume -c ${changefeed_id} | ||
|
||
ensure $MAX_RETRIES check_changefeed_status --pd=$pd_addr $changefeed_id "normal" | ||
ensure $MAX_RETRIES check_changefeed_status 127.0.0.1:8300 $changefeed_id "normal" | ||
|
||
run_sql "INSERT INTO dispatcher.index values (1, 2);" ${UP_TIDB_HOST} ${UP_TIDB_PORT} | ||
run_sql "INSERT INTO dispatcher.index values (2, 3);" ${UP_TIDB_HOST} ${UP_TIDB_PORT} | ||
|