- TiDBについて
- クイックスタート
- 発展させる
- 概要
- クイックスタート
- TiDB Cloud(開発者層) で TiDB クラスターを構築する
- TiDB の CRUD SQL
- TiDB でシンプルな CRUD アプリを構築する
- 応用例
- TiDB に接続する
- データベース スキーマの設計
- 書き込みデータ
- データの読み取り
- 取引
- 最適化
- トラブルシューティング
- 参照
- 書店のサンプル アプリケーション
- ガイドライン
- アーカイブされたドキュメント
- クラウドネイティブ開発環境
- サードパーティのサポート
- デプロイ
- 移行する
- 管理
- 監視と警告
- トラブルシューティング
- TiDB トラブルシューティング マップ
- 遅いクエリを特定する
- 遅いクエリを分析する
- SQL 診断
- Top SQLを使用して高価なクエリを特定する
- ログを使用して高価なクエリを特定する
- ステートメント要約表
- ホットスポットの問題のトラブルシューティング
- 増加した読み取りおよび書き込み遅延のトラブルシューティング
- クラスターのオンサイト情報の保存と復元
- クラスタ セットアップのトラブルシューティング
- 高いディスク I/O 使用率のトラブルシューティング
- ロック競合のトラブルシューティング
- TiFlash のトラブルシューティング
- オプティミスティック トランザクションでの書き込み競合のトラブルシューティング
- データとインデックス間の不一致のトラブルシューティング
- 性能チューニング
- チューニングガイド
- Configuration / コンフィグレーションのチューニング
- システムのチューニング
- ソフトウェアのチューニング
- Configuration / コンフィグレーション
- コプロセッサ キャッシュ
- SQL チューニング
- チュートリアル
- TiDB ツール
- 概要
- ユースケース
- ダウンロード
- TiUP
- ドキュメンテーション マップ
- 概要
- 用語と概念
- TiUP コンポーネントの管理
- FAQ
- トラブルシューティングガイド
- コマンドリファレンス
- 概要
- TiUP コマンド
- TiUP クラスタ コマンド
- 概要
- tiup cluster audit
- tiup cluster check
- tiup cluster clean
- tiup cluster deploy
- tiup cluster destroy
- tiup cluster disable
- tiup cluster display
- tiup cluster edit-config
- tiup cluster enable
- tiup cluster help
- tiup cluster import
- tiup cluster list
- tiup cluster patch
- tiup cluster prune
- tiup cluster reload
- tiup cluster rename
- tiup cluster replay
- tiup cluster restart
- tiup cluster scale-in
- tiup cluster scale-out
- tiup cluster start
- tiup cluster stop
- tiup cluster template
- tiup cluster upgrade
- TiUP DMコマンド
- TiDB クラスター トポロジ リファレンス
- DM クラスタ トポロジ リファレンス
- ミラー リファレンス ガイド
- TiUP コンポーネント
- PingCAPクリニック診断サービス
- TiDB Operator
- Dumpling
- TiDB Lightning
- TiDB データ移行
- バックアップと復元 (BR)
- Binlog
- TiCDC
- Dumpling
- 同期差分インスペクター
- ティスパーク
- 参照
- クラスタ アーキテクチャ
- 主な監視指標
- セキュリティ
- 権限
- SQL
- SQL 言語の構造と構文
- SQL ステートメント
ADD COLUMN
ADD INDEX
ADMIN
ADMIN CANCEL DDL
ADMIN CHECKSUM TABLE
ADMIN CHECK [TABLE|INDEX]
ADMIN SHOW DDL [JOBS|QUERIES]
ADMIN SHOW TELEMETRY
ALTER DATABASE
ALTER INDEX
ALTER INSTANCE
ALTER PLACEMENT POLICY
ALTER TABLE
ALTER TABLE COMPACT
ALTER USER
ANALYZE TABLE
BACKUP
BATCH
BEGIN
CHANGE COLUMN
COMMIT
CHANGE DRAINER
CHANGE PUMP
CREATE [GLOBAL|SESSION] BINDING
CREATE DATABASE
CREATE INDEX
CREATE PLACEMENT POLICY
CREATE ROLE
CREATE SEQUENCE
CREATE TABLE LIKE
CREATE TABLE
CREATE USER
CREATE VIEW
DEALLOCATE
DELETE
DESC
DESCRIBE
DO
DROP [GLOBAL|SESSION] BINDING
DROP COLUMN
DROP DATABASE
DROP INDEX
DROP PLACEMENT POLICY
DROP ROLE
DROP SEQUENCE
DROP STATS
DROP TABLE
DROP USER
DROP VIEW
EXECUTE
EXPLAIN ANALYZE
EXPLAIN
FLASHBACK TABLE
FLUSH PRIVILEGES
FLUSH STATUS
FLUSH TABLES
GRANT <privileges>
GRANT <role>
INSERT
KILL [TIDB]
LOAD DATA
LOAD STATS
MODIFY COLUMN
PREPARE
RECOVER TABLE
RENAME INDEX
RENAME TABLE
REPLACE
RESTORE
REVOKE <privileges>
REVOKE <role>
ROLLBACK
SELECT
SET DEFAULT ROLE
SET [NAMES|CHARACTER SET]
SET PASSWORD
SET ROLE
SET TRANSACTION
SET [GLOBAL|SESSION] <variable>
SHOW ANALYZE STATUS
SHOW [BACKUPS|RESTORES]
SHOW [GLOBAL|SESSION] BINDINGS
SHOW BUILTINS
SHOW CHARACTER SET
SHOW COLLATION
SHOW [FULL] COLUMNS FROM
SHOW CONFIG
SHOW CREATE PLACEMENT POLICY
SHOW CREATE SEQUENCE
SHOW CREATE TABLE
SHOW CREATE USER
SHOW DATABASES
SHOW DRAINER STATUS
SHOW ENGINES
SHOW ERRORS
SHOW [FULL] FIELDS FROM
SHOW GRANTS
SHOW INDEX [FROM|IN]
SHOW INDEXES [FROM|IN]
SHOW KEYS [FROM|IN]
SHOW MASTER STATUS
SHOW PLACEMENT
SHOW PLACEMENT FOR
SHOW PLACEMENT LABELS
SHOW PLUGINS
SHOW PRIVILEGES
SHOW [FULL] PROCESSSLIST
SHOW PROFILES
SHOW PUMP STATUS
SHOW SCHEMAS
SHOW STATS_HEALTHY
SHOW STATS_HISTOGRAMS
SHOW STATS_META
SHOW STATUS
SHOW TABLE NEXT_ROW_ID
SHOW TABLE REGIONS
SHOW TABLE STATUS
SHOW [FULL] TABLES
SHOW [GLOBAL|SESSION] VARIABLES
SHOW WARNINGS
SHUTDOWN
SPLIT REGION
START TRANSACTION
TABLE
TRACE
TRUNCATE
UPDATE
USE
WITH
- データ型
- 関数と演算子
- クラスタ化インデックス
- 制約
- 生成された列
- SQL モード
- テーブル属性
- 取引
- ガベージ コレクション (GC)
- ビュー
- パーティショニング
- 一時テーブル
- キャッシュされたテーブル
- 文字セットと照合順序
- SQL の配置規則
- システム テーブル
mysql
- 情報_スキーマ
- 概要
ANALYZE_STATUS
CLIENT_ERRORS_SUMMARY_BY_HOST
CLIENT_ERRORS_SUMMARY_BY_USER
CLIENT_ERRORS_SUMMARY_GLOBAL
CHARACTER_SETS
CLUSTER_CONFIG
CLUSTER_HARDWARE
CLUSTER_INFO
CLUSTER_LOAD
CLUSTER_LOG
CLUSTER_SYSTEMINFO
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
DATA_LOCK_WAITS
DDL_JOBS
DEADLOCKS
ENGINES
INSPECTION_RESULT
INSPECTION_RULES
INSPECTION_SUMMARY
KEY_COLUMN_USAGE
METRICS_SUMMARY
METRICS_TABLES
PARTITIONS
PLACEMENT_POLICIES
PROCESSLIST
REFERENTIAL_CONSTRAINTS
SCHEMATA
SEQUENCES
SESSION_VARIABLES
SLOW_QUERY
STATISTICS
TABLES
TABLE_CONSTRAINTS
TABLE_STORAGE_STATS
TIDB_HOT_REGIONS
TIDB_HOT_REGIONS_HISTORY
TIDB_INDEXES
TIDB_SERVERS_INFO
TIDB_TRX
TIFLASH_REPLICA
TIKV_REGION_PEERS
TIKV_REGION_STATUS
TIKV_STORE_STATUS
USER_PRIVILEGES
VIEWS
METRICS_SCHEMA
- UI
- TiDB ダッシュボード
- 概要
- 管理
- アクセス
- 概要ページ
- クラスター情報ページ
- Top SQLページ
- キー ビジュアライザー ページ
- メトリクス関係グラフ
- SQL ステートメントの分析
- スロークエリページ
- クラスタ診断
- 検索ログ ページ
- インスタンスのプロファイリング
- セッションの管理とConfiguration / コンフィグレーション
- FAQ
- CLI
- コマンド ライン フラグ
- Configuration / コンフィグレーションファイルのパラメーター
- システム変数
- ストレージ エンジン
- テレメトリー
- エラーコード
- テーブル フィルター
- トポロジ ラベルごとにレプリカをスケジュールする
- よくある質問
- リリースノート
- すべてのリリース
- リリースのタイムライン
- TiDB のバージョニング
- v6.1
- v6.0
- v5.4
- v5.3
- v5.2
- v5.1
- v5.0
- v4.0
- v3.1
- v3.0
- v2.1
- v2.0
- v1.0
- 用語集
Binlogクラスターの展開
このドキュメントでは、 バイナリパッケージを使用してBinlogをデプロイするの方法について説明します。
ハードウェア要件
PumpとDrainerは、Intelx86-64アーキテクチャを備えた64ビットユニバーサルハードウェアサーバープラットフォームにデプロイされて動作します。
開発、テスト、および実稼働の環境では、サーバーハードウェアの要件は次のとおりです。
サービス | サーバーの数 | CPU | ディスク | メモリー |
---|---|---|---|---|
Pump | 3 | 8コア+ | SSD、200 GB + | 16G |
Drainer | 1 | 8コア+ | SAS、100 GB以上(binlogがローカルファイルとして出力される場合、ディスクサイズは、これらのファイルが保持される期間によって異なります。) | 16G |
Binlogを使用してTiDBBinlogをデプロイ
Binlogを使用してTiDBBinlogをデプロイすることをお勧めします。これを行うには、TiUPを使用してTiDBをデプロイするときに、 Binlogのdrainer
とpump
のノード情報をBinlogデプロイメントトポロジに追加する必要があります。詳細な展開情報については、 TiUPを使用してTiDBクラスターをデプロイするを参照してください。
バイナリパッケージを使用してBinlogをデプロイ
公式バイナリパッケージをダウンロードする
TiDB Binlogのバイナリパッケージは、 TiDB Toolkitに含まれています。 TiDB Toolkitをダウンロードするには、 TiDBツールをダウンロードするを参照してください。
使用例
3つのPDノード、1つのTiDBノード、2つのPumpノード、および1つのDrainerノードがあるとすると、各ノードの情報は次のようになります。
ノード | 知財 |
---|---|
TiDB | 192.168.0.10 |
PD1 | 192.168.0.16 |
PD2 | 192.168.0.15 |
PD3 | 192.168.0.14 |
Pump | 192.168.0.11 |
Pump | 192.168.0.12 |
Drainer | 192.168.0.13 |
次のパートでは、上記のノードに基づいてPumpとDrainerを使用する方法を示します。
バイナリを使用してPumpをデプロイします。
Pumpのコマンドラインパラメータを表示するには、
./pump -help
を実行します。Usage of Pump: -L string the output information level of logs: debug, info, warn, error, fatal ("info" by default) -V the print version information -addr string the RPC address through which Pump provides the service (-addr="192.168.0.11:8250") -advertise-addr string the RPC address through which Pump provides the external service (-advertise-addr="192.168.0.11:8250") -config string the path of the configuration file. If you specify the configuration file, Pump reads the configuration in the configuration file first. If the corresponding configuration also exits in the command line parameters, Pump uses the configuration of the command line parameters to cover that of the configuration file. -data-dir string the path where the Pump data is stored -gc int the number of days to retain the data in Pump ("7" by default) -heartbeat-interval int the interval of the heartbeats Pump sends to PD (in seconds) -log-file string the file path of logs -log-rotate string the switch frequency of logs (hour/day) -metrics-addr string the Prometheus Pushgateway address. If not set, it is forbidden to report the monitoring metrics. -metrics-interval int the report frequency of the monitoring metrics ("15" by default, in seconds) -node-id string the unique ID of a Pump node. If you do not specify this ID, the system automatically generates an ID based on the host name and listening port. -pd-urls string the address of the PD cluster nodes (-pd-urls="http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379") -fake-binlog-interval int the frequency at which a Pump node generates fake binlog ("3" by default, in seconds)
例として「192.168.0.11」にPumpをデプロイすると、 Pump構成ファイルは次のようになります。
# Pump Configuration # the bound address of Pump addr = "192.168.0.11:8250" # the address through which Pump provides the service advertise-addr = "192.168.0.11:8250" # the number of days to retain the data in Pump ("7" by default) gc = 7 # the directory where the Pump data is stored data-dir = "data.pump" # the interval of the heartbeats Pump sends to PD (in seconds) heartbeat-interval = 2 # the address of the PD cluster nodes (each separated by a comma with no whitespace) pd-urls = "http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379" # [security] # This section is generally commented out if no special security settings are required. # The file path containing a list of trusted SSL CAs connected to the cluster. # ssl-ca = "/path/to/ca.pem" # The path to the X509 certificate in PEM format that is connected to the cluster. # ssl-cert = "/path/to/drainer.pem" # The path to the X509 key in PEM format that is connected to the cluster. # ssl-key = "/path/to/drainer-key.pem" # [storage] # Set to true (by default) to guarantee reliability by ensuring binlog data is flushed to the disk # sync-log = true # When the available disk capacity is less than the set value, Pump stops writing data. # 42 MB -> 42000000, 42 mib -> 44040192 # default: 10 gib # stop-write-at-available-space = "10 gib" # The LSM DB settings embedded in Pump. Unless you know this part well, it is usually commented out. # [storage.kv] # block-cache-capacity = 8388608 # block-restart-interval = 16 # block-size = 4096 # compaction-L0-trigger = 8 # compaction-table-size = 67108864 # compaction-total-size = 536870912 # compaction-total-size-multiplier = 8.0 # write-buffer = 67108864 # write-L0-pause-trigger = 24 # write-L0-slowdown-trigger = 17
Pumpの始動例:
./pump -config pump.toml
コマンドラインパラメーターが構成ファイルパラメーターと同じである場合、コマンドラインパラメーターの値が使用されます。
バイナリを使用してDrainerをデプロイします。
Drainerのコマンドラインパラメータを表示するには、
./drainer -help
を実行します。Usage of Drainer: -L string the output information level of logs: debug, info, warn, error, fatal ("info" by default) -V the print version information -addr string the address through which Drainer provides the service (-addr="192.168.0.13:8249") -c int the number of the concurrency of the downstream for replication. The bigger the value, the better throughput performance of the concurrency ("1" by default). -cache-binlog-count int the limit on the number of binlog items in the cache ("8" by default) If a large single binlog item in the upstream causes OOM in Drainer, try to lower the value of this parameter to reduce memory usage. -config string the directory of the configuration file. Drainer reads the configuration file first. If the corresponding configuration exists in the command line parameters, Drainer uses the configuration of the command line parameters to cover that of the configuration file. -data-dir string the directory where the Drainer data is stored ("data.drainer" by default) -dest-db-type string the downstream service type of Drainer The value can be "mysql", "tidb", "kafka", and "file". ("mysql" by default) -detect-interval int the interval of checking the online Pump in PD ("10" by default, in seconds) -disable-detect whether to disable the conflict monitoring -disable-dispatch whether to disable the SQL feature of splitting a single binlog file. If it is set to "true", each binlog file is restored to a single transaction for replication based on the order of binlogs. It is set to "False", when the downstream is MySQL. -ignore-schemas string the db filter list ("INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql,test" by default) It does not support the Rename DDL operation on tables of `ignore schemas`. -initial-commit-ts If Drainer does not have the related breakpoint information, you can configure the related breakpoint information using this parameter. ("-1" by default) If the value of this parameter is `-1`, Drainer automatically obtains the latest timestamp from PD. -log-file string the path of the log file -log-rotate string the switch frequency of log files, hour/day -metrics-addr string the Prometheus Pushgateway address It it is not set, the monitoring metrics are not reported. -metrics-interval int the report frequency of the monitoring metrics ("15" by default, in seconds) -node-id string the unique ID of a Drainer node. If you do not specify this ID, the system automatically generates an ID based on the host name and listening port. -pd-urls string the address of the PD cluster nodes (-pd-urls="http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379") -safe-mode Whether to enable safe mode so that data can be written into the downstream MySQL/TiDB repeatedly. This mode replaces the `INSERT` statement with the `REPLACE` statement and splits the `UPDATE` statement into `DELETE` plus `REPLACE`. -txn-batch int the number of SQL statements of a transaction which are output to the downstream database ("1" by default)
例として「192.168.0.13」にDrainerをデプロイすると、 Drainer構成ファイルは次のようになります。
# Drainer Configuration. # the address through which Drainer provides the service ("192.168.0.13:8249") addr = "192.168.0.13:8249" # the address through which Drainer provides the external service advertise-addr = "192.168.0.13:8249" # the interval of checking the online Pump in PD ("10" by default, in seconds) detect-interval = 10 # the directory where the Drainer data is stored "data.drainer" by default) data-dir = "data.drainer" # the address of the PD cluster nodes (each separated by a comma with no whitespace) pd-urls = "http://192.168.0.16:2379,http://192.168.0.15:2379,http://192.168.0.14:2379" # the directory of the log file log-file = "drainer.log" # Drainer compresses the data when it gets the binlog from Pump. The value can be "gzip". If it is not configured, it will not be compressed # compressor = "gzip" # [security] # This section is generally commented out if no special security settings are required. # The file path containing a list of trusted SSL CAs connected to the cluster. # ssl-ca = "/path/to/ca.pem" # The path to the X509 certificate in PEM format that is connected to the cluster. # ssl-cert = "/path/to/pump.pem" # The path to the X509 key in PEM format that is connected to the cluster. # ssl-key = "/path/to/pump-key.pem" # Syncer Configuration [syncer] # If the item is set, the sql-mode will be used to parse the DDL statement. # If the downstream database is MySQL or TiDB, then the downstream sql-mode # is also set to this value. # sql-mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" # the number of SQL statements of a transaction that are output to the downstream database ("20" by default) txn-batch = 20 # the number of the concurrency of the downstream for replication. The bigger the value, # the better throughput performance of the concurrency ("16" by default) worker-count = 16 # whether to disable the SQL feature of splitting a single binlog file. If it is set to "true", # each binlog file is restored to a single transaction for replication based on the order of binlogs. # If the downstream service is MySQL, set it to "False". disable-dispatch = false # In safe mode, data can be written into the downstream MySQL/TiDB repeatedly. # This mode replaces the `INSERT` statement with the `REPLACE` statement and replaces the `UPDATE` statement with `DELETE` plus `REPLACE` statements. safe-mode = false # the downstream service type of Drainer ("mysql" by default) # Valid value: "mysql", "tidb", "file", and "kafka". db-type = "mysql" # If `commit ts` of the transaction is in the list, the transaction is filtered and not replicated to the downstream. ignore-txn-commit-ts = [] # the db filter list ("INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql,test" by default) # Does not support the Rename DDL operation on tables of `ignore schemas`. ignore-schemas = "INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql" # `replicate-do-db` has priority over `replicate-do-table`. When they have the same `db` name, # regular expressions are supported for configuration. # The regular expression should start with "~". # replicate-do-db = ["~^b.*","s1"] # [syncer.relay] # It saves the directory of the relay log. The relay log is not enabled if the value is empty. # The configuration only comes to effect if the downstream is TiDB or MySQL. # log-dir = "" # the maximum size of each file # max-file-size = 10485760 # [[syncer.replicate-do-table]] # db-name ="test" # tbl-name = "log" # [[syncer.replicate-do-table]] # db-name ="test" # tbl-name = "~^a.*" # Ignore the replication of some tables # [[syncer.ignore-table]] # db-name = "test" # tbl-name = "log" # the server parameters of the downstream database when `db-type` is set to "mysql" [syncer.to] host = "192.168.0.13" user = "root" # If you do not want to set a cleartext `password` in the configuration file, you can create `encrypted_password` using `./binlogctl -cmd encrypt -text string`. # When you have created an `encrypted_password` that is not empty, the `password` above will be ignored, because `encrypted_password` and `password` cannot take effect at the same time. password = "" encrypted_password = "" port = 3306 [syncer.to.checkpoint] # When the checkpoint type is "mysql" or "tidb", this option can be # enabled to change the database that saves the checkpoint # schema = "tidb_binlog" # Currently only the "mysql" and "tidb" checkpoint types are supported # You can remove the comment tag to control where to save the checkpoint # The default method of saving the checkpoint for the downstream db-type: # mysql/tidb -> in the downstream MySQL or TiDB database # file/kafka -> file in `data-dir` # type = "mysql" # host = "127.0.0.1" # user = "root" # password = "" # `encrypted_password` is encrypted using `./binlogctl -cmd encrypt -text string`. # When `encrypted_password` is not empty, the `password` above will be ignored. # encrypted_password = "" # port = 3306 # the directory where the binlog file is stored when `db-type` is set to `file` # [syncer.to] # dir = "data.drainer" # the Kafka configuration when `db-type` is set to "kafka" # [syncer.to] # only one of kafka-addrs and zookeeper-addrs is needed. If both are present, the program gives priority # to the kafka address in zookeeper # zookeeper-addrs = "127.0.0.1:2181" # kafka-addrs = "127.0.0.1:9092" # kafka-version = "0.8.2.0" # The maximum number of messages (number of binlogs) in a broker request. If it is left blank or a value smaller than 0 is configured, the default value 1024 is used. # kafka-max-messages = 1024 # The maximum size of a broker request (unit: byte). The default value is 1 GiB and the maximum value is 2 GiB. # kafka-max-message-size = 1073741824 # the topic name of the Kafka cluster that saves the binlog data. The default value is <cluster-id>_obinlog. # To run multiple Drainers to replicate data to the same Kafka cluster, you need to set different `topic-name`s for each Drainer. # topic-name = ""
Drainerの開始:
ノート:
ダウンストリームがMySQL/TiDBの場合、データの整合性を保証するには、
initial-commit-ts
の値を取得してデータの完全バックアップを作成し、 Drainerを最初に起動する前にデータを復元する必要があります。Drainerを初めて起動するときは、
initial-commit-ts
パラメーターを使用します。./drainer -config drainer.toml -initial-commit-ts {initial-commit-ts}
コマンドラインパラメータと設定ファイルパラメータが同じ場合は、コマンドラインのパラメータ値が使用されます。
TiDBサーバーの起動:
PumpとDrainer and Drainerを起動した後、TiDBサーバーの構成ファイルに次のセクションを追加して、binlogを有効にしてTiDBサーバーを起動します。
[binlog] enable=true
TiDBサーバーはPDから登録されたポンプのアドレスを取得し、それらすべてにデータをストリーミングします。登録されているPumpインスタンスがない場合、TiDBサーバーは起動を拒否するか、 Pumpインスタンスがオンラインになるまで起動をブロックします。
ノート:
- TiDBが実行されているときは、少なくとも1つのPumpが正常に実行されていることを保証する必要があります。
- TiDBサーバーでBinlogサービスを有効にするには、TiDBで
-enable-binlog
スタートアップパラメーターを使用するか、TiDBサーバー構成ファイルの[binlog]セクションにenable=trueを追加します。- 同じクラスタのすべてのTiDBインスタンスでBinlogサービスが有効になっていることを確認してください。有効になっていないと、データ複製中にアップストリームとダウンストリームのデータの不整合が発生する可能性があります。 TiDB Binlogサービスが有効になっていないTiDBインスタンスを一時的に実行する場合は、TiDB構成ファイルで
run_ddl=false
を設定します。- Drainerは、
ignore schemas
のテーブル(フィルターリスト内のスキーマ)でのrename
操作をサポートしていません。- 既存のTiDBクラスタでDrainerを起動する場合は、通常、クラスタデータの完全バックアップを作成し、スナップショットタイムスタンプを取得し、データをターゲットデータベースにインポートしてから、 Drainerを起動して、対応するスナップショットから増分データを複製する必要があります。タイムスタンプ。
- ダウンストリームデータベースがTiDBまたはMySQLの場合、アップストリームデータベースとダウンストリームデータベースの
sql_mode
が一致していることを確認してください。つまり、各SQLステートメントがアップストリームで実行され、ダウンストリームにレプリケートされる場合、sql_mode
は同じである必要があります。アップストリームとダウンストリームでそれぞれselect @@sql_mode;
ステートメントを実行してsql_mode
を比較できます。- DDLステートメントがアップストリームでサポートされているが、ダウンストリームと互換性がない場合、 Drainerはデータの複製に失敗します。例は、ダウンストリームデータベースMySQLがInnoDBエンジンを使用するときに
CREATE TABLE t1(a INT) ROW_FORMAT=FIXED;
ステートメントを複製することです。この場合、 Drainerでトランザクションをスキップするを構成し、ダウンストリームデータベースで互換性のあるステートメントを手動で実行できます。