CDH5之Trash
參考:http://my.oschina.net/cloudcoder/blog/179381
檢視CDH 的hdfs的配置,是否開啟trash 及 保留時間:
測試:
點選(此處)摺疊或開啟
-
1.建立test.txt
-
[root@sht-sgmhadoopnn-01 ~]# vi /tmp/test.txt
-
1
-
2
-
3
-
4
-
5
-
-
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
-
1
-
2
-
3
-
4
-
5
-
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
-
1
-
2
-
3
-
4
- 5
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-1990991/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CDH5之Exhausted available authentication methodsH5AI
- CDH5之Unexpected error.Unable to verify database connectionH5ErrorDatabase
- CDH5 Fair scheduler 配置H5AI
- CDH5之Found class jline.Terminal, but interface was expectedH5
- CDH5 叢集安裝教程H5
- os ,shutil,send2trash模組彙總(tcy)
- 《Death Trash》Polygon 前瞻:對老派 RPG 的大膽嘗試Go
- Hadoop回收站及fs.trash引數詳解Hadoop
- CDH5之Balancer難以在快速增長的叢集上平衡大量的資料H5
- CDH5 快速入門手冊v1.0H5
- Arch,Manjaro系統中Atom不能刪除檔案.提示gvfs-trash…JAR
- CDH5大資料實驗平臺搭建筆記H5大資料筆記
- 搭建5個節點的hadoop叢集環境(CDH5)HadoopH5
- Hadoop叢集安裝-CDH5(5臺伺服器叢集)HadoopH5伺服器
- Hadoop叢集安裝-CDH5(3臺伺服器叢集)HadoopH5伺服器
- CDH5部署三部曲之一:準備工作H5
- CDH5部署三部曲之二:部署和設定H5
- CDH5部署三部曲之三:問題總結H5
- 離線安裝Cloudera Manager 5和CDH5(最新版5.9.3) 完全教程(七)介面安裝CloudH5
- 透過Shell指令碼自動安裝Hive&JDBC測試&提供CDH5網盤地址指令碼HiveJDBCH5
- oracle之 RAC Interconnect之HAIPOracleAI
- 漢字之美,拼音之韻
- Python基礎之(三)之字典Python
- 設計模式之禪之代理模式設計模式
- 程式碼之美---遞迴之美遞迴
- 科學之抽象管理之提升抽象
- JavaScript之thisJavaScript
- 若之
- 深入Spring之IOC之載入BeanDefinitionSpringBean
- PHP之string之ord()函式使用PHP函式
- 《碼農翻身》之浪潮之巔的WebWeb
- vue 兄弟元件之間傳值之busVue元件
- 架構之爭,體制之惑(1)--產品經理模式之弊論架構模式
- 前端之資料模擬之Mock.js前端MockJS
- 軟體測試江湖之公會武器之爭
- Java常用資料結構之Set之TreeSetJava資料結構
- AI犯錯誰之過?切勿盲目相信之AI
- React之元件(component)之間的通訊React元件