5 月 312016
 

一:hdfs修改replication 数目

执行 hadoop fsck /  查看整个目录的备份数分布,输出结果如下:

        Default replication factor  2

        Average block replication 2.38

改hdfs文件备份系数:hadoop dfs -setrep [-R] <path> 如果有-R将修改子目录文件的性质。

hadoop dfs -setrep -w 1 -R /user/hadoop/dir1 就是把目录下所有文件备份系数设置为1.

这个需要一些时间,感觉会扫描所有指定目录下的文件。

二:hdfs删除目录

参考url:https://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html

./hdfs dfs -rmr /logdata

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny