苏童 发表于 2018-10-30 12:38:18

Hadoop 2.x 快照

$ ./bin/hdfs dfsadmin -allowSnapshot /  
Allowing snaphot on / succeeded
  
$ ./bin/hdfs dfs -put ../test1.txt /test1.txt
  
$ ./bin/hdfs dfs -ls /
  
Found 1 items
  
-rw-r--r--   1 hadoop supergroup         12 2014-08-31 23:26 /test1.txt
  
$ ./bin/hdfs dfs -createSnapshot /
  
Created snapshot /.snapshot/s20140831-232654.464
  
$ ./bin/hdfs dfs -ls /.snapshot
  
Found 2 items
  
drwxr-xr-x   - hadoop supergroup          0 2014-08-31 23:24 /.snapshot/s20140831-232445.185
  
drwxr-xr-x   - hadoop supergroup          0 2014-08-31 23:26 /.snapshot/s20140831-232654.464
  

  
#恢复快照
  
$ ./bin/hdfs dfs -mkdir /tmp
  
$ ./bin/hdfs dfs -cp /.snapshot/s20140831-232654.464 /tmp
  
$ ./bin/hdfs dfs -cat /tmp/s20140831-232654.464/test1.txt
  
hello world


页: [1]
查看完整版本: Hadoop 2.x 快照