Hadoop集群无法启动datanode的解决方法

之前在hadoop在一起重启之后就不能看到datanode的启动,其中logs的日志显示:

2017-07-15 10:30:09,496 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 9000, call org.apache.hadoop.hdfs.protocol.ClientProtocol.addBlock from 192.168.86.20:8585 Call#48 Retry#0
java.io.IOException: File /wordcount/input/aaa.txt could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.
at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1559)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3245)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:663)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:482)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:619)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:975)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2040)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2036)
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:1656)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2034)

在多次hadoop namenode -format无效之后,查阅网上资料之后才知道需要将之前的datanode的logs和data存储文件都删除之后才能格式化

1.将core-site.xml中配置的dfs.data.dir文件夹删除然后重建,再将logs的文件夹删除之后重建

2.再将hdfs格式化:hadoop namenode -format

Hadoop集群无法启动datanode的解决方法_第1张图片

Hadoop集群无法启动datanode的解决方法_第2张图片

Hadoop集群无法启动datanode的解决方法_第3张图片

你可能感兴趣的:(hadoop)