Global Replication
Overview
Steps
2
Launch MariaDB Cloud Services
curl --location --request POST https://api.skysql.com/provisioning/v1/services \
--header "X-API-Key: ${API_KEY}" --header "Content-type: application/json" \
--data '{
"service_type": "transactional",
"topology": "standalone",
"provider": "gcp",
"region": "us-east4",
"architecture": "amd64",
"size": "sky-2x8",
"storage": 100,
"nodes": 1,
"name": "skysql-primary",
"ssl_enabled": true
}'curl --location --request POST https://api.skysql.com/provisioning/v1/services \
--header "X-API-Key: ${API_KEY}" --header "Content-type: application/json" \
--data '{
"service_type": "transactional",
"topology": "standalone",
"provider": "gcp",
"region": "us-west1",
"architecture": "amd64",
"size": "sky-2x8",
"storage": 100,
"nodes": 1,
"name": "skysql-secondary",
"ssl_enabled": true
}'3
Back up the Primary and Restore to the Secondary Service
curl --location --request POST https://api.skysql.com/skybackup/v1/backups/schedules \
--header "X-API-Key: ${API_KEY}" --header "Content-type: application/json" \
--data '{
"backup_type": "full",
"schedule": "once",
"service_id": "{id}"
}'curl --location --request POST https://api.skysql.com/skybackup/v1/restores \
--header "X-API-Key: ${API_KEY}" --header "Content-type: application/json" \
--data '{
"id": "{backup-id}}",
"service_id": "{service-id}"
}'4
Set up Replication Between the Primary and the Secondary
curl --location --request GET "https://api.skysql.com/skybackup/v1/backups?service_id={service_id}" \
--header "X-API-Key: ${API_KEY}" --header "Content-type: application/json" | jqCALL sky.change_external_primary_gtid(host, port, gtid, use_ssl_encryption);CALL sky.change_external_primary
('dbpwfxxxx.sysp0000.db1.skysql.com',
3306,
'mariadb-bin.000007',
xxxxx,
true);+-----------------------------------------------------------------------------------------------------------------------------------------+
| Run_this_grant_on_your_external_primary |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT REPLICATION SLAVE ON *.* TO 'skysql_replication_dbpwxxxxx'@'174.x.x.x' IDENTIFIED BY 'xxxxxxxxxx'; |
+-----------------------------------------------------------------------------------------------------------------------------------------+CALL sky.start_replication();
CALL sky.replication_status();Last updated
Was this helpful?

