HA启动datanode节点,添加数据失败,并且datanode节点直接挂掉。报错信息:hdfs.DFSClient: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /README.txt.COPYING 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.
1.可能进行了多次格式化namenode。清除dfs.namenode.name.dir和dfs.datanode.data.dir指定的文件夹、还有tmp文件夹。重新格式化namenode节点重启解决。
2.如果步骤1的方法还是不行,吧zookeeper中tmp下除了myid的其他文件也都删除,重启zookeeper并继续步骤1中的步骤。