将文件从本地系统复制到 HDFS 时出现以下错误,我使用的是单节点
13/08/04 10:50:02 WARN hdfs.DFSClient: DataStreamer Exception: java.io.IOException: File /user/vishu/input 只能复制到 0 个节点,而不是 1 个
我删除了 dfs/Name 和 dfs/data 目录并格式化了 Namenode 仍然没有用。我有足够的空间来复制数据。
任何人都可以帮助解决这个问题吗?
问候, 维什瓦
有时数据节点可能启动缓慢,这可能会导致上述问题.. 在 dfs 和 mapred 恶魔启动后保持一些等待时间。
bin/hadoop 名称节点格式
bin/start-dfs.sh
等待大约 5 分钟(数据节点将及时启动)
bin/start-mapred.sh
Check whether all daemons are started or not. make sure that your input file is correct.
Use the following command to copy the file from local to hdfs:
bin/hadoop fs -mkdir abc
bin/hadoop fs -copyFromLocal inputfile abc
如果您写入文件的客户端在集群之外,请确保客户端可以访问 Datanode。
看看这个http://www.hadoopinrealworld.com/could-only-be-replicated-to-0-nodes/