Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to check whether CDH5 has Trash enabled

Shulou Source: shulou.com Published: 2022-05-31 12:04:09 10月03日 Update

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.

Tags: Documents folders articles content proper Recycle Bin ideas New knowledge time more steps knowledge knowledge points articles details Industry Information Information Channel follow Channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Shulou Technology Docker MariaDB