Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 3.manage-snapshot.md (#1158) #1159

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs-2.0/7.data-security/3.manage-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ nebula> SHOW SNAPSHOTS;

当前未提供恢复快照命令,需要手动拷贝快照文件到对应的文件夹内,也可以通过shell脚本进行操作。实现逻辑如下:

1. 创建快照后,会在Meta服务器和Storage服务器的安装目录内生成`checkpoints`目录,保存创建的快照。以本文为例,当存在2个图空间时,创建的快照分别保存在`/usr/local/nebula/data/meta/nebula/0/checkpoints`、`/usr/local/nebula/data/storage/nebula/3/checkpoints`和`/usr/local/nebula/data/storage/nebula/4/checkpoints`中。
1. 创建快照后,会在leader Meta服务器和所有Storage服务器的安装目录内生成`checkpoints`目录,保存创建的快照。以本文为例,当存在2个图空间时,创建的快照分别保存在`/usr/local/nebula/data/meta/nebula/0/checkpoints`、`/usr/local/nebula/data/storage/nebula/3/checkpoints`和`/usr/local/nebula/data/storage/nebula/4/checkpoints`中。

```bash
$ ls /usr/local/nebula/data/meta/nebula/0/checkpoints/
Expand All @@ -103,6 +103,10 @@ nebula> SHOW SNAPSHOTS;

2. 当数据丢失需要通过快照恢复时,用户可以找到合适的时间点快照,将内部的文件夹`data`和`wal`分别拷贝到各自的上级目录(和`checkpoints`平级),覆盖之前的`data`和`wal`,然后重启集群即可。

!!! caution

需要同时覆盖所有Meta节点的data和wal目录,因为存在重启集群后发生Meta重新选举leader的情况,如果不覆盖所有Meta节点,新的leader使用的还是最新的Meta数据,导致恢复失败。


<!-- TODO

Expand Down