我在网上和stackoverflow上搜索了很久,但没有用。
我已经在2节点集群中安装了hadoop yarn 2.2.0,但是出现了一些问题。 当我在主节点上使用start-dfs.sh和start-yarn.sh启动hadoop服务时,它们在主节点和从节点(我的主机名为RM,从节点的主机名为slv)上成功运行。它们可以相互ssh成功。但是当我想要运行一个任务时,就会出现以下错误:
14/01/02 04:22:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 14/01/02 04:22:56 WARN hdfs.DFSClient: DataStreamer Exception org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/root/QuasiMonteCarlo_1388665371850_813553673/in/part0 could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation. at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1384) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2477) at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:555) at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:387) at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java:59582) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585) at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2048) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:416) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2042)
at org.apache.hadoop.ipc.Client.call(Client.java:1347)
at org.apache.hadoop.ipc.Client.call(Client.java:1300)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
at com.sun.proxy.$Proxy9.addBlock(Unknown Source)
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:622)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:186)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
at com.sun.proxy.$Proxy9.addBlock(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:330)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(DFSOutputStream.java:1226)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1078)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:514)
在数据节点日志中存在以下内容:
2014-01-02 04:40:31,616 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: 连接服务器时出现问题:RM/192.168.1.101:9000 2014-01-02 04:40:37,618 INFO org.apache.hadoop.ipc.Client: 尝试重新连接服务器:RM/192.168.1.101:9000。已尝试0次$ 2014-01-02 04:40:38,619 INFO org.apache.hadoop.ipc.Client: 尝试重新连接服务器:RM/192.168.1.101:9000。已尝试1次$ 2014-01-02 04:40:39,620 INFO org.apache.hadoop.ipc.Client: 尝试重新连接服务器:RM/192.168.1.101:9000。已尝试2次$ 2014-01-02 04:40:40,621 INFO org.apache.hadoop.ipc.Client: 尝试重新连接服务器:RM/192.168.1.101:9000。已尝试3次
我检查了主节点上的9000端口,输出如下:
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 10227/java
我猜问题是由于当我在从节点上执行
telnet RM 9000
时,它显示
正在尝试连接192.168.1.101... telnet:无法连接到远程主机:连接被拒绝
然而,在执行
telnet RM
时,输出为:
正在尝试连接192.168.1.101... 已连接到RM。 转义字符是'^]'。 Ubuntu 12.04.2 LTS RM登录:
额外提供的信息是,我的主节点和从节点上的/etc/hosts如下:
127.0.0.1 RM|slv localhost
192.168.1.101 RM
192.168.1.103 slv
有人能提供一个解决方案吗? 非常感谢您的任何帮助。