posts - 110, comments - 101, trackbacks - 0, articles - 7
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

中午去热饭的时候 一童鞋提到了这个参数。
饭后回来查了一下这个参数,在hdfs-default.xml中
找到了这个参数,发现默认是false。
<property>
  <name>dfs.support.append</name>
  <value>false</value>
  <description>Does HDFS allow appends to files?
               This is currently set to false because there are bugs in the
               "append code" and is not supported in any prodction cluster.
  </description>
</property>

我用的版本是1.0.1,顺便看了下1.0.2 也是一样没有更改,默认是false。
那么为什么呢。其实看一下description就知道了这个不支持集群中使用。
如果同时多个程序在操作同一份文件,就会引起文件的冲突。
那这个参数用在什么场景的呢?
在做mapreduce的过程中,hadoop framwork会产生很多的临时数据,
在reduce出结果后 把内容输出到指定的目录,
那么在mapreduce的过程中,我们需要把部分内容存储到hdfs中怎么办呢。
这时候可以开发人员可以使用FileSystem来把文件存储到hdfs中。
这时候就会使用到dfs.support.append参数了。









只有注册用户登录后才能发表评论。


网站导航: