Setting Up Replication
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
This example will guide you through setting up replication of a database.
Note
To replicate a database, the secondary cluster user must have CREATE DATABASE
privileges and the primary cluster user (the one specified in REPLICATE DATABASE
) must have the ALL PRIVILEGES
permission on the primary cluster’s master aggregator.
The following host:port
combinations represent the master aggregators of the primary and secondary clusters:
-
primary-MA:3306
-
secondary-MA:3306
Note that the primary and secondary clusters need not have identical topologies.
To begin replicating the database db_
from primary-MA
, run the following command on secondary-MA
:
REPLICATE DATABASE db_name FROM master_user:'master_user_password'@primary-MA:3306;
You always initiate replication from the secondary cluster.
Multiple secondary clusters can replicate from a single primary cluster.REPLICATE DATABASE
on the master aggregator of each of the replica clusters.
Note
Data is always replicated across clusters asynchronously.
Last modified: April 3, 2023