项目作者: aiven

项目描述 :
Clustered database backup
高级语言: Python
项目地址: git://github.com/aiven/astacus.git
创建时间: 2020-04-24T10:35:58Z
项目社区:https://github.com/aiven/astacus

开源协议:Apache License 2.0

下载


astacus

codecov

[!CAUTION]
This repository is no longer actively maintained.

Astacus is a clustered database backup system that is meant to work with
multiple open-source cluster databases, such as
M3 and
Apache Cassandra.

My name is Maximus Backupus Astacus, Co-ordinator of the Backups of the
Cluster, Master of the Storage Availability, loyal servant to the true
emperor, Prunus Aivenius. Father to a failed backup, husband to a corrupted
data. And I will have my restore, in this runtime or the next.

Goals

  • Support multiple clustered database products
  • Most of the code generic
  • Product-specific code with simple, testable API

  • Complexities to deal with e.g. reuse of blobs with same value in the
    shared code

    • It is needed to accomplish e.g. fast non-incremental M3 backups that are
      essentially incremental as only commit logs change frequently
  • Support list of object storage backup site locations -> Facilitate
    migration from old to new during service cloud migration

  • Have most of the code covered by unit tests

See also

Installation

Please see Dockerfile.fedora and Dockerfile.ubuntu for concrete up-to-date
examples, but here are the current ones:

Optional features

  • cassandra can be added with ‘cassandra’ optional:
    1. sudo pip3 install -e '.[cassandra]'

Fedora 34

(as root or user with sudo access; for root, skip sudo prefix)

  1. sudo dnf install -y make
  2. make build-dep-fedora
  3. sudo python3 ./setup.py install

Ubuntu 20.04

(as root or user with sudo access; for root, skip sudo prefix)

  1. sudo apt-get update
  2. sudo apt-get install -y make sudo
  3. make build-dep-ubuntu
  4. sudo python3 ./setup.py install

Configuration

Create astacus.conf, which specifies which database to back up, and where.
The configuration file format is YAML, but as it is JSON superset, JSON is
also fine.

Unfortunately the configuration part is not particularly well documented at
this time, but there are some examples of file backups to
local directory (JSON),
local directory (YAML), Amazon S3, or
Google GCS. There is even one example of
backing up M3 to GCS.

Usage

Start the nodes

Start astacus server on all nodes to be backed up, either by hand or via
e.g. systemd:

astacus server -c <path to configuration file>

Perform backups

Periodically (e.g. from cron) call on (ideally only one node, but it
doesn’t really matter as only one operation can run at a time):

Restore backups

Backup can be restored with either

List backups

To see list of backups:

Clean up old backups

To clean up backups based on the configured retention policy,

TODO

There is separate TODO file which tracks what is still to be done.