namenode 格式化错误
就是因为core-site.xml文件中配置路径错误导致无法创建data文件
2021-11-28 21:56:06,106 WARN namenode.NameNode: Encountered exception during format:?
java.io.IOException: Cannot create directory /opt/module/hadoop-3.1.3/data/dfs/name/current
?? ?at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:436)
?? ?at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
?? ?at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
?? ?at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:186)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1202)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2021-11-28 21:56:06,108 ERROR namenode.NameNode: Failed to start namenode.
java.io.IOException: Cannot create directory /opt/module/hadoop-3.1.3/data/dfs/name/current
?? ?at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:436)
?? ?at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
?? ?at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
?? ?at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:186)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1202)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1645)
?? ?at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1755)
2021-11-28 21:56:06,110 INFO util.ExitUtil: Exiting with status 1: java.io.IOException: Cannot create dire
<!-- 指定NameNode的地址 -->
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop102:8020</value>
</property>
<!-- 指定hadoop数据的存储目录 -->
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/module/hadoop-3.1.3/data</value>
</property>
错误原因是我的安装路径是 /opt/model 而配置文件的中路径是/opt/module??
直接导致无法创建文件,重新修改之后就可以了
|