Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check whether CDH5 has Trash enabled

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to check whether CDH5 opens Trash". The content is detailed, the steps are clear, and the details are handled properly. I hope this "how to check whether CDH5 is enabled or not to open Trash" article can help you solve your doubts.

Check the configuration of hdfs in CDH, whether trash is enabled and retention time:

Test:

1. Create test.txt

[root@sht-sgmhadoopnn-01 ~] # vi / tmp/test.txt

two。 Create a folder

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-mkdir / testdir

You have new mail in / var/spool/mail/root

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-ls /

Found 4 items

Drwxr-xr-x-hdfs supergroup 0 2016-02-04 00:38 / system

Drwxr-xr-x-root supergroup 0 2016-02-19 08:17 / testdir

Drwxrwxrwt-hdfs supergroup 0 2016-02-10 16:04 / tmp

Drwxr-xr-x-hdfs supergroup 0 2016-02-10 16:02 / user

3.put file to hadoop

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-put / tmp/test.txt / testdir

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-ls / testdir

Found 1 items

-rw-r--r-- 3 root supergroup 10 2016-02-19 08:18 / testdir/test.txt

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-cat / testdir/test.txt

You have mail in / var/spool/mail/root

4. Delete folder testdir

[root@sht-sgmhadoopnn-01] # hadoop fs-rm-r / testdir

08:27:05 on 16-02-19 INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = 1440 minutes, Emptier interval = 0 minutes.

Moved: 'hdfs://sgm-nameservice/testdir' to trash at: hdfs://sgm-nameservice/user/root/.Trash/Current

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-ls /

Found 3 items

Drwxr-xr-x-hdfs supergroup 0 2016-02-04 00:38 / system

Drwxrwxrwt-hdfs supergroup 0 2016-02-10 16:04 / tmp

Drwxr-xr-x-hdfs supergroup 0 2016-02-10 16:02 / user

You have mail in / var/spool/mail/root

5. View the Recycle Bin

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-ls / user/root/.Trash/Current

Found 1 items

Drwxr-xr-x-root supergroup 0 2016-02-19 08:18 / user/root/.Trash/Current/testdir

6. Restore folder

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-mv / user/root/.Trash/Current/testdir /

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-ls /

Found 4 items

Drwxr-xr-x-hdfs supergroup 0 2016-02-04 00:38 / system

Drwxr-xr-x-root supergroup 0 2016-02-19 08:17 / testdir

Drwxrwxrwt-hdfs supergroup 0 2016-02-10 16:04 / tmp

Drwxr-xr-x-hdfs supergroup 0 2016-02-10 16:02 / user

[root@sht-sgmhadoopnn-01 ~] # hadoop fs-cat / testdir/test.txt

After reading this, the article "how to check whether CDH5 enables Trash" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 300

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report