connectexception同时运行hadoop

connectexception同时运行hadoop

本文介绍了java.lang.runtimeexception java.net.connectexception同时运行hadoop pi的例子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在两台机器上配置了hadoop。我可以使用ssh.i访问这两台机器,而无需使用密码使用以下命令已成功格式化namenode: - $ / $>格式

然后我试着运行pi例子,它附带hadoop.tar

  sandip @ master:〜/ hadoop-1.0.4 $ bin / hadoop jar hadoop-examples-1.0.4.jar pi 5 500 
数字的地图= 5
每个地图的样本数= 500
13/04/14 04:13:04信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试0次(s)。
13/04/14 04:13:05信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过1次。
13/04/14 04:13:06信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过2次。
13/04/14 04:13:07信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试了3次。
13/04/14 04:13:08信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过4次。
13/04/14 04:13:09信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过5次。
13/04/14 04:13:10信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过6次。
13/04/14 04:13:11信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试过7次。
13/04/14 04:13:12信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试了8次。
13/04/14 04:13:13信息ipc.Client:重试连接到服务器:
master / 192.168.188.131:9000。已经尝试了9次。
java.lang.RuntimeException:java.net.ConnectException:调用
master / 192.168.188.131:9000连接失败异常:java.net.ConnectException:
连接被拒绝
在org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:546)
在org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:318)
在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.u til.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


解决方案

MG我忘了启动hadoop集群。我通过运行这个命令修正了它: - $ / $>

bin / start-all.sh


i have configured hadoop on two machine. i can access both machine without password using ssh.i have successfully formatted namenode using following command:--

bin/hadoop namenode -format

then i tried to run pi example which shipped with hadoop.tar

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
解决方案

ooh M G i forgot to start hadoop cluster. I Fixed it by running this command:-

bin/start-all.sh

这篇关于java.lang.runtimeexception java.net.connectexception同时运行hadoop pi的例子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 15:32