当前位置: 首页 > hadoop, 分布式系统 > 正文

cygwin hadoop windows7异常(二)

1 星2 星3 星4 星5 星 (1 次投票, 评分: 5.00, 总分: 5)
Loading ... Loading ...
baidu_share

在windows7,cygwin环境下启动单个hadoop集群。

bin/start-all.sh ;

进入http://localhost:50070/查看。Cluster Summary里面的Live Nodes为0.进入logs文件查看日志

2013-09-29 10:46:06,340 ERROR org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:Administrator cause:java.io.IOException: File /tmp/hadoop-Administrator/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
2013-09-29 10:46:06,340 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 9000, call addBlock(/tmp/hadoop-Administrator/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_-1379663332_1, null) from 127.0.0.1:52615: error: java.io.IOException: File /tmp/hadoop-Administrator/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
java.io.IOException: File /tmp/hadoop-Administrator/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
	at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1920)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:783)
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:587)
	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1432)
	at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1428)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:415)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
	at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1426)

网上答案:解决办法是删除掉data.dir(我的为tmp)目录,我查了一下,删除的是如下这个目录:D:\tmp\hadoop-Administrator。
然后再运行

bin/hadoop namenode -format ;

问题依旧。最后找到问题答案,我没有运行:

ssh localhost

运行上述命令,在启动hadoop集群,出现异常消失。Live Nodes为1.

在hadoop官方文档:single_node_setup.html如果没有运行ssh localhost,可以运行以下命令:

$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

这个方法在windows7 cygwin下是不行的,上述异常还是存在,Live Nodes为0.

本文固定链接: http://www.chepoo.com/cygwin-hadoop-windows7-error-2.html | IT技术精华网

cygwin hadoop windows7异常(二):等您坐沙发呢!

发表评论