cratedb备份和恢复

1.修改参数文件
-bash-4.2$ cd /cratedb/crate-3.2.0/config
vi crate.yml 修改如下项
path.repo: /cratedb/snapdata


2.创建目录
mkdir -p /cratedb/snapdata

3.创建仓库mysnapdata
create repository mysnapdata type fs with (location='/cratedb/snapdata', compress=true);

4.创建快照
create snapshot mysnapdata.snapshot_all0815 all with (wait_for_completion=true, ignore_unavailable=true);


单独为某个表创建快照
create snapshot mysnapdata.snapshot_metric_0815 table sentinel_test.metric with (wait_for_completion=false);


5.查询快照
SELECT repository, name, state, concrete_indices FROM sys.snapshots ORDER BY repository, name;


6.从整体快照中恢复一个表
restore snapshot mysnapdata.snapshot_all0815 table sentinel_test.metric with (wait_for_completion=true);


7.删除快照
drop snapshot mysnapdata.snapshot_all0815;

8.删除仓库
drop repository "mysnapdata";

上一篇:maven入门基础:从仓库解析依赖的机制(四)


下一篇:1146. Snapshot Array