Destination YugabyteCQL#
The extractedreplicant-cli will be referred to as the$REPLICANT_HOME directory in the proceeding steps.
I. Set up Connection Configuration#
From
$REPLICANT_HOME, navigate to the sample YugabyteSQL connection configuration file:vi conf/conn/yugabytecql.yamlYou 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 using the following format:
type:YUGABYTE_CQL#You can specify multiple Cassandra nodes using the format below:cassandra-nodes:NODE_NAME:host:NODE_HOSTport:PORT_NUMBERusername:USERNAMEpassword:PASSWORDmax-connections:MAX_NUMBER_OF_CONNECTIONSReplace the following:
NODE_NAME: the node nameNODE_HOST: the node hostPORT_NUMBER: the port number inNODE_HOSTUSERNAME: the username that connects to the Cassandra serverPASSWORD: the password associated withUSERNAMEMAX_NUMBER_OF_CONNECTIONS: the maximum number of connections replicant can open in YugabyteCQL
You can also configure theread consistency levels andwrite consistency levels by setting the following two parameters in the connection configuration file:
read-consistency-levelwrite-consistency-level
The following consistency levels are supported:
ANYONETWOTHREEQUORUMALLLOCAL_QUORUMEACH_QUORUMSERIALLOCAL_SERIALLOCAL_ONE
Default:
LOCAL_QUORUM.The following is a sample connection configuration file:
type:YUGABYTE_CQLcassandra-nodes:node1:host:172.17.0.2port:9042node2:host:172.17.0.3port:9043username:'alex'password:'alex#123'read-consistency-level:LOCAL_QUORUMwrite-consistency-level:LOCAL_QUORUMmax-connections:30
II. Set up Applier Configuration#
To configure replication according to your requirements, specify your configuration in the Applier configuration file. You can find a sample Applier configuration fileyugabytecql.yaml in the$REPLICANT_HOME/conf/dst directory.
For more information on running Replicant in different modes, seeRunning Replicant.
You can configure YugabyteCQL for operating in either snapshot or realtime modes:
Configuresnapshot mode#
For operating in snapshot mode, specify your configuration under thesnapshot section of the conifiguration file. For example:
snapshot:threads:16txn-size-rows:65_000skip-tables-on-failures:falsekeyspaces:testdb:replication-property:"{'class' : 'SimpleStrategy', 'replication_factor' : 1}"durable-writes:trueenable-cdc:falseNotice that you need to specifythe namespace configuration underkeyspaces. It follows this format:
keyspaces:KEYSPACE_NAME:replication-property:"REPLICATION_PROPERTIES"durable-writes: {true|false}enable-cdc: {true|false}In the preceding format:
KEYSPACE_NAME: The keyspace name.REPLICATION_PROPERTIES: The replication strategy. Corresponds toREPLICATIONin theCREATE KEYSPACE docs.durable-writes: Corresponds toDURABLE_WRITESin theCREATE KEYSPACE docs.enable-cdc: Corresponds tocdcin theCREATE TABLE docs.
Use bulk loading#
If you want to use bulk loading in snapshot mode, usethebulk-load section to specify your configuration. For example:
snapshot:threads:16txn-size-rows:65_000skip-tables-on-failures:falsebulk-load:enable:truetype:FILENote: For YugabyteCQL, onlyFILE type bulk loading is supported. Configurerealtime mode#
For operating in realtime mode, specify your configuration under therealtime section of the conifiguration file. For example:
realtime:txn-size-rows:65_000skip-tables-on-failures:falseFor a detailed explanation of configuration parameters in the Applier file, seeApplier Reference.