Hadoop 在格式化 namenode 时出现以下问题:

dalu~ 发布于 2012/10/24 16:56
阅读 47K+
收藏 0

 格式化仍输出如下:

hadoop@ubuntu :~$ hadoop namenode -format
^[[3~12/10/24 16:51:41 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = ubuntu/127.0.1.1
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 1.1.0
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1394289; compiled by 'hortonfo' on Thu Oct  4 22:06:49 UTC 2012
************************************************************/
12/10/24 16:51:41 INFO util.GSet: VM type       = 32-bit
12/10/24 16:51:41 INFO util.GSet: 2% max memory = 19.33375 MB
12/10/24 16:51:41 INFO util.GSet: capacity      = 2^22 = 4194304 entries
12/10/24 16:51:41 INFO util.GSet: recommended=4194304, actual=4194304
12/10/24 16:51:41 INFO namenode.FSNamesystem: fsOwner=hadoop
12/10/24 16:51:41 INFO namenode.FSNamesystem: supergroup=supergroup
12/10/24 16:51:41 INFO namenode.FSNamesystem: isPermissionEnabled=true
12/10/24 16:51:41 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
12/10/24 16:51:41 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
12/10/24 16:51:41 INFO namenode.NameNode: Caching file names occuring more than 10 times
12/10/24 16:51:41 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /export/home/dfs/name/current
 at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:294)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1324)
 at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1343)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1200)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1391)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1412)

12/10/24 16:51:41 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ubuntu/127.0.1.1
************************************************************/

百度上搜的方法如下:可没解决。。。。

解法一:帮 /home/hadoop 加入其他使用者也可以写入的权限

    sudo chmod -R a+w /home/hadoop/tmp

 解法二:改用 user 身份可以写入的路径 hadoop.tmp.dir 的路径 - 修改 core-site.xml

 <property>

<name>hadoop.tmp.dir</name>

  <value>/tmp/hadoop-${user.name}</value>

  </property>

加载中
0
矜兰
矜兰

应该是权限不够用。你试一下 mkdir /export/home/dfs/name/current目录你是否能创建目录。

dalu~
dalu~
回复 @矜兰 : namenode没有初始化。重启后格式化后,还是没有初始化
矜兰
矜兰
回复 @dalu~ : mkdir -p
dalu~
dalu~
mkdir: cannot create directory `/export/home/dfs/name/current': No such file or directory
dalu~
dalu~
好的,今天休息,明天上班试下。谢啦。
0
dalu~
dalu~

引用来自“矜兰”的答案

应该是权限不够用。你试一下 mkdir /export/home/dfs/name/current目录你是否能创建目录。

hadoop@ubuntu :/usr/local/hadoop/bin$ hadoop namenode -format
12/10/26 11:19:54 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = ubuntu/127.0.1.1
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 1.1.0
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1394289; compiled by 'hortonfo' on Thu Oct  4 22:06:49 UTC 2012
************************************************************/
Re-format filesystem in /export/home/dfs/name ? (Y or N) y
Format aborted in /export/home/dfs/name
12/10/26 11:19:56 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ubuntu/127.0.1.1
************************************************************/
hadoop@ubuntu :/usr/local/hadoop/bin$ start-all.sh
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-namenode-ubuntu.out
localhost: starting datanode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-datanode-ubuntu.out
localhost: starting secondarynamenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-secondarynamenode-ubuntu.out
starting jobtracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-jobtracker-ubuntu.out
localhost: starting tasktracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-tasktracker-ubuntu.out
hadoop@ubuntu :/usr/local/hadoop/bin$ jps
4601 Jps
4343 JobTracker
4259 SecondaryNameNode
4561 TaskTracker
hadoop@ubuntu :/usr/local/hadoop/bin$
0
矜兰
矜兰

/export/home 在这个目录删除 dfs/name/current 试下

0
dalu~
dalu~

引用来自“矜兰”的答案

/export/home 在这个目录删除 dfs/name/current 试下

重启格式化之后如下:

 

hadoop@ubuntu :/usr/local/hadoop/bin$ stop-all.sh
stopping jobtracker
localhost: stopping tasktracker
no namenode to stop
localhost: no datanode to stop
localhost: stopping secondarynamenode
hadoop@ubuntu :/usr/local/hadoop/bin$ start-all.sh
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-namenode-ubuntu.out
localhost: starting datanode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-datanode-ubuntu.out
localhost: starting secondarynamenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-secondarynamenode-ubuntu.out
starting jobtracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-jobtracker-ubuntu.out
localhost: starting tasktracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hadoop-tasktracker-ubuntu.out
hadoop@ubuntu :/usr/local/hadoop/bin$ jps
6740 JobTracker
6998 Jps
6656 SecondaryNameNode
6958 TaskTracker
hadoop@ubuntu :/usr/local/hadoop/bin$ hadoop namenode -format
12/10/26 11:46:26 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = ubuntu/127.0.1.1
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 1.1.0
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1394289; compiled by 'hortonfo' on Thu Oct  4 22:06:49 UTC 2012
************************************************************/
Re-format filesystem in /export/home/dfs/name ? (Y or N) y
Format aborted in /export/home/dfs/name
12/10/26 11:46:28 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ubuntu/127.0.1.1
************************************************************/
 仍未启动namenode。。。。。。。。。

0
震秦
震秦

我之前遇见了和你同样的问题.

执行:

sudo chmod -R 775 you_datanode_path

sudo chmod -R 755 you_namenode_path

0
矜兰
矜兰
你是不是只删除了current 呀? 要把dfs删除
0
dalu~
dalu~

引用来自“震秦”的答案

我之前遇见了和你同样的问题.

执行:

sudo chmod -R 775 you_datanode_path

sudo chmod -R 755 you_namenode_path

 

datanode和namenode的位置在哪?
0
震秦
震秦

core-site.xml

<property>  
    <name>hadoop.tmp.dir</name>  
    <value>/data/hadoop/datastore</value>  
  </property>
hdfs-silt.xml

<property>  
    <name>dfs.data.dir</name>  
    <value>/data/hadoop/datanode</value>  
  </property>
datanode需要是775

0
震秦
震秦

core-site.xml

<property>  
    <name>hadoop.tmp.dir</name>  
    <value>/data/hadoop/datastore</value>  
  </property>
hdfs-silt.xml

<property>  
    <name>dfs.data.dir</name>  
    <value>/data/hadoop/datanode</value>  
  </property>
datanode需要是775

dalu~
dalu~
好像我的配置文件出错了,一个网友远程帮我弄好了,说实话没怎么看懂。。。
0
wangxi得
wangxi得
应该是权限的问题
返回顶部
顶部