我正在使用以下站点在 Ubuntu 10.10 http://arifn.web.id/blog/2010/07/29/running-hadoop-single-cluster.html中安装和配置 Hadoop
但是,当我尝试格式化 Hadoop 文件系统时,出现以下错误。
amathew@amathew-Dimension-3000:~$ cd /usr/local/hadoop
amathew@amathew-Dimension-3000:/usr/local/hadoop$ bin/hadoop namenode -format
11/04/16 21:23:07 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = amathew-Dimension-3000/192.168.1.66
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 0.20.2
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
11/04/16 21:23:08 INFO namenode.FSNamesystem: fsOwner=amathew,amathew,adm,dialout,cdrom,plugdev,lpadmin,admin,sambashare
11/04/16 21:23:08 INFO namenode.FSNamesystem: supergroup=supergroup
11/04/16 21:23:08 INFO namenode.FSNamesystem: isPermissionEnabled=true
11/04/16 21:23:08 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /usr/local/hadoop-datastore/hadoop/dfs/name/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:295)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1086)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)
11/04/16 21:23:08 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at amathew-Dimension-3000/192.168.1.66
************************************************************/
任何人都可以帮助解决这些错误消息,即ERROR namenode.NameNode: java.io.IOException: Cannot create directory /usr/local/hadoop-datastore/hadoop/dfs/name/current
.
$ sudo mkdir /usr/local/hadoop/datastore
$ sudo chown hadoop:hadoop /usr/local/hadoop/datastore
$ sudo chmod 750 /usr/local/hadoop/datastore
Hadoop 无法创建
/usr/local/hadoop-datastore/hadoop/dfs/name/current
目录。尝试运行这个:
使用 .I 运行 Hadoop 可执行文件
sudo
我不确定,但我认为当我安装 Hadoop 时它对我不起作用。如果是这样,请执行以下操作:然后:
假设hadoop安装在
$HADOOP_HOME
,我们要修改目录名在/$HADOOP_HOME/conf/core-site.xml
$HOME 具有读、写权限,因此可以创建目录。
由于权限问题,这失败了。
下面使用:
然后格式化namenode: