您现在的位置是:热点 >>正文
一篇关于HDFS的快照讲解
热点99988人已围观
简介...
一个snapshot(快照)是一个全部文件系统、或者某个目录在某一时刻的镜像,使用vmware类似软件的同学指定,快照可以为虚拟机保存某个状态,如果做了更改,或者系统被折腾坏,还有个复原的操作。
快照应用在如下场景中:
防止用户的错误操作; 备份:给hdfs目录做快照,然后复制快照里面的文件到备份; 试验/测试 灾难恢复 HDFS的快照操作
这里测一篇试的Hadoop3.0版本,也是我的线上版本。
开启快照 hdfs dfsadmin -allowSnapshot /data/test/test_snapshot [hdfs@cdh-003 ~]$ hdfs dfs -ls /data/test关于/test_snapshot -rw-r--r-- 2 hdfs supergroup 88 2021-10-08 16:59 /datHDa/test/test_snapshot/ods_user1.txt
这里开启目录/data/test/test_snapshot快照功能,该目录当前有一个文件ods_user1.txt。
创建快照
给目录/data/test/test_snapshot创建了一个快照,名为backup01。
hdfs dfs -FScreateSnapshot /data/test/test_snapshot backup01 [hdfs@cdh-003 ~]$ hdfs dfs -ls /data/test/test_snapshot/.snapshot/backup01&nb的快sp;Found 1 items -rw-r--r-- 2 hdfs supergroup 88 2021-10-08 16:59&照讲nbsp;/data/test/test_snapshot/.snapshot/backup01/ods_user1.txt
可以看到实际上是在开启快照的目录下新建了一个文件夹.snapshot,下面有个目录backup01,里面有一个文件,相当于复制了一份文件。
查看快照
hdfs lsSnapshottableDir&nbs一篇p;
再上传一个文件
hdfs dfs -put data/urls.txt /data/test/test_snapshot
再创建一个快照
hdfs dfs -createSnapshot /data/test/test_snapshot back关于up02
这里又新建了一个快照backup02,.snapshot下面有两个目录,分别是backup01和backup02。
[hdfs@cdh-003 ~]$ hdfs dfs -ls /data/test/test_snapshot/.snapshot Found&nbHDsp;3 items drwxr-xr-x - hdfs supergroup 0 2021-10-08 17:04 /FSdata/test/test_snapshot/.snapshot/backup01 drwxr-xr-x - hdfs supergroup 0 202的快1-10-08 17:12 /data/test/test_snapshot/.snapshot/backup02
对比快照
因为后来又上传了一个文件,所以快照backup02下面有2个文件了,比backup01多一个文件urls.txt。
[hdfs@cdh-003 ~]$ hdfs 照讲snapshotDiff /data/test/test_snapshot backup01 backup02 Difference between snapshot backup01 and snapshot backup02 一篇;under directory /data/test/test_snapshot: M . + ./urls.txt
恢复快照如果不小心把文件删除了,这个文件就被移动到回收站(如果开启了回收站),如果回收站到期清理了或者没有开启回收站,这个时候快照的作用就关于发挥出来了,直接cp过去。
hdfs dfs -cp /data/test/test_snapshot/.snapshot/backup01/ods_user1.txt /data/test/test_snapshot
Tags:
相关文章
阿里通义千问Qwen3-Max 在官网上线深度思考功能
热点阿里通义千问的最新旗舰语言模型 Qwen3-Max 于正式上线其核心新功能 “深度思考” 模式,该模式通过增强推理链分析与多步骤问题拆解能力,显著提高了处理复杂任务的效率。 Qwen3-Max 是通义...
【热点】
阅读更多标签: 王侠 中国汽车重庆论坛 价格战 新能源车
热点云梦级6月13日云梦级消息,在 12 日的 2026 中国汽车重庆论坛开幕式上,中国国际贸易促进委员会汽车行业委员会会长、中国国际商会汽车行业商会会长王侠发表演讲。 王侠在演讲中谈到了“价格战”有关的...
【热点】
阅读更多壳牌中国与阿里云达成战略合作,数智化助力能源低碳转型
热点2月23日,壳牌中国与阿里云签署战略合作意向书,成为长期战略合作伙伴。双方将基于壳牌在能源转型领域的深厚积累和阿里云在云计算、大数据、人工智能等方面的技术优势,带动壳牌集团的优势资源和阿里巴巴集团在绿...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.impactpool.org/search/?type=79&q=谷歌霸屏业务【tg:seogoogle987】76p
- https://www.nyif.com/catalogsearch/result/index/?f=sarbanesoxleyU&index=me_cms_pe&lit=20&mode=list&p=1&q=谷歌霸屏业务【tg:seogoogle987】,THO
- https://www.lneg.pt/en/?s=谷歌霸屏业务【tg:seogoogle987】,NgT
- https://www.signingsavvy.com/sentence/谷歌霸屏业务【tg:seogoogle987】,oqV
- https://www.oikos-tecnics.com/?s=谷歌霸屏业务【tg:seogoogle987】,IYq
- https://www.sweat.com/collections/vendors?q=谷歌霸屏业务【tg:seogoogle987】,b3L
- https://www.target.com/s?searchTerm=谷歌霸屏业务【tg:seogoogle987】,eKa
- https://www.toy-people.com/?s=谷歌霸屏业务【tg:seogoogle987】,cLZ
- https://www.revere.org/search?action=SEARCH&q=谷歌霸屏业务【tg:seogoogle987】,vlq
- https://www.ucycle.com/search/=谷歌霸屏业务【tg:seogoogle987】,3Jm
- https://www.reginatangoshoes.com/en/catalogsearch/result/index/?T=1686132113407&q=谷歌霸屏业务【tg:seogoogle987】,h12
- https://www.localfootdoc.com/?s=谷歌霸屏业务【tg:seogoogle987】,Icg
- https://www.sportbiketracktime.com/index.php?route=product/search&tag=谷歌霸屏业务【tg:seogoogle987】,jMd
- https://www.welshmountainzoo.org/shop/index.php?routeproduct/search&tag=谷歌霸屏业务【tg:seogoogle987】,G6U
- https://www.navylookout.com/?ID=nSBR6Ivdu6lZg1yr2SDs30Lo5sTs76yJ&s=谷歌霸屏业务【tg:seogoogle987】,5aI
- https://www.samen-maier.at/search/谷歌霸屏业务【tg:seogoogle987】,2FN
- https://www.youm7.com/Home/Search?allwords=谷歌霸屏业务【tg:seogoogle987】,2K9
- https://www.umc.edu/search.aspx?ID=I4gnDKRS991MFcIDDzoYze4aWSAszAm7&q=谷歌霸屏业务【tg:seogoogle987】,SP7
- https://www.swecobelgium.be/?page=9&s=谷歌霸屏业务【tg:seogoogle987】,P27
- https://www.nuovabai.it/catalogsearch/result/?action=SEARCH&q=谷歌霸屏业务【tg:seogoogle987】,Lwm
- https://www.wmfe.org/?s=谷歌霸屏业务【tg:seogoogle987】,JSH
- https://www.realsporting.com/buscador?buscar=谷歌霸屏业务【tg:seogoogle987】,WiN
- https://www.nctsn.org/search?cat=191&query=谷歌霸屏业务【tg:seogoogle987】,1Hg
- https://www.olx.ba/pretraga?trazilica=谷歌霸屏业务【tg:seogoogle987】,gPi
- https://www.thedp.com/page/search?q=谷歌霸屏业务【tg:seogoogle987】,l6i
- https://www.posten-portal.de/search?query=谷歌霸屏业务【tg:seogoogle987】,4gR
- https://www.spicebar.de/catalogsearch/result/?q=谷歌霸屏业务【tg:seogoogle987】,HWN
- https://www.schenckprocess.com/search?q=谷歌霸屏业务【tg:seogoogle987】,utU
- https://www.paulaschoice.hk/zh_hant/catalogsearch/result/?q=谷歌霸屏业务【tg:seogoogle987】,BqL
- https://www.simcoemuskokahealth.org/SearchResults.aspx?SearchQuery=谷歌霸屏业务【tg:seogoogle987】,ZOT
- https://jihoon471.cafe24.com/product/search.html?banner_action=&keyword=谷歌霸屏业务【tg:seogoogle987】38N
- https://www.swanagerailway.co.uk/search?q=谷歌霸屏业务【tg:seogoogle987】,SXz
- https://www.dba.dk/soeg/?soeg=谷歌霸屏业务【tg:seogoogle987】5mA
- https://www.oprny.com/search.php?search_query=谷歌霸屏业务【tg:seogoogle987】,3ml
- https://www.zutari.com/?s=谷歌霸屏业务【tg:seogoogle987】,1hi
- https://xn--lgernevedlystskoven-lxb.dk/search/谷歌霸屏业务【tg:seogoogle987】,2zI
- https://www.tullygroup.us/?ID=hbkq8jFjrQlVRrwzEmvoUJJAY4e1Lfo5&s=谷歌霸屏业务【tg:seogoogle987】,lmE
- https://www.u-bourgogne.fr/?cat=117&s=谷歌霸屏业务【tg:seogoogle987】,Uma
- https://www.safetv.go.kr/base/search/view?searchWord=谷歌霸屏业务【tg:seogoogle987】rt6
- https://www.yli.ro/catalogsearch/result/?q=谷歌霸屏业务【tg:seogoogle987】,NGh
- https://www.paxnet.co.kr/search/jongmok?kwd=谷歌霸屏业务【tg:seogoogle987】gu4
- https://search.danawa.com/dsearch.php?query=谷歌霸屏业务【tg:seogoogle987】dBA
- https://www.tahiti-infos.com/search/谷歌霸屏业务【tg:seogoogle987】,gUf
- https://dict.naver.com/dict.search?dicQuery&query=谷歌霸屏业务【tg:seogoogle987】U2D
- https://www.reallywildbirdfood.co.uk/store/search?q=谷歌霸屏业务【tg:seogoogle987】,sbh
- https://www.madebyoranges.com/nl/search/谷歌霸屏业务【tg:seogoogle987】,GNJ
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=谷歌霸屏业务【tg:seogoogle987】,N87
- https://www.safetv.go.kr/base/search/view?searchWord=谷歌霸屏业务【tg:seogoogle987】Za5
- https://www.nbm.org/?action=QUERY&s=谷歌霸屏业务【tg:seogoogle987】,0sL
- https://www.tarleton.edu/news/search/谷歌霸屏业务【tg:seogoogle987】,DJS