jakarta-ee - 运行 hadoop pi 示例时出现 java.lang.runtimeexception java.net.connectexception

标签 jakarta-ee hadoop mapreduce hdfs

我已经在两台机器上配置了 hadoop。我可以使用 ssh 在没有密码的情况下访问两台机器。我已经使用以下命令成功格式化了 namenode:--

bin/hadoop namenode -format

然后我尝试运行 hadoop.tar 附带的 pi 示例

sandip@master:~/hadoop-1.0.4$ bin/hadoop jar hadoop-examples-1.0.4.jar pi 5 500
Number of Maps  = 5
Samples per Map = 500
13/04/14 04:13:04 INFO ipc.Client: Retrying connect to server:       
master/192.168.188.131:9000. Already tried 0 time(s).
13/04/14 04:13:05 INFO ipc.Client: Retrying connect to server:                         
master/192.168.188.131:9000. Already tried 1 time(s).
13/04/14 04:13:06 INFO ipc.Client: Retrying connect to server:     
master/192.168.188.131:9000. Already tried 2 time(s).
13/04/14 04:13:07 INFO ipc.Client: Retrying connect to server:   
master/192.168.188.131:9000. Already tried 3 time(s).
13/04/14 04:13:08 INFO ipc.Client: Retrying connect to server:   
master/192.168.188.131:9000. Already tried 4 time(s).
13/04/14 04:13:09 INFO ipc.Client: Retrying connect to server:      
master/192.168.188.131:9000. Already tried 5 time(s).
13/04/14 04:13:10 INFO ipc.Client: Retrying connect to server:     
master/192.168.188.131:9000. Already tried 6 time(s).
13/04/14 04:13:11 INFO ipc.Client: Retrying connect to server:   
master/192.168.188.131:9000. Already tried 7 time(s).
13/04/14 04:13:12 INFO ipc.Client: Retrying connect to server:   
master/192.168.188.131:9000. Already tried 8 time(s).
13/04/14 04:13:13 INFO ipc.Client: Retrying connect to server:    
master/192.168.188.131:9000. Already tried 9 time(s).
java.lang.RuntimeException: java.net.ConnectException: Call to    
master/192.168.188.131: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:616)
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    

最佳答案

哦 M G 我忘了启动 hadoop 集群。我通过运行此命令修复了它:-

bin/start-all.sh

关于jakarta-ee - 运行 hadoop pi 示例时出现 java.lang.runtimeexception java.net.connectexception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15998681/

相关文章:

hadoop - Hive 解释计划理解

hadoop - HDFS存储检查显示不同的值

hadoop - 自动化 H2O 流量 : run flow from CLI

java - Java EE 的安全框架,如seam - JSP、Servlet、DAO

java - 即使选项卡关闭后,Jsp 页面仍在运行

hadoop - RecordReader 的概念

Hadoop 管道 : how to pass large data records to map/reduce tasks

hadoop - 如何刷新Hadoop分布式缓存?

java - JSP中page和this对象的区别

java - 从 Servlet 调用的 Session-Bean 中,SessionContext 始终为 null