hadoop hdfs.DFSClient: DataStreamer Exception

hdfs.DFSClient: DataStreamer Exception: org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /user/root/input/conf/mapred-site.xml could only be replicated to 0 nodes, instead of 1 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock

at org.apache.hadoop.ipc.Client.call(Client.java:740)

---

此错误可以通过命令:bin/hadoop dfsadmin -report 查看,发现都是0KB.
解决方法:
a.rm -rf /tmp/hadoop- user/*hadoop*
b.修改core-site.xml

<configuration>
  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
  </property>
  <property>
    <name>hadoop.tmp.dir</name>
    <value>/tmp/hadoop-ganliang/</value>
  </property>

</configuration>

c.bin/hadoop namenode -format
d.启动hadoop

你可能感兴趣的:(hadoop hdfs.DFSClient: DataStreamer Exception)