您好,登錄后才能下訂單哦!
本文小編為大家詳細介紹“怎么查看CDH5是否開啟Trash”,內容詳細,步驟清晰,細節處理妥當,希望這篇“怎么查看CDH5是否開啟Trash”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學習新知識吧。
1.創建test.txt
[root@sht-sgmhadoopnn-01 ~]# vi /tmp/test.txt
2.創建文件夾
[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 文件到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.刪除文件夾testdir
[root@sht-sgmhadoopnn-01 ~]# hadoop fs -rm -r /testdir
16/02/19 08:27:05 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.查看回收站
[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.恢復文件夾
[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
讀到這里,這篇“怎么查看CDH5是否開啟Trash”文章已經介紹完畢,想要掌握這篇文章的知識點還需要大家自己動手實踐使用過才能領會,如果想了解更多相關內容的文章,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。