中午去熱飯的時候 一童鞋提到了這個參數。
飯后回來查了一下這個參數,在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參數了。