Movatterモバイル変換


[0]ホーム

URL:


✨ As of November 2023, Arcion has become a part of Databricks.Learn more here
MySQL

Destination Cloud SQL for MySQL#

This page describes how to load data in real time intoGoogle’s Cloud SQL for MySQL, a fully managed service for MySQL relational database.

The following steps refer to the extractedArcion self-hosted CLI download as the$REPLICANT_HOME directory.

Prerequisites#

Pay attention to the following before configuring Cloud SQL for MySQL as the target system:

I. Set up connection configuration#

Specify your connection details to Replicant with a connection configuration file. You can find a sample connection configuration filecloudsql_mysql.yaml in the$REPLICANT_HOME/conf/conn directory.

Specify the connection details in the following manner:

type:CLOUDSQL_MYSQLhost:CLOUDSQL_MYSQL_IPport:PORT_NUMBERusername:'USERNAME'password:'PASSWORD'max-connections:30max-retries:10retry-wait-duration-ms:1000

Replace the following:

Feel free to change the following parameter values as you need:

The following shows a sample connnection configuration:

type:CLOUDSQL_MYSQLhost:12.34.456.78port:57565username:"replicant"password:"Replicant#123"max-connections:30max-retries:10retry-wait-duration-ms:1000

II. Configure mapper file (optional)#

If you want to define data mapping from your source to Cloud SQL for MySQL, specify the mapping rules in the mapper file. For more information on how to define the mapping rules and run Replicant CLI with the mapper file, seeMapper configuration.

For example, the following sample applies to a MySQL-to-Cloud SQL for MySQL pipeline:

rules:[tpch]:source:    -tpchtables:DST_PART:source:[tpch, PART]:DST_ORDERS:source:[tpch, ORDERS]:

III. Configure metadata (optional)#

To ensure fault tolerance and resilience in replication, Arcion Replicant needs to maintain a number of metadata tables. Replicant uses a metadata configuration file to handle metadata-related operations. For more information, seeMetadata configuration.

The following shows a sample metadata configuration:

type:MYSQLconnection:host:localhostport:53585username:'replicant'password:'Replicant#123'max-connections:30catalog:io_replicate

IV. Set up Applier configuration#

To configure replication mode according to your requirements, specify your configuration in the Applier configuration file. You can find a sample Applier configuration filecloudsql_mysql.yaml in the$REPLICANT_HOME/conf/dst directory.

Configuresnapshot mode#

For operating insnapshot mode, specify your configuration under thesnapshot section of the configuration file. For example:

snapshot:threads:32batch-size-rows:10_000txn-size-rows:1_000_000bulk-load:enable:truetype:FILEskip-tables-on-failures:true_traceDBTasks:truehandle-failed-opers:trueuse-upsert-based-recovery:falsefk-cycle-resolution-method:REMOVE_FK# BLOCK_TABLES to break cycle or REMOVE_FK(default) to remove constraintuser-role:init-user-roles:true
Tip: If you want to use bulk loading, make sure to setthelocal_infile database flag toon in Cloud SQL for MySQL.

For more information about the Applier parameters forsnapshot mode, seeSnapshot mode.

Configure real-time replication#

For operating inrealtime mode orfull mode, specify your configuration under therealtime section of the conifiguration file. For example:

realtime:threads:32batch-size-rows:10_000txn-size-rows:1_00_000replay-replace-as-upsert:falseskip-tables-on-failures:falsehandle-failed-opers:true# Transactional mode config# realtime:#   threads: 1#   batch-size-rows: 1000#   replay-consistency: GLOBAL#   txn-group-count: 100#   _oper-queue-size-rows: 20000#   skip-upto-cursors: #last failed cursor

For more information about the configuration parameters forrealtime mode, seeRealtime mode.


[8]ページ先頭

©2009-2026 Movatter.jp