中午去熱飯的時候 一童鞋提到了這個參數(shù)。
飯后回來查了一下這個參數(shù),在hdfs-default.xml中
找到了這個參數(shù),發(fā)現(xiàn)默認(rèn)是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 也是一樣沒有更改,默認(rèn)是false。
那么為什么呢。其實(shí)看一下description就知道了這個不支持集群中使用。
如果同時多個程序在操作同一份文件,就會引起文件的沖突。
那這個參數(shù)用在什么場景的呢?
在做mapreduce的過程中,hadoop framwork會產(chǎn)生很多的臨時數(shù)據(jù),
在reduce出結(jié)果后 把內(nèi)容輸出到指定的目錄,
那么在mapreduce的過程中,我們需要把部分內(nèi)容存儲到hdfs中怎么辦呢。
這時候可以開發(fā)人員可以使用FileSystem來把文件存儲到hdfs中。
這時候就會使用到dfs.support.append參數(shù)了。