Documentation — Administrator's guide

Backup and restore

The data

lock table orders;
dump table orders;
unlock table orders;
  • You need the DUMP privilege. The table (or the whole cluster) must be locked, otherwise the dump is refused: this is what makes the copy consistent.
  • Every partition is saved by a SQL broker, in its backup directory (the last field of its SQL_BROKER line), in a file named TABLE_PARTITION_BACKUPID.sql. The answer is Backup started on N servers.: the work goes on in the background. Wait for it to end before you unlock the table.
  • backup table is the same command.
  • show backups for orders; lists the backups of a table with their status: Started, Terminated or Aborted.

Restore

lock table orders;
restore table orders [with [dump] id N];
unlock table orders;
  • You need the TRUNCATE and the INSERT privileges. The table must be locked and the cluster unlocked.
  • Without with id, the last backup is restored. show backups for orders; gives the identifiers.
  • The restore replaces the content of the table.

The dictionary

The dictionary lives in the master brokers, which are MariaDB servers: save it with the tools of MariaDB (mariadb-dump), on one master broker. With two master brokers, the loss of one is not a loss of the dictionary.

The configuration

Keep a copy of etc/synsql.conf and of the etc/*.magic files in a safe place. They hold the identifier and the secret key of the cluster and the passwords of the master brokers. Keep them private.

← Manage users  |  Outage issues →