HDFs Recycle Bin && Safe Mode

Source: Internet
Author: User
Tags hdfs dfs

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.