Recycle Bin mechanism
1). The Recycle Bin mechanism for HDFS is set by the Fs.trash.interval property (in minutes) in Core-site.xml, which defaults to 0, which means that it is not enabled. Note: The configuration value should be 1440, while the configuration 24*60 throws a NumberFormatException exception (pro-Test).
2). When the Recycle Bin feature is enabled, each user has a separate Recycle Bin directory, which is the home directory. Trash directory.
Execute Delete dfs-rm command
dfs-rm /test/in/small/small_data15/08/27 01:51:48 INFO fs. Trashpolicydefault:namenode Trash configuration:deletion interval = 1440 minutes, emptier interval = 0' HDF S://ncst:9000/test/in/small/small_data ' to trash at: hdfs://ncst:9000/user/root/. Trash/current
View Recycle Bin Content
[[email protected] sbin]# HDFs DFS-ls /user/root/. trash/1 itemsdrwx------ -root supergroup 0- - A: /user/root/. Trash/current/test
Recovering deleted files
[[email protected] sbin]# HDFs DFS-mv /user/root/. trash/current/test/in/small/small_data/test/in/small/small_data
Completely delete the HDFs file ( that is, delete the files in the Recycle bin)
[[email protected] sbin]# HDFs DFS-rm /user/root/. trash/current/test/in/small/small_data
Safe Mode
When NN starts, it first loads the fsimage into memory and then executes each action in the edits file one by one. Once you have successfully built HDFS in memory, the latest
Metadata image, the latest metadata is flush to the local disk, a new Fsimage file is generated ( this operation does not need to use SNN) and an empty (not necessarily empty!) Edits file, this process is called the check-point checkpoint.
When the Check-point is complete, the NN begins to listen for RPC and HTTP requests. But at the moment, the NN runs in safemode, which is read-only by HDFs for the Client.
To see if the NN is in Safe mode
HDFs Dfsadmin- safemode getSafe mode is OFF
Temporarily exit Safe Mode
Wait
Enter Safe mode
[Email protected] sbin]# HDFs dfsadmin-EnterSafe mode is on
Leave Safe Mode
[Email protected] sbin]# HDFs dfsadmin-leaveSafe mode is OFF
HDFs Recycle Bin && Safe Mode