HDFS写文件异常

HDFS写文件异常

上传文件时发生hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /VERSION.txt.COPYING could only be replicated to 0 nodes instead of minReplication (=1). There are 3 datanode(s) running and no node(s) are excluded in this operation.异常。

可以创建目录,但不能上传文件,首先想到的是DataNode与NameNode的连接异常,查看配置文件发现没有问题。然后使用report命令,发现DFS Used :100%。因为是新装的系统,没有写入过文件,不可能磁盘已经满了,应该是哪里出现了问题。查看Linux的磁盘大小,一个盘有28G的磁盘大小,然后去hdfs-site.xml文件看dfs.datanode.du.reserved的大小,发现大于28G。**dfs.datanode.du.reserved表示的是datanode在对磁盘写数据的时候,保留多少空间给非HDFS使用。这个参数主要是为了防止磁盘空间被写满导致的HDFS异常。**空间-=HDFS+非HDFS。非HDFS》空间,导致HDFS没有空间可用。调小这个参数,然后就可以正常写入了。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xkeYpzzn-1636080701285)(https://i.loli.net/2021/11/05/den3CuXtvbF9Lhk.png)]

猜你喜欢

转载自blog.csdn.net/xiaoshazheng/article/details/121158568