2013-02-13 125 views
1

我想运行示例pi地图红色示例代码。在伪分布式模式下运行时发生以下错误。我已经按照hadoop网站的指示完成了所有设置。我安装了ssh并且配置文件也正确设置了。错误运行hadoop示例代码


[email protected]:~/hadoop-1.0.4$ sudo bin/hadoop jar hadoop-examples-1.0.4.jar pi 10 10 
Number of Maps = 10 
Samples per Map = 10 
13/02/13 14:47:34 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s). 
13/02/13 14:47:35 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 1 time(s). 
13/02/13 14:47:36 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 2 time(s). 
13/02/13 14:47:37 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 3 time(s). 
13/02/13 14:47:38 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 4 time(s). 
13/02/13 14:47:39 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 5 time(s). 
13/02/13 14:47:40 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 6 time(s). 
13/02/13 14:47:41 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 7 time(s). 
13/02/13 14:47:42 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 8 time(s). 
13/02/13 14:47:43 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 9 time(s). 
java.lang.RuntimeException: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused 
    at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:546) 
    at org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:318) 
    at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:265) 
    at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342) 
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) 
    at org.apache.hadoop.examples.PiEstimator.main(PiEstimator.java:351) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) 
    at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) 
    at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.apache.hadoop.util.RunJar.main(RunJar.java:156) 
Caused by: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused 
    at org.apache.hadoop.ipc.Client.wrapException(Client.java:1099) 
    at org.apache.hadoop.ipc.Client.call(Client.java:1075) 
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225) 
    at $Proxy1.getProtocolVersion(Unknown Source) 
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396) 
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379) 
    at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119) 
    at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:238) 
    at org.apache.hadoop.hdfs.DFSClient.(DFSClient.java:203) 
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89) 
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386) 
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66) 
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404) 
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254) 
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123) 
    at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:542) 
    ... 17 more 
Caused by: java.net.ConnectException: Connection refused 
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) 
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:692) 
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) 
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489) 
    at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:434) 
    at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:560) 
    at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:184) 
    at org.apache.hadoop.ipc.Client.getConnection(Client.java:1206) 
    at org.apac 

有人可以帮助我确定为什么上述错误即将到来,以及如何纠正它。

回答

1

这个问题是当系统上的Datanode守护进程使用“JPS”不start.check启动的守护进程command.If它没有启动,手动启动Datanode的守护程序通过使用命令:
斌/ Hadoop的守护进程。 sh启动datanode。

+0

心不是帮助解决问题 – Bala 2013-02-13 10:15:21

+0

如果上述评论不会帮助你,尝试其他的事情。删除您的日志文件和您在hdfs.site.xml中的“dfs.data.dir”属性文件中输入的文件。格式化系统并再次启动所有守护程序。这可能会解决您的问题。 – 2013-02-13 11:21:26

0

就我而言,我提到Namenode not getting started的帖子,我可以解决这个问题。

  1. 删除您在core-site.xml中设置的tmp目录。
  2. 的Hadoop名称节点-format
  3. start-dfs.sh或start-all.sh
  4. JPS