前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Cephfs的快照功能

Cephfs的快照功能

作者头像
用户2772802
发布2018-08-06 11:20:06
4K0
发布2018-08-06 11:20:06
举报
文章被收录于专栏:磨磨谈磨磨谈

前言

Cephfs的快照功能在官网都很少提及,因为即使开发了很多年,但是由于cephfs的复杂性,功能一直没能达到稳定,这里,只是介绍一下这个功能,怎么使用,并且建议不要在生产中使用,因为搞不好是会丢数据的

功能介绍

首先这个功能是默认关闭的,所以需要开启

代码语言:javascript
复制
[root@lab8106 ~]# ceph fs set ceph  allow_new_snaps 1
Error EPERM: Warning! This feature is experimental.It may cause problems up to and including data loss.Consult the documentation at ceph.com, and if unsure, do not proceed.Add --yes-i-really-mean-it if you are certain.
[root@lab8106 ~]# ceph fs set ceph  allow_new_snaps 1  --yes-i-really-mean-it

从提示上可以看到,还是不要在生产上使用

开发者的话:

In Jewel ceph fs snapshots are still experimental. Does someone has a clue when this would become stable, or how experimental this is ? We’re not sure yet. Probably it will follow stable multi-MDS; we’re thinking about redoing some of the core snapshot pieces still. :/ It’s still pretty experimental in Jewel. Shen had been working on this and I think it often works, but tends to fall apart under the failure of other components (eg, restarting an MDS while snapshot work is happening). -Greg

挂载集群

代码语言:javascript
复制
[root@lab8106 ~]# mount -t ceph 192.168.8.106:/ /mnt
[root@lab8106 ~]# cd /mnt/

快照是对目录创建的 所以我们来看下

代码语言:javascript
复制

[root@lab8106 mnt]# ll
total 0
drwxr-xr-x 1 root root 51341 Dec 13 11:41 test1
drwxr-xr-x 1 root root 51591 Dec 13 16:18 test2
drwxr-xr-x 1 root root 30951 Dec 13 15:19 test3

创建快照

代码语言:javascript
复制
[root@lab8106 mnt]# mkdir .snap/snap1
[root@lab8106 mnt]# ll .snap/
total 0
drwxr-xr-x 1 root root 133883 Dec 13 14:21 snap1
[root@lab8106 mnt]# ll .snap/snap1
total 0
drwxr-xr-x 1 root root 51341 Dec 13 11:41 test1
drwxr-xr-x 1 root root 51591 Dec 13 16:18 test2
drwxr-xr-x 1 root root 30951 Dec 13 15:19 test3

创建快照很简单,就是在需要做快照的目录下面执行 mkdir .snap/snapname 后面接快照的名称

快照的速度非常快,秒级别的

恢复快照数据

代码语言:javascript
复制
[root@lab8106 mnt]# cp -ra .snap/snap1/* ./

删除快照

代码语言:javascript
复制
[root@lab8106 mnt]# rmdir .snap/snap1

删除快照需要用rmdir命令

总结

本篇简单的介绍了下cephfs快照的相关的操作,自己很久没搞,命令都找不到了,供参考

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2016-12-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 磨磨谈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 功能介绍
  • 总结
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档