Destination MariaDB#
The extractedreplicant-cli will be referred to as the$REPLICANT_HOME directory in the proceeding steps.
I. Prerequisites#
Pay attention to the following before configuring MariaDB as the Target system:
- Make sure the specified user has
CREATE TABLEandCREATE TEMPORARY TABLEprivileges on the catalogs/schemas into which replicated tables should be created. - If you want Replicant to create catalogs/schemas for you on the target MariaDB system, then you also need to grant
CREATE DATABASE/CREATE SCHEMAprivileges to the user. - If this user does not have
CREATE DATABASEprivilege, then create a database manually with nameio_blitzzand grant all privileges for it to the user specified here. Replicant uses this database for internal checkpointing and metadata management.
The database/schema of your choice on a different instance of your choice name can be configured using the metadata config feature. For more information, seeMetadata Configuration.
II. Set up Connection Configuration#
From
$REPLICANT_HOME, navigate to the sample MariaDB connection configuration file:vi conf/conn/mariadb_dst.yamlYou can establish connection with Target MariaDB using either SSL or plain username and password.
Connect using username and password#
You can store your connection credentials in a secrets management service and tell Replicant to retrieve the credentials. For more information, seeSecrets management.
Otherwise, you can put your credentials like usernames and passwords in plain form like the sample below:
type:MARIADBhost:HOSTNAMEport:PORT_NUMBERusername:"USERNAME"password:"PASSWORD"max-connections:30#Specify the maximum number of connections replicant can open in MariaDBmax-retries:10#Number of times any operation on the system will be re-attempted on failures.retry-wait-duration-ms:1000#Duration in milliseconds replicant should wait before performing then next retry of a failed operationReplace the following:
HOSTNAME: the hostname of the Target MariaDB hostPORT_NUMBER: the relevant port number of the MariaDB hostUSERNAME: the username credential that connects to the MariaDB hostPASSWORD: the password associated withUSERNAME
Connect using SSL#
If you use SSL for connection, you don’t need to provide the
host,port,username, andpasswordparameters separately like the preceding sample. Rather, specify a single connection URL that connects to the MariaDB server containing the necessary credentials. You can specify this URL with theurlparameter in the connection configuration file.The connection URL has the following syntax:
mariadb://HOST:POST/DATABASE_NAME?user=USERNAMEpassword=PASSWORD&useSSL=true&allowPublicKeyRetrieval=true"Replace the following:
HOST: the hostname of the Target MariaDB hostPORT: the relevant port number of the MariaDB hostDATABASE_NAME: the name of the MariaDB databaseUSERNAME: the username credential that connects to the MariaDB hostPASSWORD: the password associated withUSERNAME
III. Set up Applier Configuration#
From
$REPLICANT_HOME, naviagte to the sample MariaDB applier configuration file:vi conf/dst/mariadb.yamlMake the necessary changes as follows:
snapshot:threads:32#Specify the maximum number of threads Replicant should use for writing to the targetbatch-size-rows:10_000#Specify the size of a batchtxn-size-rows:1_000_000#Determines the unit of an applier-side job#If bulk-load is used, Replicant will use the native bulk-loading capabilities of the target databasebulk-load:enable:true|false#Set to true if you want to enable bulk loadingtype:FILE|PIPE#Specify the type of bulk loading between FILE and PIPEserialize:true|false#Set to true if you want the generated files to be applied in serial/parallel fashion#For versions 20.09.14.3 and beyondnative-load-configs:#Specify the user-provided LOAD configuration string which will be appended to the s3 specific LOAD SQL command
Caution: By default, MariaDB disables local data loading which causes bulk loading to fail. So if you want to use bulk loading, make sure to enablethelocal_infile system variable in yourMariaDB option file.For a detailed explanation of configuration parameters in the applier file, readApplier Reference.