[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -allowSnapshot data
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -createSnapshot data ss1
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -lsr /user/xiaoqiu/data/.snapshot/ss1
lsr: DEPRECATED: Please use 'ls -R' instead.
-rw-r--r-- 2 xiaoqiu supergroup 4 2017-12-29 16:08 /user/xiaoqiu/data/.snapshot/ss1/1.txt
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:57 /user/xiaoqiu/data/.snapshot/ss1/a
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:57 /user/xiaoqiu/data/.snapshot/ss1/a/b
[xiaoqiu@s150 /home/xiaoqiu]$
[xiaoqiu@s150 /home/xiaoqiu]$ echo aaa > 2.txt
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -appendToFile 2.txt data/1.txt
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -cat data/1.txt
123
aaa
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -cat data/.snapshot/ss1
cat: `data/.snapshot/ss1': Is a directory
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -cat data/.snapshot/ss1/1.txt
123
[xiaoqiu@s150 /home/xiaoqiu]$
[xiaoqiu@s150 /home/xiaoqiu]$ hdfs dfs -deleteSnapshot data ss1
欢迎关注我的公众号:小秋的博客
CSDN博客:https://blog.csdn.net/xiaoqiu_cr
github:https://github.com/crr121
联系邮箱:rongchen633@gmail.com
有什么问题可以给我留言噢~