2 sinat 34375263 sinat_34375263 于 2016.09.21 20:08 提问

hadoop,windows连接虚拟机伪分布集群报错ConnectException

Exception in thread "main" java.net.ConnectException: Call From DESKTOP-6KJ4P0D/192.168.50.182 to 192.168.50.170:9000 failed on connection exception: java.net.ConnectException: Connection refused: no further information; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:791)
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:731)
at org.apache.hadoop.ipc.Client.call(Client.java:1473)
at org.apache.hadoop.ipc.Client.call(Client.java:1400)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
at com.sun.proxy.$Proxy14.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:752)
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:606)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
at com.sun.proxy.$Proxy15.getFileInfo(Unknown Source)
at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1977)
at org.apache.hadoop.hdfs.DistributedFileSystem$18.doCall(DistributedFileSystem.java:1118)
at org.apache.hadoop.hdfs.DistributedFileSystem$18.doCall(DistributedFileSystem.java:1114)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1114)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1400)
at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:145)
at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:267)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:140)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1297)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1294)
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:1656)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1294)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1315)
at mr.WordCountJob.main(WordCountJob.java:36)
Caused by: java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:530)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:494)
at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:608)
at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:706)
at org.apache.hadoop.ipc.Client$Connection.access$2800(Client.java:369)
at org.apache.hadoop.ipc.Client.getConnection(Client.java:1522)
at org.apache.hadoop.ipc.Client.call(Client.java:1439)
... 28 more

我看了一下包,先发了一个包, linux回复了一次,然后假重传两次后就结束了。
232 33.612799   192.168.50.182  192.168.50.170  TCP 66  64504→9000 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
233 33.613038   192.168.50.170  192.168.50.182  TCP 54  9000→64504 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0
235 34.114138   192.168.50.182  192.168.50.170  TCP 66  [TCP Spurious Retransmission] 64504→9000 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1
236 34.114369   192.168.50.170  192.168.50.182  TCP 54  9000→64504 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

大大们告诉我一下是什么问题?

1个回答

hijack00
hijack00   Rxr 2016.09.29 09:17

看到上面的抓包信息提示你的TCP连接被RST了,感觉可能是因为你在windows下连接虚拟机中的hadoop集群(Linux)导致的。
一般没有人像你这么干吧?惯例要么就是都在Linux系统下进行操作,要么就是在Windows下利用ssh客户端远程连到hadoop集群上去再进行操作。

也有可能你的hadoop配置不对。

hijack00
hijack00 嗯嗯,建议不要直接使用IP地址,因为IP地址可能会变动,采用主机名是一个更好的选择。另外,如果条件允许,完全可以再克隆几台虚拟机搭个完全分布式hadoop集群,配置和伪分布式差不多
大约一年之前 回复
sinat_34375263
sinat_34375263 谢谢,昨天刚刚解决这个问题,的确是配置不对。我在linux下hadoop配置文件core-site.xml和maperd-site.xml中配置的地址是localhost,改为虚拟机的实际地址就行了。
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片