could only be replicated to 0 nodes instead of minReplication (=1). There are 1 datanode(s) running

Hadoop Java API 开发操作时hdfs 时出现如下错误:

先翻译一把:

could only be replicated to 0 nodes instead of minReplication (=1).  There are 1 datanode(s) running

只能复制到0个节点,而不是minReplication(=1)。有一个datanode(s)运行

就是说:多个nodedata要做副本处理,结果当前只有一个节点,但是不能到这一个节点。因此失败:为什么失败呢 ???

就是尼玛的端口问题,不知道的朋友,把Linux的防火墙关了即可:

或者加上这一个行:centos7  的解决办法,50020、50010 端口开启即可:

# firewall-cmd --permanent --add-port=50020/tcp

# firewall-cmd --permanent --add-port=50010/tcp

然后再重启防火墙:systemctl restart firewalld.service 

org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /hdfsapi/test/liuxing1.txt could only be replicated to 0 nodes instead of minReplication (=1).  There are 1 datanode(s) running and 1 node(s) are excluded in this operation.

at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1073)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2086)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2082)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)

at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2080)



端口开启就是:50010 

Hadoop 端口使用的详情:
https://blog.csdn.net/jeffiny/article/details/78728965



  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值