我正在使用本教程来设置第一个hadoop项目:
http://hadoop.apache.org/docs/r0.18.3/mapred_tutorial.html#Source+Code
我被这一节搞糊涂了:
Sample text-files as input:
$ bin/hadoop dfs -ls /usr/joe/wordcount/input/
/usr/joe/wordcount/input/file01
/usr/joe/wordcount/input/file02
$ bin/hadoop dfs -cat /usr/joe/wordcount/input/file01
Hello World Bye World
$ bin/hadoop dfs -cat /usr/joe/wordcount/input/file02
Hello Hadoop Goodbye Hadoop如何创建file01和file02文件?
当我运行上面的命令()时,我收到了这样的错误:“文件不存在/usr/joe/wordcount/input/file01”
发布于 2013-03-05 11:14:46
您可以使用cygwin上的文件编辑器( vim或emacs(不确定))来创建文件。
或者,您可以复制下面的粘贴以创建文件。
echo "Hello World Bye World" > /usr/joe/wordcount/input/file01
echo "Hello Hadoop Goodbye Hadoop" > /usr/joe/wordcount/input/file02还有其他更具巴洛克风格的技术可以将简单的数据放入文件中,但是根据您的问题定义,这种方法应该可以很好地工作。
(另一种可能性是...这些文件会不会是测试或教程安装的一部分,而您错过了运行安装的一个步骤?如果一旦创建了这些文件,并且遇到新的错误消息,请考虑dbl-检查您的步骤以确认所有文件都已正确安装)
IHTH
发布于 2013-04-02 17:20:25
你指的是同一条路径??否则,使用copyFromLocal命令从本地文件system.Then创建文件,将其放入HDFS。然后cat文件路径/filename。这是可行的。
bin/hadoop fs -copyFromLocal /path/to/file/in/localfilesys/file01 /usr/joe/wordcount/input
bin/hadoop fs -cat /usr/joe/wordcount/input/file01https://stackoverflow.com/questions/15210965
复制相似问题