1

我在执行从我的 eclipewindows到在同一台机器 hadoop Pseudo cluster上运行的 mapreduce 程序时遇到问题。Ubuntu VM

我正在跑步hadoop 1.0.3。我也尝试过eclipse JunoGanymedeeclipse plugin 1.0.3没有成功。每当我将 my 添加Linux VM为 mapreduce 位置时,都会出现连接错误。

我还尝试通过如下配置直接设置属性,但没有进一步的运气。我将其作为java application.

Configuration conf = new Configuration();
conf.set("fs.default.name", "hdfs://192.168.65.132:8020/");
conf.set("mapred.job.tracker", "192.168.65.132:8021");
conf.set("hadoop.job.ugi", "hadoop");

我收到以下错误。

13/01/08 09:59:44 INFO ipc.Client: Retrying connect to server: 192.168.65.132/192.168.65.132:8020. Already tried 7 time(s).
13/01/08 09:59:46 INFO ipc.Client: Retrying connect to server: 192.168.65.132/192.168.65.132:8020. Already tried 8 time(s).
13/01/08 09:59:48 INFO ipc.Client: Retrying connect to server: 192.168.65.132/192.168.65.132:8020. Already tried 9 time(s).
Exception in thread "main" java.net.ConnectException: Call to 192.168.65.132/192.168.65.132:8020 failed on connection exception: java.net.ConnectException: Connection refused: no further information

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.<init>(DFSClient.java:238)
at org.apache.hadoop.hdfs.DFSClient.<init>(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.fs.FileSystem.get(FileSystem.java:238)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(FileInputFormat.java:372)
at inverika.training.examples.WordCount.main(WordCount.java:37)
    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:599)
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.apache.hadoop.ipc.Client.call(Client.java:1050)
... 17 more

有没有人尝试过类似的设置?请分享您在这方面的经验。

网络统计转储:

Proto Recv-Q Send-Q Local Address   Foreign Address State 
tcp6  0      0      127.0.0.1:8020  :::*            LISTEN 
tcp6  0      0      127.0.0.1:8021  :::*            LISTEN 
tcp6  0      0      127.0.0.1:58399 127.0.0.1:8020  ESTABLISHED 
tcp6  0      0      127.0.0.1:8020  127.0.0.1:58399 ESTABLISHED 
tcp6  0      0      127.0.0.1:45042 127.0.0.1:8021  ESTABLISHED 
tcp6  0      0      127.0.0.1:8021  127.0.0.1:45042 ESTABLISHED
4

2 回答 2

0

从 netstat 来看,您的伪虚拟机似乎只会接受来自自身(虚拟机)的连接。我希望 NN 和 JT 的 netstat 条目看起来更像这样:

Proto Recv-Q Send-Q Local Address   Foreign Address State 
tcp   0      0      0.0.0.0:8020    :::*            LISTEN 
tcp   0      0      0.0.0.0:8021    :::*            LISTEN

我不确定作为 tcp6 的 proto 是否重要,但如果您想从外部连接到本地地址,本地地址应该显示为 0.0.0.0:[port]。127.0.0.1 是一个环回地址,因此只能接受来自 VM 本身的连接。

您还需要查看您的 VM 网络是如何配置的(NAT、桥接等) - 如果您无法从 windows cmd 行 ( ping 192.168.65.132) ping VM 地址,那么您将无法让 Eclipse 与虚拟机。地址是什么192.168.65.132- 是您的 Windows IP 地址,还是虚拟机的地址?

因此,要解决此问题,您将需要重新配置您的 VM 网络并修改您的 hadoop 配置以使用 vm 主机名/IP 地址(不是 127.0.0.1),或者您可以使用类似的东西PuTTY 并创建一些动态 IPv4 socks 隧道。

于 2013-01-25T11:55:46.727 回答
0

对于 ubuntu,我遵循 micheal-noll 并且它有效。也许你应该试试这个 http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/

于 2014-06-18T11:49:57.430 回答