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