Shell HDFS命令行附加

Shell HDFS命令行附加,shell,command-line,hadoop,append,hdfs,Shell,Command Line,Hadoop,Append,Hdfs,是否有任何方法可以从命令行附加到HDFS上的文件,如复制文件: hadoop fs -copyFromLocal <localsrc> URI hadoop fs-copyFromLocal URI cli不支持追加,但httpfs和fuse都支持追加文件 w301% ls -lA total 0 -rw-r--r-- 1 hdfs supergroup 0 Nov 14 01:02 test.me w301% cat test.me w301% sync w301% cat te

是否有任何方法可以从命令行附加到HDFS上的文件,如复制文件:

hadoop fs -copyFromLocal <localsrc> URI
hadoop fs-copyFromLocal URI
cli不支持追加,但httpfs和fuse都支持追加文件

w301% ls -lA
total 0
-rw-r--r-- 1 hdfs supergroup 0 Nov 14 01:02 test.me
w301% cat test.me
w301% sync
w301% cat test.me
hello
w301% echo "more rows" >> test.me
w301% sync
w301% cat test.me 
hello
more rows

编辑:但请记住,只有一个客户端可以附加到文件。

此功能在Hadoop 2.3.0中实现,语法如下:

hdfs dfs -appendToFile localfile /user/hadoop/hadoopfile
(2009年首次提出HDFS追加功能时:
)

您知道关于设置httpfs或fuse并尝试append的明确说明的任何参考资料吗?我尝试了httpfs,但失败了。我的意思是hdfs 2.0中的httpfs在fuse的情况下,您只需使用append标志打开文件(通常使用您喜欢的语言或shell中的>>),然后写入文件。最近的保险丝应正确处理此标志