vesoft-inc / nebula-br

Backup and restore utility for Nebula Graph
Apache License 2.0
14 stars 11 forks source link

Overview

Backup and Restore (BR) is a CommandLine Interface Tool to back up data of graph spaces of Nebula and restore data from the backup files.

Features

Limitation

Prerequisites

Nebula Agent

Nebula cluster to back up/restore should start the agent service in each cluster(including metad, storaged, graphd) host. Notice that, if you have multi-services in the same host, you need only start one agent. That is to say, you need exactly one agent in each cluster host no matter how many services in it. In the future, the nebula-agent will be started automatically, but now, you should start it yourself in your cluster machines one by one. You could download it from nebula-agent repo and start it as the guidance in that repo.

Quick Start

Implementation

Backup

BR CLI would send an RPC request to leader of the meta services of Nebula Graph to back up the cluster. Before the backup is created, the meta service will block any writes to the cluster, including DDL and DML statements. The blocking operation is involved with the raft layer of cluster. After that, meta service send an RPC request to all storage service to create snapshot. Metadata of the cluster stored in meta services will be backup as well. Those backup files includes:

Restore

BR CLI would first check the topologies of the target cluster and the backup. If not match the requirements, the restore operation would be aborted. Before restore, BR CLI would stop the meta and storage service remotely. If the backup contain entire cluster, the original data of target cluster would be backup to a temporary path end up with _old_<timestamp> before restoring, in case of any error occurred. When restoring, BR CLI would try to repick hosts for each space from target cluster and download the backup files from the specified backend to the target hosts.

Local Storage Mode

Local mode have strictly usage preconditions:

  1. BR CLI could be only used in the same machine when backup/restore/cleanup/show all the time.
  2. If you have multi-metad, you should use a shared filesystem path as the local uri which is mounted to all the cluster machines, such as nfs, distributed filesystem. Otherwise, you will restore metad service failed.

Then we suggest that you should only use local storage in experiment environment. In production environment, s3-compatible storage backend is highly recommended.