我正在安装hadoop。一切顺利,但当我尝试这个命令格式化时:
DataContext
我收到了以下错误:
//Format the name node:
$bin/hdfs namenode -format
我试过> 16/06/30 12:58:12 WARN namenode.NameNode: Encountered exception during
> format: java.io.IOException: Cannot create directory
> /home/dataflair/hdata/dfs/name/current at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:334)
> at
> org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
> at
> org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
> at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:930)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1368)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1493)
> 16/06/30 12:58:12 FATAL namenode.NameNode: Failed to start namenode.
> java.io.IOException: Cannot create directory
> /home/dataflair/hdata/dfs/name/current at
> org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:334)
> at
> org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
> at
> org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
> at
> org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:930)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1368)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1493)
> 16/06/30 12:58:12 INFO util.ExitUtil: Exiting with status 1 16/06/30
> 12:58:12 INFO namenode.NameNode: SHUTDOWN_MSG:
> /************************************************************
> SHUTDOWN_MSG: Shutting down NameNode at rahul-knoldus/127.0.1.1
> ************************************************************/
但它不起作用。
答案 0 :(得分:0)
以下步骤解决了我的问题 -
sudo su
/usr/local/hadoop/bin/hdfs namenode -format