上传文件到HDFS:错误:could only be replicated to 0 nodes, instead of 1

来源:互联网 发布:赛尔网络招聘 编辑:程序博客网 时间:2024/06/06 19:05

上传文件到HDFS一直出现错误could only be replicated to 0 nodes, instead of 1,然后不能上传文件到HDFS。
遇到这种问题可能原因有:
1.slave机器上的datanode没有开启。
解决:
重启集群
重新格式化集群
2.namenode运行在safemode下。
解决:
退出安全模式 hadoop dfsadmin -safemode leave
3.namenode所在的机器的防火墙没有关闭
解决:
关闭防火墙

原因在于centos7
关闭 selinux 和 iptables 不行 要关闭动态防火墙
关闭防火墙:**非常重要**
# systemctl status firewalld.service –查看防火墙状态
# systemctl stop firewalld.service –关闭防火墙
# systemctl disable firewalld.service –永久关闭防火墙

4.dfs的空间不足(我遇到的就是这种情况,因为在虚拟机上搭建的hadoop平台)
解决:
增加硬盘空间;参考:http://www.cnblogs.com/ljy2013/p/4620691.html
重新安装虚拟机,分配更大的硬盘空间

阅读全文
0 0
原创粉丝点击