這篇文章將為大家詳細(xì)講解有關(guān)docker中ceph如何創(chuàng)建快照以及快照恢復(fù),小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

大家看到我們的rbd塊設(shè)備掛載到了/mnt:
[root@k8s-master1 ~]# df -h |grep rbd /dev/rbd0 2.0G 3.0M 1.9G 1% /mnt
我們?cè)?mnt目錄下創(chuàng)建幾個(gè)文件:
[root@k8s-master1 ~]# touch /mnt/a.txt [root@k8s-master1 ~]# touch /mnt/b.txt
下面我們開始對(duì)rb塊設(shè)備創(chuàng)建快照:
[root@k8s-master1 ~]# rbd snap create rbd/data@snap1 說明: rbd是pool的名字 data是塊設(shè)備的名字 snap1是我們隨便取的名字
查看創(chuàng)建的快照:
[root@k8s-master1 ~]# rbd snap ls rbd/data SNAPID NAME SIZE TIMESTAMP 4 snap1 2078 MB
[root@k8s-master1 ~]# ll /mnt/ total 16 -rw-r--r--. 1 root root 0 Nov 4 04:46 aa.txt -rw-r--r--. 1 root root 0 Nov 4 05:34 a.txt -rw-r--r--. 1 root root 0 Nov 4 05:34 b.txt
[root@k8s-master1 ~]# rm -rf /mnt/*
[root@k8s-master1 ~]# ll /mnt/
下面開始用快照恢復(fù):
[root@k8s-master1 ~]# rbd snap rollback rbd/data@snap1 Rolling back to snapshot: 100% complete...done.
恢復(fù)快照會(huì)覆蓋當(dāng)前磁盤數(shù)據(jù),所以請(qǐng)備份當(dāng)前數(shù)據(jù)再恢復(fù)。
然后,再查看,就會(huì)發(fā)現(xiàn)數(shù)據(jù)已經(jīng)恢復(fù)了:
[root@k8s-master1 ~]# ll /mnt/ total 16 -rw-r--r--. 1 root root 0 Nov 4 04:46 aa.txt -rw-r--r--. 1 root root 0 Nov 4 05:34 a.txt -rw-r--r--. 1 root root 0 Nov 4 05:34 b.txt
說明,最新版的centos-release-ceph-luminous的客戶端有問題,即用快照恢復(fù)不出來數(shù)據(jù),所以請(qǐng)用ceph的其他版本來測(cè)試快照的恢復(fù)功能。
[root@k8s-master1 ~]# rbd snap rm rbd/data@snap1 Removing snap: 100% complete...done.
關(guān)于“docker中ceph如何創(chuàng)建快照以及快照恢復(fù)”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
標(biāo)題名稱:docker中ceph如何創(chuàng)建快照以及快照恢復(fù)-創(chuàng)新互聯(lián)
標(biāo)題路徑:http://www.chinadenli.net/article40/ieeho.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)、品牌網(wǎng)站建設(shè)、網(wǎng)站營銷、商城網(wǎng)站、動(dòng)態(tài)網(wǎng)站、靜態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容